Changeset 270010 in webkit
- Timestamp:
- Nov 18, 2020 7:40:20 PM (3 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 19 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/TestExpectations
r270009 r270010 2687 2687 webkit.org/b/172099 imported/w3c/web-platform-tests/FileAPI/url/url_xmlhttprequest_img.html [ ImageOnlyFailure ] 2688 2688 imported/w3c/web-platform-tests/FileAPI/url/sandboxed-iframe.html [ Failure ] 2689 # Test output contains WebKitFormBoundary lines with randomly generated text. 2690 imported/w3c/web-platform-tests/FileAPI/file/send-file-formdata-controls.tentative.html [ Failure ] 2689 2691 2690 2692 # Secure Contexts tests that timeout -
trunk/LayoutTests/imported/w3c/ChangeLog
r270009 r270010 1 2020-11-18 Chris Dumez <cdumez@apple.com> 2 3 Resync web-platform-tests/FileAPI tests from upstream 4 https://bugs.webkit.org/show_bug.cgi?id=219125 5 6 Reviewed by Sam Weinig. 7 8 Resync web-platform-tests/FileAPI tests from upstream dd35c2b21b76772123f7. 9 10 * web-platform-tests/FileAPI/file/File-constructor-expected.txt: 11 * web-platform-tests/FileAPI/file/File-constructor.html: 12 * web-platform-tests/FileAPI/file/resources/echo-content-escaped.py: Added. 13 (escape_byte): 14 (main): 15 * web-platform-tests/FileAPI/file/resources/w3c-import.log: Added. 16 * web-platform-tests/FileAPI/file/send-file-form-controls.tentative-expected.txt: Added. 17 * web-platform-tests/FileAPI/file/send-file-form-controls.tentative.html: Added. 18 * web-platform-tests/FileAPI/file/send-file-form-punctuation.tentative-expected.txt: Added. 19 * web-platform-tests/FileAPI/file/send-file-form-punctuation.tentative.html: Added. 20 * web-platform-tests/FileAPI/file/send-file-form-utf-8.html: 21 * web-platform-tests/FileAPI/file/send-file-form-windows-1252.tentative.html: 22 * web-platform-tests/FileAPI/file/send-file-form-x-user-defined.tentative.html: 23 * web-platform-tests/FileAPI/file/send-file-formdata-controls.tentative-expected.txt: Added. 24 * web-platform-tests/FileAPI/file/send-file-formdata-controls.tentative.html: Added. 25 * web-platform-tests/FileAPI/file/send-file-formdata-expected.txt: Added. 26 * web-platform-tests/FileAPI/file/send-file-formdata-punctuation.tentative-expected.txt: Added. 27 * web-platform-tests/FileAPI/file/send-file-formdata-punctuation.tentative.html: Added. 28 * web-platform-tests/FileAPI/file/send-file-formdata-utf-8-expected.txt: Added. 29 * web-platform-tests/FileAPI/file/send-file-formdata-utf-8.html: Added. 30 * web-platform-tests/FileAPI/file/send-file-formdata.html: Added. 31 * web-platform-tests/FileAPI/file/w3c-import.log: 32 * web-platform-tests/FileAPI/fileReader-expected.txt: 33 * web-platform-tests/FileAPI/fileReader.html: 34 * web-platform-tests/FileAPI/support/send-file-form-helper.js: 35 (escapeString): 36 (const.formPostFileUploadTest): 37 * web-platform-tests/FileAPI/support/send-file-formdata-helper.js: Added. 38 (const.formDataPostFileUploadTest): 39 * web-platform-tests/FileAPI/support/w3c-import.log: 40 * web-platform-tests/FileAPI/url/url-charset.window-expected.txt: Added. 41 * web-platform-tests/FileAPI/url/url-charset.window.html: Added. 42 * web-platform-tests/FileAPI/url/url-charset.window.js: Added. 43 (async_test.t.t.add_cleanup): 44 (async_test.t.win.onload.t.step_func_done): 45 * web-platform-tests/FileAPI/url/w3c-import.log: 46 1 47 2020-11-18 Chris Dumez <cdumez@apple.com> 2 48 -
trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/File-constructor-expected.txt
r267651 r270010 24 24 PASS Bits argument: object that throws 25 25 PASS Using fileName 26 FAIL Using special character in fileName assert_equals: expected "dummy:foo" but got "dummy/foo" 26 PASS No replacement when using special character in fileName 27 27 PASS Using null fileName 28 28 PASS Using number fileName -
trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/File-constructor.html
r263059 r270010 85 85 86 86 test_second_argument("dummy", "dummy", "Using fileName"); 87 test_second_argument("dummy/foo", "dummy:foo", "Using special character in fileName"); 87 test_second_argument("dummy/foo", "dummy/foo", 88 "No replacement when using special character in fileName"); 88 89 test_second_argument(null, "null", "Using null fileName"); 89 90 test_second_argument(1, "1", "Using number fileName"); -
trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/send-file-form-utf-8.html
r232641 r270010 28 28 formEncoding: 'UTF-8', 29 29 expectedEncodedBaseName: ( 30 'file-for-upload-in-form-\ uF7F0\uF793\uF783\uF7A0.txt'),30 'file-for-upload-in-form-\xEF\x9F\xB0\xEF\x9E\x93\xEF\x9E\x83\xEF\x9E\xA0.txt'), 31 31 }); 32 32 … … 35 35 fileBaseName: 'file-for-upload-in-form-☺😂.txt', 36 36 formEncoding: 'UTF-8', 37 expectedEncodedBaseName: 'file-for-upload-in-form-☺😂.txt', 37 expectedEncodedBaseName: ( 38 'file-for-upload-in-form-\xC3\xA2\xCB\x9C\xC2\xBA\xC3\xB0\xC5\xB8\xCB\x9C\xE2\x80\x9A.txt'), 38 39 }); 39 40 … … 42 43 fileBaseName: 'file-for-upload-in-form-★星★.txt', 43 44 formEncoding: 'UTF-8', 44 expectedEncodedBaseName: 'file-for-upload-in-form- ★星★.txt',45 expectedEncodedBaseName: 'file-for-upload-in-form-\xE2\x98\x85\xE6\x98\x9F\xE2\x98\x85.txt', 45 46 }); 46 47 … … 49 50 fileBaseName: 'file-for-upload-in-form-☺😂.txt', 50 51 formEncoding: 'UTF-8', 51 expectedEncodedBaseName: 'file-for-upload-in-form- ☺😂.txt',52 expectedEncodedBaseName: 'file-for-upload-in-form-\xE2\x98\xBA\xF0\x9F\x98\x82.txt', 52 53 }); 53 54 … … 56 57 fileBaseName: `file-for-upload-in-form-${kTestChars}.txt`, 57 58 formEncoding: 'UTF-8', 58 expectedEncodedBaseName: `file-for-upload-in-form-${kTest Chars}.txt`,59 expectedEncodedBaseName: `file-for-upload-in-form-${kTestFallbackUtf8}.txt`, 59 60 }); 60 61 -
trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/send-file-form-windows-1252.tentative.html
r232641 r270010 34 34 fileBaseName: 'file-for-upload-in-form-\uF7F0\uF793\uF783\uF7A0.txt', 35 35 formEncoding: 'windows-1252', 36 expectedEncodedBaseName: ( 37 'file-for-upload-in-form-.txt'), 36 expectedEncodedBaseName: 'file-for-upload-in-form-.txt', 38 37 }); 39 38 … … 42 41 fileBaseName: 'file-for-upload-in-form-☺😂.txt', 43 42 formEncoding: 'windows-1252', 44 expectedEncodedBaseName: 'file-for-upload-in-form- ☺😂.txt',43 expectedEncodedBaseName: 'file-for-upload-in-form-\xE2\x98\xBA\xF0\x9F\x98\x82.txt', 45 44 }); 46 45 -
trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/send-file-form-x-user-defined.tentative.html
r232641 r270010 34 34 fileBaseName: 'file-for-upload-in-form-\uF7F0\uF793\uF783\uF7A0.txt', 35 35 formEncoding: 'x-user-defined', 36 expectedEncodedBaseName: 'file-for-upload-in-form- 𓃠.txt',36 expectedEncodedBaseName: 'file-for-upload-in-form-\xF0\x93\x83\xA0.txt', 37 37 }); 38 38 -
trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/w3c-import.log
r263059 r270010 18 18 /LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/File-constructor.html 19 19 /LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/Worker-read-file-constructor.worker.js 20 /LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/send-file-form-controls.tentative.html 20 21 /LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/send-file-form-iso-2022-jp.tentative.html 22 /LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/send-file-form-punctuation.tentative.html 21 23 /LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/send-file-form-utf-8.html 22 24 /LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/send-file-form-windows-1252.tentative.html 23 25 /LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/send-file-form-x-user-defined.tentative.html 24 26 /LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/send-file-form.html 27 /LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/send-file-formdata-controls.tentative.html 28 /LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/send-file-formdata-punctuation.tentative.html 29 /LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/send-file-formdata-utf-8.html 30 /LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/send-file-formdata.html -
trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/fileReader-expected.txt
r268054 r270010 4 4 PASS FileReader States -- abort 5 5 PASS FileReader States -- events 6 PASS FileReader States -- abort during progress7 6 -
trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/fileReader.html
r268054 r270010 36 36 t_abort.done(); 37 37 }); 38 fileReader.onerror = this.unreached_func("onerror should not be called when abort is called");39 38 fileReader.abort(); 40 39 fileReader.onabort = this.unreached_func("abort event should fire sync") … … 64 63 }); 65 64 }); 66 67 var t_abort_during_progress = async_test("FileReader States -- abort during progress");68 t_abort_during_progress.step(function() {69 var fileReader = new FileReader();70 71 var blob = new Blob([1]);72 fileReader.readAsArrayBuffer(blob);73 74 var onprogressCalled = false;75 fileReader.onprogress = this.step_func(function(e) {76 onprogressCalled = true;77 fileReader.abort();78 });79 80 fileReader.onabort = this.step_func(function(e) {81 assert_unreached("onabort should not be called if abort is called during final onprogress");82 });83 84 fileReader.onloadend = this.step_func(function(e) {85 assert_true(onprogressCalled, "onprogress should be called before onloadend");86 setTimeout(function() {87 t_abort_during_progress.done();88 }, 0);89 });90 });91 65 </script> 92 66 </body> -
trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/support/send-file-form-helper.js
r232641 r270010 1 1 'use strict'; 2 3 // See /FileAPI/file/resources/echo-content-escaped.py 4 function escapeString(string) { 5 return string.replace(/\\/g, "\\\\").replace( 6 /[^\x20-\x7E]/g, 7 (x) => { 8 let hex = x.charCodeAt(0).toString(16); 9 if (hex.length < 2) hex = "0" + hex; 10 return `\\x${hex}`; 11 }, 12 ).replace(/\\x0d\\x0a/g, "\r\n"); 13 } 2 14 3 15 // Rationale for this particular test character sequence, which is … … 73 85 const kTestChars = 'ABC~‾¥≈¤・・•∙·☼★星🌟星★☼·∙•・・¤≈¥‾~XYZ'; 74 86 75 // NOTE: The expected interpretation of ISO-2022-JP according to 76 // https://encoding.spec.whatwg.org/#iso-2022-jp-encoder unifies 77 // single-byte and double-byte katakana. 78 const kTestFallbackIso2022jp = 79 ('ABC~\x1B(J~\\≈¤\x1B$B!&!&\x1B(B•∙·☼\x1B$B!z@1\x1B(B🌟' + 80 '\x1B$B@1!z\x1B(B☼·∙•\x1B$B!&!&\x1B(B¤≈\x1B(J\\~\x1B(B~XYZ').replace( 81 /[^\0-\x7F]/gu, 82 x => `&#${x.codePointAt(0)};`); 83 84 // NOTE: \uFFFD is used here to replace Windows-1252 bytes to match 85 // how we will see them in the reflected POST bytes in a frame using 86 // UTF-8 byte interpretation. The bytes will actually be intact, but 87 // this code cannot tell and does not really care. 88 const kTestFallbackWindows1252 = 89 'ABC~‾\xA5≈\xA4・・\x95∙\xB7☼★星🌟星★☼\xB7∙\x95・・\xA4≈\xA5‾~XYZ'.replace( 90 /[^\0-\xFF]/gu, 91 x => `&#${x.codePointAt(0)};`).replace(/[\x80-\xFF]/g, '\uFFFD'); 92 93 const kTestFallbackXUserDefined = 94 kTestChars.replace(/[^\0-\x7F]/gu, x => `&#${x.codePointAt(0)};`); 87 // The kTestFallback* strings represent the expected byte sequence from 88 // encoding kTestChars with the given encoding with "html" replacement 89 // mode, isomorphic-decoded. That means, characters that can't be 90 // encoded in that encoding get HTML-escaped, but no further 91 // `escapeString`-like escapes are needed. 92 const kTestFallbackUtf8 = ( 93 "ABC~\xE2\x80\xBE\xC2\xA5\xE2\x89\x88\xC2\xA4\xEF\xBD\xA5\xE3\x83\xBB\xE2" + 94 "\x80\xA2\xE2\x88\x99\xC2\xB7\xE2\x98\xBC\xE2\x98\x85\xE6\x98\x9F\xF0\x9F" + 95 "\x8C\x9F\xE6\x98\x9F\xE2\x98\x85\xE2\x98\xBC\xC2\xB7\xE2\x88\x99\xE2\x80" + 96 "\xA2\xE3\x83\xBB\xEF\xBD\xA5\xC2\xA4\xE2\x89\x88\xC2\xA5\xE2\x80\xBE~XYZ" 97 ); 98 99 const kTestFallbackIso2022jp = ( 100 ("ABC~\x1B(J~\\≈¤\x1B$B!&!&\x1B(B•∙·☼\x1B$B!z@1\x1B(B🌟" + 101 "\x1B$B@1!z\x1B(B☼·∙•\x1B$B!&!&\x1B(B¤≈\x1B(J\\~\x1B(B~XYZ") 102 .replace(/[^\0-\x7F]/gu, (x) => `&#${x.codePointAt(0)};`) 103 ); 104 105 const kTestFallbackWindows1252 = ( 106 "ABC~‾\xA5≈\xA4・・\x95∙\xB7☼★星🌟星★☼\xB7∙\x95・・\xA4≈\xA5‾~XYZ".replace( 107 /[^\0-\xFF]/gu, 108 (x) => `&#${x.codePointAt(0)};`, 109 ) 110 ); 111 112 const kTestFallbackXUserDefined = kTestChars.replace( 113 /[^\0-\x7F]/gu, 114 (x) => `&#${x.codePointAt(0)};`, 115 ); 95 116 96 117 // formPostFileUploadTest - verifies multipart upload structure and 97 118 // numeric character reference replacement for filenames, field names, 98 // and field values. 99 // 100 // Uses /fetch/api/resources/echo-content.py to echo the upload 101 // POST with UTF-8 byte interpretation, leading to the "UTF-8 goggles" 102 // behavior documented below for expectedEncodedBaseName when non- 103 // UTF-8-compatible byte sequences appear in the formEncoding-encoded 104 // uploaded data. 119 // and field values using form submission. 120 // 121 // Uses /FileAPI/file/resources/echo-content-escaped.py to echo the 122 // upload POST with controls and non-ASCII bytes escaped. This is done 123 // because navigations whose response body contains [\0\b\v] may get 124 // treated as a download, which is not what we want. Use the 125 // `escapeString` function to replicate that kind of escape (note that 126 // it takes an isomorphic-decoded string, not a byte sequence). 105 127 // 106 128 // Fields in the parameter object: … … 115 137 // test file. Used in the test name. 116 138 // - expectedEncodedBaseName: the expected formEncoding-encoded 117 // version of fileBaseName with unencodable characters replaced by 118 // numeric character references and non-7-bit-ASCII bytes seen 119 // through UTF-8 goggles; subsequences not interpretable as UTF-8 120 // have each byte represented here by \uFFFD REPLACEMENT CHARACTER. 139 // version of fileBaseName, isomorphic-decoded. That means, characters 140 // that can't be encoded in that encoding get HTML-escaped, but no 141 // further `escapeString`-like escapes are needed. 121 142 const formPostFileUploadTest = ({ 122 143 fileNameSource, … … 141 162 const form = Object.assign(document.createElement('form'), { 142 163 acceptCharset: formEncoding, 143 action: '/ fetch/api/resources/echo-content.py',164 action: '/FileAPI/file/resources/echo-content-escaped.py', 144 165 method: 'POST', 145 166 enctype: 'multipart/form-data', … … 195 216 // verifies that assumption. 196 217 assert_equals( 197 fileInput.files[0].name,218 baseNameOfFilePath(fileInput.files[0].name), 198 219 baseNameOfFilePath(fileInput.value), 199 220 `The basename of the field's value should match its files[0].name`); … … 220 241 JSON.stringify(formDataText) 221 242 }`); 243 244 const asValue = expectedEncodedBaseName.replace(/\r\n?|\n/g, "\r\n"); 245 const asName = asValue.replace(/[\r\n"]/g, encodeURIComponent); 246 const asFilename = expectedEncodedBaseName.replace(/[\r\n"]/g, encodeURIComponent); 247 248 // The response body from echo-content-escaped.py has controls and non-ASCII 249 // bytes escaped, so any caller-provided field that might contain such bytes 250 // must be passed to `escapeString`, after any other expected 251 // transformations. 222 252 const expectedText = [ 223 253 boundary, … … 228 258 'Content-Disposition: form-data; name="filename"', 229 259 '', 230 expectedEncodedBaseName, 231 boundary, 232 `Content-Disposition: form-data; name="${expectedEncodedBaseName}"`, 260 // Unlike for names and filenames, multipart/form-data values don't escape 261 // \r\n linebreaks, and when they're read from an iframe they become \n. 262 escapeString(asValue).replace(/\r\n/g, "\n"), 263 boundary, 264 `Content-Disposition: form-data; name="${escapeString(asName)}"`, 233 265 '', 234 266 'filename', 235 267 boundary, 236 268 `Content-Disposition: form-data; name="file"; ` + 237 `filename="${e xpectedEncodedBaseName}"`,269 `filename="${escapeString(asFilename)}"`, 238 270 'Content-Type: text/plain', 239 271 '', 240 kTestChars,272 escapeString(kTestFallbackUtf8), 241 273 boundary + '--', 242 274 ].join('\n'); 275 243 276 assert_true( 244 277 formDataText.startsWith(expectedText), -
trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/support/w3c-import.log
r263059 r270010 20 20 /LayoutTests/imported/w3c/web-platform-tests/FileAPI/support/incumbent.sub.html 21 21 /LayoutTests/imported/w3c/web-platform-tests/FileAPI/support/send-file-form-helper.js 22 /LayoutTests/imported/w3c/web-platform-tests/FileAPI/support/send-file-formdata-helper.js 22 23 /LayoutTests/imported/w3c/web-platform-tests/FileAPI/support/upload.txt 23 24 /LayoutTests/imported/w3c/web-platform-tests/FileAPI/support/url-origin.html -
trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/w3c-import.log
r263059 r270010 19 19 /LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/sandboxed-iframe.html 20 20 /LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/unicode-origin.sub.html 21 /LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-charset.window.js 21 22 /LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-format.any.js 22 23 /LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-in-tags-revoke.window.js
Note: See TracChangeset
for help on using the changeset viewer.