Changeset 270032 in webkit
- Timestamp:
- Nov 19, 2020 8:34:39 AM (3 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 9 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/http/wpt/beacon/keepalive-after-navigation.html
r220495 r270032 14 14 15 15 function pollResult(test, id) { 16 var checkUrl = RESOURCES_DIR + "content-type .py?cmd=get&id=" + id;16 var checkUrl = RESOURCES_DIR + "content-type-and-body.py?cmd=get&id=" + id; 17 17 18 18 return new Promise(resolve => { … … 34 34 35 35 return pollResult(test, id).then(result => { 36 assert_equals(result, "text/plain;charset=UTF-8 ", "Correct content-type header result");36 assert_equals(result, "text/plain;charset=UTF-8: test", "Correct content-type header result"); 37 37 }); 38 38 }, "Test that beacon sent from unload event handler is properly received"); -
trunk/LayoutTests/http/wpt/beacon/sendBeacon-in-pagehide.html
r234684 r270032 14 14 15 15 function pollResult(test, id) { 16 var checkUrl = RESOURCES_DIR + "content-type .py?cmd=get&id=" + id;16 var checkUrl = RESOURCES_DIR + "content-type-and-body.py?cmd=get&id=" + id; 17 17 18 18 return new Promise(resolve => { … … 37 37 38 38 return pollResult(test, id).then(result => { 39 assert_equals(result, "text/plain;charset=UTF-8 ", "Correct content-type header result");39 assert_equals(result, "text/plain;charset=UTF-8: test", "Correct content-type header result"); 40 40 }); 41 41 }, "Test that beacon sent from pagehide event handler is properly received"); -
trunk/LayoutTests/http/wpt/beacon/support/sendBeacon-onpagehide-window.html
r268400 r270032 13 13 <script> 14 14 onpagehide = function() { 15 const testUrl = RESOURCES_DIR + "content-type .py?cmd=put&id=" + id;15 const testUrl = RESOURCES_DIR + "content-type-and-body.py?cmd=put&id=" + id; 16 16 navigator.sendBeacon(testUrl, "test"); 17 17 } -
trunk/LayoutTests/http/wpt/beacon/support/sendBeacon-onunload-iframe.html
r220304 r270032 10 10 11 11 function unload() { 12 var testUrl = RESOURCES_DIR + "content-type .py?cmd=put&id=" + id;12 var testUrl = RESOURCES_DIR + "content-type-and-body.py?cmd=put&id=" + id; 13 13 navigator.sendBeacon(testUrl, "test"); 14 14 } -
trunk/LayoutTests/http/wpt/fetch/fetch-in-pagehide.html
r264698 r270032 15 15 function checkUrl(id) 16 16 { 17 return RESOURCES_DIR + "content-type .py?cmd=get&id=" + id;17 return RESOURCES_DIR + "content-type-and-body.py?cmd=get&id=" + id; 18 18 } 19 19 … … 32 32 assert_equals(response.status, 200); 33 33 const result = await response.text(); 34 assert_equals(result, "text/plain;charset=UTF-8 ", "Correct content-type header result");34 assert_equals(result, "text/plain;charset=UTF-8: test", "Correct content-type header result"); 35 35 }, "Test that fetch sent from pagehide event handler is properly received with keepalive"); 36 36 -
trunk/LayoutTests/http/wpt/fetch/resources/fetch-in-pagehide-window.html
r268400 r270032 13 13 <script> 14 14 onpagehide = function() { 15 const testUrl = RESOURCES_DIR + "content-type .py?cmd=put&id=" + id;15 const testUrl = RESOURCES_DIR + "content-type-and-body.py?cmd=put&id=" + id; 16 16 fetch(testUrl, { method : 'POST', headers : [["Content-Type", "text/plain;charset=UTF-8"]], body: 'test', keepalive : location.hash === "#keepalive" }); 17 17 } -
trunk/LayoutTests/imported/w3c/ChangeLog
r270031 r270032 1 2020-11-19 Chris Dumez <cdumez@apple.com> 2 3 Resync web-platform-tests/beacon tests from upstream 4 https://bugs.webkit.org/show_bug.cgi?id=219123 5 6 Reviewed by Sam Weinig. 7 8 Resync web-platform-tests/beacon tests from upstream dd35c2b21b76772123f7. 9 10 * web-platform-tests/beacon/headers/header-content-type-and-body-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/beacon/headers/header-content-type-expected.txt. 11 * web-platform-tests/beacon/headers/header-content-type-and-body.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/beacon/headers/header-content-type.html. 12 * web-platform-tests/beacon/headers/w3c-import.log: 13 * web-platform-tests/beacon/resources/content-type-and-body.py: Renamed from LayoutTests/imported/w3c/web-platform-tests/beacon/resources/content-type.py. 14 (main): 15 * web-platform-tests/beacon/resources/w3c-import.log: 16 1 17 2020-11-19 Commit Queue <commit-queue@webkit.org> 2 18 -
trunk/LayoutTests/imported/w3c/web-platform-tests/beacon/headers/header-content-type-and-body.html
r270031 r270032 13 13 const RESOURCES_DIR = "/beacon/resources/"; 14 14 15 function testContentType Header(what, contentType, title) {15 function testContentTypeAndBody(what, expected, title) { 16 16 function wait(ms) { 17 17 return new Promise(resolve => step_timeout(resolve, ms)); … … 19 19 promise_test(async t => { 20 20 const id = self.token(); 21 const testUrl = new Request(RESOURCES_DIR + "content-type .py?cmd=put&id=" + id).url;21 const testUrl = new Request(RESOURCES_DIR + "content-type-and-body.py?cmd=put&id=" + id).url; 22 22 assert_equals(performance.getEntriesByName(testUrl).length, 0); 23 23 assert_true(navigator.sendBeacon(testUrl, what), "SendBeacon Succeeded"); … … 27 27 } while (performance.getEntriesByName(testUrl).length === 0); 28 28 assert_equals(performance.getEntriesByName(testUrl).length, 1); 29 const checkUrl = RESOURCES_DIR + "content-type .py?cmd=get&id=" + id;29 const checkUrl = RESOURCES_DIR + "content-type-and-body.py?cmd=get&id=" + id; 30 30 const response = await fetch(checkUrl); 31 31 const text = await response.text(); 32 if (contentType === "multipart/form-data") { 32 if (expected.startsWith("multipart/form-data")) { 33 const split = expected.split(":"); 34 const contentType = split[0]; 35 const contentDisposition = "Content-Disposition: form-data; name=\"" + split[1] + "\"; filename=\"blob\""; 33 36 assert_true(text.startsWith(contentType), "Correct Content-Type header result"); 37 assert_true(text.includes(contentDisposition), "Body included value"); 34 38 } else { 35 assert_equals(text, contentType, "Correct Content-Type header result");39 assert_equals(text, expected, "Correct Content-Type header result"); 36 40 } 37 41 }, "Test content-type header for a body " + title); … … 75 79 } 76 80 77 testContentType Header("hi!", "text/plain;charset=UTF-8", "string");78 testContentType Header(stringToArrayBufferView("123"), "", "ArrayBufferView");79 testContentType Header(stringToArrayBuffer("123"), "", "ArrayBuffer");80 testContentType Header(stringToBlob("123"), "text/plain", "Blob");81 testContentType Header(stringToFormData("qwerty"), "multipart/form-data", "FormData");82 testContentType Header(stringToURLSearchParams("key1=value1&key2=value2"), "application/x-www-form-urlencoded;charset=UTF-8", "URLSearchParams");81 testContentTypeAndBody("hi!", "text/plain;charset=UTF-8: hi!", "string"); 82 testContentTypeAndBody(stringToArrayBufferView("123"), ": 1\0" + "2\0" + "3\0", "ArrayBufferView"); 83 testContentTypeAndBody(stringToArrayBuffer("123"), ": 1\0" + "2\0" + "3\0", "ArrayBuffer"); 84 testContentTypeAndBody(stringToBlob("123"), "text/plain: 123", "Blob"); 85 testContentTypeAndBody(stringToFormData("qwerty"), "multipart/form-data:qwerty", "FormData"); 86 testContentTypeAndBody(stringToURLSearchParams("key1=value1&key2=value2"), "application/x-www-form-urlencoded;charset=UTF-8: key1=value1&key2=value2", "URLSearchParams"); 83 87 </script> 84 88 </body> -
trunk/LayoutTests/imported/w3c/web-platform-tests/beacon/headers/w3c-import.log
r253760 r270032 15 15 ------------------------------------------------------------------------ 16 16 List of files: 17 /LayoutTests/imported/w3c/web-platform-tests/beacon/headers/header-content-type .html17 /LayoutTests/imported/w3c/web-platform-tests/beacon/headers/header-content-type-and-body.html 18 18 /LayoutTests/imported/w3c/web-platform-tests/beacon/headers/header-referrer-no-referrer-when-downgrade.https.html 19 19 /LayoutTests/imported/w3c/web-platform-tests/beacon/headers/header-referrer-no-referrer.html -
trunk/LayoutTests/imported/w3c/web-platform-tests/beacon/resources/content-type-and-body.py
r270031 r270032 3 3 test_id = request.GET.first(b"id") 4 4 if command == b"put": 5 request.server.stash.put(test_id, request.headers.get(b"Content-Type", b"") )5 request.server.stash.put(test_id, request.headers.get(b"Content-Type", b"") + b": " + request.body) 6 6 return [(b"Content-Type", b"text/plain")], u"" 7 7 -
trunk/LayoutTests/imported/w3c/web-platform-tests/beacon/resources/w3c-import.log
r253760 r270032 16 16 List of files: 17 17 /LayoutTests/imported/w3c/web-platform-tests/beacon/resources/beacon.py 18 /LayoutTests/imported/w3c/web-platform-tests/beacon/resources/content-type .py18 /LayoutTests/imported/w3c/web-platform-tests/beacon/resources/content-type-and-body.py 19 19 /LayoutTests/imported/w3c/web-platform-tests/beacon/resources/inspect-header.py
Note: See TracChangeset
for help on using the changeset viewer.