Update web-platform-tests to revision d9ff48a8babff036c1f9d5285ec0dc55609bebb8

This commit is contained in:
WPT Sync Bot 2020-04-29 08:19:25 +00:00
parent ba0df48d47
commit d4bfc5902a
268 changed files with 14742 additions and 1039 deletions

View file

@ -0,0 +1,2 @@
[2d.imageData.get.large.crash.html]
expected: CRASH

View file

@ -0,0 +1,4 @@
[2d.video.invalid.html]
[Verify test doesn't crash with invalid video.]
expected: FAIL

View file

@ -4,7 +4,7 @@
expected: TIMEOUT expected: TIMEOUT
[Opening a blob URL in a new window immediately before revoking it works.] [Opening a blob URL in a new window immediately before revoking it works.]
expected: FAIL expected: TIMEOUT
[Fetching a blob URL immediately before revoking it works in an iframe.] [Fetching a blob URL immediately before revoking it works in an iframe.]
expected: FAIL expected: FAIL

View file

@ -1,4 +0,0 @@
[hit-test-floats-004.html]
[Miss float below something else]
expected: FAIL

View file

@ -5,6 +5,9 @@
[[data-expected-height\] 7] [[data-expected-height\] 7]
expected: FAIL expected: FAIL
[[data-expected-height\] 4] [[data-expected-height\] 1]
expected: FAIL
[[data-expected-height\] 2]
expected: FAIL expected: FAIL

View file

@ -50,3 +50,6 @@
[Yet-to-start CSS Animations are returned] [Yet-to-start CSS Animations are returned]
expected: FAIL expected: FAIL
[pseudo element with replaced target does not affect animation ordering]
expected: FAIL

View file

@ -0,0 +1,2 @@
[background-attachment-margin-root-001.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[background-attachment-margin-root-002.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[svg-image-orientation-none.html]
expected: FAIL

View file

@ -1,2 +1,2 @@
[no-transition-from-ua-to-blocking-stylesheet.html] [no-transition-from-ua-to-blocking-stylesheet.html]
expected: FAIL expected: TIMEOUT

View file

@ -17,3 +17,6 @@
[test the top of layer] [test the top of layer]
expected: FAIL expected: FAIL
[test some point of the element: top left corner]
expected: FAIL

View file

@ -2,6 +2,3 @@
[elementsFromPoint on the root document for points in iframe elements] [elementsFromPoint on the root document for points in iframe elements]
expected: FAIL expected: FAIL
[elementsFromPoint on inner documents]
expected: FAIL

View file

@ -318,12 +318,18 @@
[<iframe>: combined response Content-Type: text/html;" \\" text/plain] [<iframe>: combined response Content-Type: text/html;" \\" text/plain]
expected: FAIL expected: FAIL
[<iframe>: combined response Content-Type: text/html */*;charset=gbk]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;" \\" text/plain] [<iframe>: separate response Content-Type: text/html;" \\" text/plain]
expected: FAIL expected: FAIL
[<iframe>: separate response Content-Type: text/plain */*;charset=gbk] [<iframe>: combined response Content-Type: */* text/html]
expected: FAIL
[<iframe>: separate response Content-Type: text/html */*]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;x=" text/plain]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;x=" text/plain]
expected: FAIL expected: FAIL

View file

@ -59,6 +59,3 @@
[separate text/javascript;charset=windows-1252 error text/javascript] [separate text/javascript;charset=windows-1252 error text/javascript]
expected: FAIL expected: FAIL
[separate text/javascript;charset=windows-1252 text/javascript]
expected: FAIL

View file

@ -11,3 +11,6 @@
[X-Content-Type-Options%3A%20nosniff%0C] [X-Content-Type-Options%3A%20nosniff%0C]
expected: FAIL expected: FAIL
[X-Content-Type-Options%3A%20%22nosniFF%22]
expected: FAIL

View file

@ -1,4 +0,0 @@
[traverse_the_history_1.html]
[Multiple history traversals from the same task]
expected: FAIL

View file

@ -1,4 +0,0 @@
[traverse_the_history_2.html]
[Multiple history traversals, last would be aborted]
expected: FAIL

View file

@ -1,4 +0,0 @@
[traverse_the_history_3.html]
[Multiple history traversals, last would be aborted]
expected: FAIL

View file

@ -1,4 +1,4 @@
[traverse_the_history_2.html] [traverse_the_history_4.html]
[Multiple history traversals, last would be aborted] [Multiple history traversals, last would be aborted]
expected: FAIL expected: FAIL

View file

@ -0,0 +1,2 @@
[cross-origin-objects-on-new-window.html]
expected: TIMEOUT

View file

@ -4,14 +4,17 @@
expected: FAIL expected: FAIL
[Host element with delegatesFocus including no focusable descendants should be skipped] [Host element with delegatesFocus including no focusable descendants should be skipped]
expected: FAIL expected: NOTRUN
[Element with tabindex should support autofocus] [Element with tabindex should support autofocus]
expected: FAIL
[Area element should support autofocus]
expected: TIMEOUT expected: TIMEOUT
[Host element with delegatesFocus should support autofocus] [Area element should support autofocus]
expected: FAIL expected: NOTRUN
[Host element with delegatesFocus should support autofocus]
expected: NOTRUN
[Non-HTMLElement should not support autofocus]
expected: NOTRUN

View file

@ -1,5 +1,5 @@
[iframe_sandbox_popups_nonescaping-2.html] [iframe_sandbox_popups_nonescaping-2.html]
expected: TIMEOUT expected: CRASH
[Check that popups from a sandboxed iframe do not escape the sandbox] [Check that popups from a sandboxed iframe do not escape the sandbox]
expected: NOTRUN expected: NOTRUN

View file

@ -1,5 +1,5 @@
[iframe_sandbox_popups_nonescaping-3.html] [iframe_sandbox_popups_nonescaping-3.html]
expected: TIMEOUT expected: CRASH
[Check that popups from a sandboxed iframe do not escape the sandbox] [Check that popups from a sandboxed iframe do not escape the sandbox]
expected: NOTRUN expected: NOTRUN

View file

@ -1,2 +0,0 @@
[script-onerror-insertion-point-2.html]
expected: TIMEOUT

View file

@ -3,6 +3,3 @@
[The incumbent settings object while executing the compiled callback via Web IDL's invoke must be that of the node document] [The incumbent settings object while executing the compiled callback via Web IDL's invoke must be that of the node document]
expected: TIMEOUT expected: TIMEOUT
[The entry settings object while executing the compiled callback via Web IDL's invoke must be that of the node document]
expected: TIMEOUT

View file

@ -0,0 +1,327 @@
[url-setters-stripping.any.html]
[Setting pathname with leading U+001F (https:)]
expected: FAIL
[Setting protocol with U+0000 before inserted colon (https:)]
expected: FAIL
[Setting pathname with leading U+001F (wpt++:)]
expected: FAIL
[Setting hostname with leading U+0000 (wpt++:)]
expected: FAIL
[Setting search with trailing U+001F (https:)]
expected: FAIL
[Setting search with leading U+0000 (wpt++:)]
expected: FAIL
[Setting hostname with trailing U+001F (wpt++:)]
expected: FAIL
[Setting search with leading U+001F (wpt++:)]
expected: FAIL
[Setting search with leading U+001F (https:)]
expected: FAIL
[Setting hash with trailing U+001F (wpt++:)]
expected: FAIL
[Setting protocol with leading U+0000 (wpt++:)]
expected: FAIL
[Setting host with trailing U+0000 (https:)]
expected: FAIL
[Setting host with leading U+0000 (https:)]
expected: FAIL
[Setting pathname with trailing U+001F (https:)]
expected: FAIL
[Setting protocol with leading U+001F (https:)]
expected: FAIL
[Setting pathname with trailing U+001F (wpt++:)]
expected: FAIL
[Setting hash with trailing U+001F (https:)]
expected: FAIL
[Setting search with trailing U+001F (wpt++:)]
expected: FAIL
[Setting search with leading U+0000 (https:)]
expected: FAIL
[Setting protocol with leading U+0000 (https:)]
expected: FAIL
[Setting host with leading U+001F (https:)]
expected: FAIL
[Setting pathname with leading U+0000 (wpt++:)]
expected: FAIL
[Setting hash with trailing U+0000 (https:)]
expected: FAIL
[Setting hash with middle U+0000 (wpt++:)]
expected: FAIL
[Setting hash with leading U+001F (wpt++:)]
expected: FAIL
[Setting hostname with leading U+001F (https:)]
expected: FAIL
[Setting hash with leading U+0000 (wpt++:)]
expected: FAIL
[Setting hash with leading U+0000 (https:)]
expected: FAIL
[Setting protocol with U+001F before inserted colon (wpt++:)]
expected: FAIL
[Setting hostname with trailing U+001F (https:)]
expected: FAIL
[Setting hostname with trailing U+0000 (https:)]
expected: FAIL
[Setting host with trailing U+001F (https:)]
expected: FAIL
[Setting pathname with trailing U+0000 (https:)]
expected: FAIL
[Setting pathname with leading U+0000 (https:)]
expected: FAIL
[Setting port with leading U+0000 (wpt++:)]
expected: FAIL
[Setting protocol with U+0000 before inserted colon (wpt++:)]
expected: FAIL
[Setting protocol with U+001F before inserted colon (https:)]
expected: FAIL
[Setting pathname with trailing U+0000 (wpt++:)]
expected: FAIL
[Setting hostname with leading U+0000 (https:)]
expected: FAIL
[Setting host with leading U+001F (wpt++:)]
expected: FAIL
[Setting hash with trailing U+0000 (wpt++:)]
expected: FAIL
[Setting protocol with leading U+001F (wpt++:)]
expected: FAIL
[Setting port with leading U+0000 (https:)]
expected: FAIL
[Setting hash with leading U+001F (https:)]
expected: FAIL
[Setting search with trailing U+0000 (https:)]
expected: FAIL
[Setting host with trailing U+0000 (wpt++:)]
expected: FAIL
[Setting search with trailing U+0000 (wpt++:)]
expected: FAIL
[Setting hostname with trailing U+0000 (wpt++:)]
expected: FAIL
[Setting port with leading U+001F (https:)]
expected: FAIL
[Setting hash with middle U+0000 (https:)]
expected: FAIL
[Setting host with leading U+0000 (wpt++:)]
expected: FAIL
[Setting host with trailing U+001F (wpt++:)]
expected: FAIL
[Setting hostname with leading U+001F (wpt++:)]
expected: FAIL
[Setting port with leading U+001F (wpt++:)]
expected: FAIL
[url-setters-stripping.any.worker.html]
[Setting pathname with leading U+001F (https:)]
expected: FAIL
[Setting protocol with U+0000 before inserted colon (https:)]
expected: FAIL
[Setting pathname with leading U+001F (wpt++:)]
expected: FAIL
[Setting hostname with leading U+0000 (wpt++:)]
expected: FAIL
[Setting search with trailing U+001F (https:)]
expected: FAIL
[Setting search with leading U+0000 (wpt++:)]
expected: FAIL
[Setting hostname with trailing U+001F (wpt++:)]
expected: FAIL
[Setting search with leading U+001F (wpt++:)]
expected: FAIL
[Setting search with leading U+001F (https:)]
expected: FAIL
[Setting hash with trailing U+001F (wpt++:)]
expected: FAIL
[Setting protocol with leading U+0000 (wpt++:)]
expected: FAIL
[Setting host with trailing U+0000 (https:)]
expected: FAIL
[Setting host with leading U+0000 (https:)]
expected: FAIL
[Setting pathname with trailing U+001F (https:)]
expected: FAIL
[Setting protocol with leading U+001F (https:)]
expected: FAIL
[Setting pathname with trailing U+001F (wpt++:)]
expected: FAIL
[Setting hash with trailing U+001F (https:)]
expected: FAIL
[Setting search with trailing U+001F (wpt++:)]
expected: FAIL
[Setting search with leading U+0000 (https:)]
expected: FAIL
[Setting protocol with leading U+0000 (https:)]
expected: FAIL
[Setting host with leading U+001F (https:)]
expected: FAIL
[Setting pathname with leading U+0000 (wpt++:)]
expected: FAIL
[Setting hash with trailing U+0000 (https:)]
expected: FAIL
[Setting hash with middle U+0000 (wpt++:)]
expected: FAIL
[Setting hash with leading U+001F (wpt++:)]
expected: FAIL
[Setting hostname with leading U+001F (https:)]
expected: FAIL
[Setting hash with leading U+0000 (wpt++:)]
expected: FAIL
[Setting hash with leading U+0000 (https:)]
expected: FAIL
[Setting protocol with U+001F before inserted colon (wpt++:)]
expected: FAIL
[Setting hostname with trailing U+001F (https:)]
expected: FAIL
[Setting hostname with trailing U+0000 (https:)]
expected: FAIL
[Setting host with trailing U+001F (https:)]
expected: FAIL
[Setting pathname with trailing U+0000 (https:)]
expected: FAIL
[Setting pathname with leading U+0000 (https:)]
expected: FAIL
[Setting port with leading U+0000 (wpt++:)]
expected: FAIL
[Setting protocol with U+0000 before inserted colon (wpt++:)]
expected: FAIL
[Setting protocol with U+001F before inserted colon (https:)]
expected: FAIL
[Setting pathname with trailing U+0000 (wpt++:)]
expected: FAIL
[Setting hostname with leading U+0000 (https:)]
expected: FAIL
[Setting host with leading U+001F (wpt++:)]
expected: FAIL
[Setting hash with trailing U+0000 (wpt++:)]
expected: FAIL
[Setting protocol with leading U+001F (wpt++:)]
expected: FAIL
[Setting port with leading U+0000 (https:)]
expected: FAIL
[Setting hash with leading U+001F (https:)]
expected: FAIL
[Setting search with trailing U+0000 (https:)]
expected: FAIL
[Setting host with trailing U+0000 (wpt++:)]
expected: FAIL
[Setting search with trailing U+0000 (wpt++:)]
expected: FAIL
[Setting hostname with trailing U+0000 (wpt++:)]
expected: FAIL
[Setting port with leading U+001F (https:)]
expected: FAIL
[Setting hash with middle U+0000 (https:)]
expected: FAIL
[Setting host with leading U+0000 (wpt++:)]
expected: FAIL
[Setting host with trailing U+001F (wpt++:)]
expected: FAIL
[Setting hostname with leading U+001F (wpt++:)]
expected: FAIL
[Setting port with leading U+001F (wpt++:)]
expected: FAIL

View file

@ -110,3 +110,6 @@
[X Rendered audio for channel 5 does not equal [0,0.0626220703125,0.125030517578125,0.18695068359375,0.24810791015625,0.308319091796875,0.3673095703125,0.42486572265625,0.480743408203125,0.53472900390625,0.58660888671875,0.636199951171875,0.68328857421875,0.727691650390625,0.76922607421875,0.8077392578125...\] with an element-wise tolerance of {"absoluteThreshold":0.000030517578125,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[1\]\t3.6732959747314453e-1\t6.2622070312500000e-2\t3.0470752716064453e-1\t4.8658168859649127e+0\t3.0517578125000000e-5\n\t[2\]\t6.8329977989196777e-1\t1.2503051757812500e-1\t5.5826926231384277e-1\t4.4650639949963384e+0\t3.0517578125000000e-5\n\t[3\]\t9.0373212099075317e-1\t1.8695068359375000e-1\t7.1678143739700317e-1\t3.8340669508039502e+0\t3.0517578125000000e-5\n\t[4\]\t9.9780619144439697e-1\t2.4810791015625000e-1\t7.4969828128814697e-1\t3.0216621502152523e+0\t3.0517578125000000e-5\n\t[5\]\t9.5236867666244507e-1\t3.0831909179687500e-1\t6.4404958486557007e-1\t2.0889059484187866e+0\t3.0517578125000000e-5\n\t...and 40524 more errors.\n\tMax AbsError of 1.9999794363975525e+0 at index of 37272.\n\t[37272\]\t9.9997943639755249e-1\t-1.0000000000000000e+0\t1.9999794363975525e+0\t1.9999794363975525e+0\t3.0517578125000000e-5\n\tMax RelError of Infinity at index of 12348.\n\t[12348\]\t9.5105654001235962e-1\t0.0000000000000000e+0\t9.5105654001235962e-1\tInfinity\t3.0517578125000000e-5\n] [X Rendered audio for channel 5 does not equal [0,0.0626220703125,0.125030517578125,0.18695068359375,0.24810791015625,0.308319091796875,0.3673095703125,0.42486572265625,0.480743408203125,0.53472900390625,0.58660888671875,0.636199951171875,0.68328857421875,0.727691650390625,0.76922607421875,0.8077392578125...\] with an element-wise tolerance of {"absoluteThreshold":0.000030517578125,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[1\]\t3.6732959747314453e-1\t6.2622070312500000e-2\t3.0470752716064453e-1\t4.8658168859649127e+0\t3.0517578125000000e-5\n\t[2\]\t6.8329977989196777e-1\t1.2503051757812500e-1\t5.5826926231384277e-1\t4.4650639949963384e+0\t3.0517578125000000e-5\n\t[3\]\t9.0373212099075317e-1\t1.8695068359375000e-1\t7.1678143739700317e-1\t3.8340669508039502e+0\t3.0517578125000000e-5\n\t[4\]\t9.9780619144439697e-1\t2.4810791015625000e-1\t7.4969828128814697e-1\t3.0216621502152523e+0\t3.0517578125000000e-5\n\t[5\]\t9.5236867666244507e-1\t3.0831909179687500e-1\t6.4404958486557007e-1\t2.0889059484187866e+0\t3.0517578125000000e-5\n\t...and 40524 more errors.\n\tMax AbsError of 1.9999794363975525e+0 at index of 37272.\n\t[37272\]\t9.9997943639755249e-1\t-1.0000000000000000e+0\t1.9999794363975525e+0\t1.9999794363975525e+0\t3.0517578125000000e-5\n\tMax RelError of Infinity at index of 12348.\n\t[12348\]\t9.5105654001235962e-1\t0.0000000000000000e+0\t9.5105654001235962e-1\tInfinity\t3.0517578125000000e-5\n]
expected: FAIL expected: FAIL
[X Rendered audio for channel 5 does not equal [0,0.0626220703125,0.125030517578125,0.18695068359375,0.24810791015625,0.308319091796875,0.3673095703125,0.42486572265625,0.480743408203125,0.53472900390625,0.58660888671875,0.636199951171875,0.68328857421875,0.727691650390625,0.76922607421875,0.8077392578125...\] with an element-wise tolerance of {"absoluteThreshold":0.000030517578125,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[1\]\t3.6732959747314453e-1\t6.2622070312500000e-2\t3.0470752716064453e-1\t4.8658168859649127e+0\t3.0517578125000000e-5\n\t[2\]\t6.8329977989196777e-1\t1.2503051757812500e-1\t5.5826926231384277e-1\t4.4650639949963384e+0\t3.0517578125000000e-5\n\t[3\]\t9.0373212099075317e-1\t1.8695068359375000e-1\t7.1678143739700317e-1\t3.8340669508039502e+0\t3.0517578125000000e-5\n\t[4\]\t9.9780619144439697e-1\t2.4810791015625000e-1\t7.4969828128814697e-1\t3.0216621502152523e+0\t3.0517578125000000e-5\n\t[5\]\t9.5236867666244507e-1\t3.0831909179687500e-1\t6.4404958486557007e-1\t2.0889059484187866e+0\t3.0517578125000000e-5\n\t...and 40521 more errors.\n\tMax AbsError of 1.9962286949157715e+0 at index of 40997.\n\t[40997\]\t9.9879217147827148e-1\t-9.9743652343750000e-1\t1.9962286949157715e+0\t2.0013591321441684e+0\t3.0517578125000000e-5\n\tMax RelError of Infinity at index of 12348.\n\t[12348\]\t9.5105654001235962e-1\t0.0000000000000000e+0\t9.5105654001235962e-1\tInfinity\t3.0517578125000000e-5\n]
expected: FAIL

View file

@ -1,5 +0,0 @@
[017.html]
expected: TIMEOUT
[origin of the script that invoked the method, about:blank]
expected: TIMEOUT

View file

@ -0,0 +1,4 @@
[postMessage_block.https.html]
[postMessage and block]
expected: FAIL

View file

@ -0,0 +1,2 @@
[2d.imageData.get.large.crash.html]
expected: CRASH

View file

@ -0,0 +1,4 @@
[2d.video.invalid.html]
[Verify test doesn't crash with invalid video.]
expected: FAIL

View file

@ -7,7 +7,7 @@
expected: FAIL expected: FAIL
[Opening a blob URL in a new window immediately before revoking it works.] [Opening a blob URL in a new window immediately before revoking it works.]
expected: FAIL expected: TIMEOUT
[Opening a blob URL in a noopener about:blank window immediately before revoking it works.] [Opening a blob URL in a noopener about:blank window immediately before revoking it works.]
expected: TIMEOUT expected: TIMEOUT

File diff suppressed because it is too large Load diff

View file

@ -1,4 +0,0 @@
[hit-test-floats-004.html]
[Miss float below something else]
expected: FAIL

View file

@ -8,6 +8,9 @@
[[data-expected-height\] 3] [[data-expected-height\] 3]
expected: FAIL expected: FAIL
[[data-expected-height\] 4] [[data-expected-height\] 1]
expected: FAIL
[[data-expected-height\] 2]
expected: FAIL expected: FAIL

View file

@ -50,3 +50,6 @@
[Order of CSS Animations - free animation vs CSS Transitions] [Order of CSS Animations - free animation vs CSS Transitions]
expected: FAIL expected: FAIL
[pseudo element with replaced target does not affect animation ordering]
expected: FAIL

View file

@ -0,0 +1,2 @@
[background-attachment-margin-root-001.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[background-attachment-margin-root-002.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[svg-image-orientation-none.html]
expected: FAIL

View file

@ -1,2 +1,2 @@
[no-transition-from-ua-to-blocking-stylesheet.html] [no-transition-from-ua-to-blocking-stylesheet.html]
expected: FAIL expected: TIMEOUT

View file

@ -21,3 +21,6 @@
[test the top of layer] [test the top of layer]
expected: FAIL expected: FAIL
[test some point of the element: top left corner]
expected: FAIL

View file

@ -2,6 +2,3 @@
[elementsFromPoint on the root document for points in iframe elements] [elementsFromPoint on the root document for points in iframe elements]
expected: FAIL expected: FAIL
[elementsFromPoint on inner documents]
expected: FAIL

View file

@ -318,12 +318,18 @@
[<iframe>: combined response Content-Type: text/html;" \\" text/plain] [<iframe>: combined response Content-Type: text/html;" \\" text/plain]
expected: FAIL expected: FAIL
[<iframe>: combined response Content-Type: text/html */*;charset=gbk]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;" \\" text/plain] [<iframe>: separate response Content-Type: text/html;" \\" text/plain]
expected: FAIL expected: FAIL
[<iframe>: separate response Content-Type: text/plain */*;charset=gbk] [<iframe>: combined response Content-Type: */* text/html]
expected: FAIL
[<iframe>: separate response Content-Type: text/html */*]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;x=" text/plain]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;x=" text/plain]
expected: FAIL expected: FAIL

View file

@ -59,6 +59,3 @@
[separate text/javascript;charset=windows-1252 error text/javascript] [separate text/javascript;charset=windows-1252 error text/javascript]
expected: FAIL expected: FAIL
[separate text/javascript;charset=windows-1252 text/javascript]
expected: FAIL

View file

@ -11,3 +11,6 @@
[X-Content-Type-Options%3A%20nosniff%2C%2C%40%23%24%23%25%25%26%5E%26%5E*()()11!] [X-Content-Type-Options%3A%20nosniff%2C%2C%40%23%24%23%25%25%26%5E%26%5E*()()11!]
expected: FAIL expected: FAIL
[X-Content-Type-Options%3A%20%22nosniFF%22]
expected: FAIL

View file

@ -1,4 +0,0 @@
[traverse_the_history_1.html]
[Multiple history traversals from the same task]
expected: FAIL

View file

@ -1,4 +1,4 @@
[traverse_the_history_3.html] [traverse_the_history_4.html]
[Multiple history traversals, last would be aborted] [Multiple history traversals, last would be aborted]
expected: FAIL expected: FAIL

View file

@ -0,0 +1,2 @@
[cross-origin-objects-on-new-window.html]
expected: TIMEOUT

View file

@ -4,14 +4,17 @@
expected: FAIL expected: FAIL
[Element with tabindex should support autofocus] [Element with tabindex should support autofocus]
expected: FAIL
[Host element with delegatesFocus including no focusable descendants should be skipped]
expected: FAIL
[Area element should support autofocus]
expected: TIMEOUT expected: TIMEOUT
[Host element with delegatesFocus should support autofocus] [Host element with delegatesFocus including no focusable descendants should be skipped]
expected: FAIL expected: NOTRUN
[Area element should support autofocus]
expected: NOTRUN
[Host element with delegatesFocus should support autofocus]
expected: NOTRUN
[Non-HTMLElement should not support autofocus]
expected: NOTRUN

View file

@ -1,6 +1,6 @@
[iframe_sandbox_popups_nonescaping-2.html] [iframe_sandbox_popups_nonescaping-2.html]
type: testharness type: testharness
expected: TIMEOUT expected: CRASH
[Check that popups from a sandboxed iframe do not escape the sandbox] [Check that popups from a sandboxed iframe do not escape the sandbox]
expected: NOTRUN expected: NOTRUN

View file

@ -1,6 +1,6 @@
[iframe_sandbox_popups_nonescaping-3.html] [iframe_sandbox_popups_nonescaping-3.html]
type: testharness type: testharness
expected: TIMEOUT expected: CRASH
[Check that popups from a sandboxed iframe do not escape the sandbox] [Check that popups from a sandboxed iframe do not escape the sandbox]
expected: NOTRUN expected: NOTRUN

View file

@ -1,2 +0,0 @@
[script-onerror-insertion-point-2.html]
expected: TIMEOUT

View file

@ -4,6 +4,3 @@
[The incumbent settings object while executing the compiled callback via Web IDL's invoke must be that of the node document] [The incumbent settings object while executing the compiled callback via Web IDL's invoke must be that of the node document]
expected: TIMEOUT expected: TIMEOUT
[The entry settings object while executing the compiled callback via Web IDL's invoke must be that of the node document]
expected: TIMEOUT

View file

@ -0,0 +1,327 @@
[url-setters-stripping.any.html]
[Setting pathname with leading U+001F (https:)]
expected: FAIL
[Setting protocol with U+0000 before inserted colon (https:)]
expected: FAIL
[Setting pathname with leading U+001F (wpt++:)]
expected: FAIL
[Setting hostname with leading U+0000 (wpt++:)]
expected: FAIL
[Setting search with trailing U+001F (https:)]
expected: FAIL
[Setting search with leading U+0000 (wpt++:)]
expected: FAIL
[Setting hostname with trailing U+001F (wpt++:)]
expected: FAIL
[Setting search with leading U+001F (wpt++:)]
expected: FAIL
[Setting search with leading U+001F (https:)]
expected: FAIL
[Setting hash with trailing U+001F (wpt++:)]
expected: FAIL
[Setting protocol with leading U+0000 (wpt++:)]
expected: FAIL
[Setting host with trailing U+0000 (https:)]
expected: FAIL
[Setting host with leading U+0000 (https:)]
expected: FAIL
[Setting pathname with trailing U+001F (https:)]
expected: FAIL
[Setting protocol with leading U+001F (https:)]
expected: FAIL
[Setting pathname with trailing U+001F (wpt++:)]
expected: FAIL
[Setting hash with trailing U+001F (https:)]
expected: FAIL
[Setting search with trailing U+001F (wpt++:)]
expected: FAIL
[Setting search with leading U+0000 (https:)]
expected: FAIL
[Setting protocol with leading U+0000 (https:)]
expected: FAIL
[Setting host with leading U+001F (https:)]
expected: FAIL
[Setting pathname with leading U+0000 (wpt++:)]
expected: FAIL
[Setting hash with trailing U+0000 (https:)]
expected: FAIL
[Setting hash with middle U+0000 (wpt++:)]
expected: FAIL
[Setting hash with leading U+001F (wpt++:)]
expected: FAIL
[Setting hostname with leading U+001F (https:)]
expected: FAIL
[Setting hash with leading U+0000 (wpt++:)]
expected: FAIL
[Setting hash with leading U+0000 (https:)]
expected: FAIL
[Setting protocol with U+001F before inserted colon (wpt++:)]
expected: FAIL
[Setting hostname with trailing U+001F (https:)]
expected: FAIL
[Setting hostname with trailing U+0000 (https:)]
expected: FAIL
[Setting host with trailing U+001F (https:)]
expected: FAIL
[Setting pathname with trailing U+0000 (https:)]
expected: FAIL
[Setting pathname with leading U+0000 (https:)]
expected: FAIL
[Setting port with leading U+0000 (wpt++:)]
expected: FAIL
[Setting protocol with U+0000 before inserted colon (wpt++:)]
expected: FAIL
[Setting protocol with U+001F before inserted colon (https:)]
expected: FAIL
[Setting pathname with trailing U+0000 (wpt++:)]
expected: FAIL
[Setting hostname with leading U+0000 (https:)]
expected: FAIL
[Setting host with leading U+001F (wpt++:)]
expected: FAIL
[Setting hash with trailing U+0000 (wpt++:)]
expected: FAIL
[Setting protocol with leading U+001F (wpt++:)]
expected: FAIL
[Setting port with leading U+0000 (https:)]
expected: FAIL
[Setting hash with leading U+001F (https:)]
expected: FAIL
[Setting search with trailing U+0000 (https:)]
expected: FAIL
[Setting host with trailing U+0000 (wpt++:)]
expected: FAIL
[Setting search with trailing U+0000 (wpt++:)]
expected: FAIL
[Setting hostname with trailing U+0000 (wpt++:)]
expected: FAIL
[Setting port with leading U+001F (https:)]
expected: FAIL
[Setting hash with middle U+0000 (https:)]
expected: FAIL
[Setting host with leading U+0000 (wpt++:)]
expected: FAIL
[Setting host with trailing U+001F (wpt++:)]
expected: FAIL
[Setting hostname with leading U+001F (wpt++:)]
expected: FAIL
[Setting port with leading U+001F (wpt++:)]
expected: FAIL
[url-setters-stripping.any.worker.html]
[Setting pathname with leading U+001F (https:)]
expected: FAIL
[Setting protocol with U+0000 before inserted colon (https:)]
expected: FAIL
[Setting pathname with leading U+001F (wpt++:)]
expected: FAIL
[Setting hostname with leading U+0000 (wpt++:)]
expected: FAIL
[Setting search with trailing U+001F (https:)]
expected: FAIL
[Setting search with leading U+0000 (wpt++:)]
expected: FAIL
[Setting hostname with trailing U+001F (wpt++:)]
expected: FAIL
[Setting search with leading U+001F (wpt++:)]
expected: FAIL
[Setting search with leading U+001F (https:)]
expected: FAIL
[Setting hash with trailing U+001F (wpt++:)]
expected: FAIL
[Setting protocol with leading U+0000 (wpt++:)]
expected: FAIL
[Setting host with trailing U+0000 (https:)]
expected: FAIL
[Setting host with leading U+0000 (https:)]
expected: FAIL
[Setting pathname with trailing U+001F (https:)]
expected: FAIL
[Setting protocol with leading U+001F (https:)]
expected: FAIL
[Setting pathname with trailing U+001F (wpt++:)]
expected: FAIL
[Setting hash with trailing U+001F (https:)]
expected: FAIL
[Setting search with trailing U+001F (wpt++:)]
expected: FAIL
[Setting search with leading U+0000 (https:)]
expected: FAIL
[Setting protocol with leading U+0000 (https:)]
expected: FAIL
[Setting host with leading U+001F (https:)]
expected: FAIL
[Setting pathname with leading U+0000 (wpt++:)]
expected: FAIL
[Setting hash with trailing U+0000 (https:)]
expected: FAIL
[Setting hash with middle U+0000 (wpt++:)]
expected: FAIL
[Setting hash with leading U+001F (wpt++:)]
expected: FAIL
[Setting hostname with leading U+001F (https:)]
expected: FAIL
[Setting hash with leading U+0000 (wpt++:)]
expected: FAIL
[Setting hash with leading U+0000 (https:)]
expected: FAIL
[Setting protocol with U+001F before inserted colon (wpt++:)]
expected: FAIL
[Setting hostname with trailing U+001F (https:)]
expected: FAIL
[Setting hostname with trailing U+0000 (https:)]
expected: FAIL
[Setting host with trailing U+001F (https:)]
expected: FAIL
[Setting pathname with trailing U+0000 (https:)]
expected: FAIL
[Setting pathname with leading U+0000 (https:)]
expected: FAIL
[Setting port with leading U+0000 (wpt++:)]
expected: FAIL
[Setting protocol with U+0000 before inserted colon (wpt++:)]
expected: FAIL
[Setting protocol with U+001F before inserted colon (https:)]
expected: FAIL
[Setting pathname with trailing U+0000 (wpt++:)]
expected: FAIL
[Setting hostname with leading U+0000 (https:)]
expected: FAIL
[Setting host with leading U+001F (wpt++:)]
expected: FAIL
[Setting hash with trailing U+0000 (wpt++:)]
expected: FAIL
[Setting protocol with leading U+001F (wpt++:)]
expected: FAIL
[Setting port with leading U+0000 (https:)]
expected: FAIL
[Setting hash with leading U+001F (https:)]
expected: FAIL
[Setting search with trailing U+0000 (https:)]
expected: FAIL
[Setting host with trailing U+0000 (wpt++:)]
expected: FAIL
[Setting search with trailing U+0000 (wpt++:)]
expected: FAIL
[Setting hostname with trailing U+0000 (wpt++:)]
expected: FAIL
[Setting port with leading U+001F (https:)]
expected: FAIL
[Setting hash with middle U+0000 (https:)]
expected: FAIL
[Setting host with leading U+0000 (wpt++:)]
expected: FAIL
[Setting host with trailing U+001F (wpt++:)]
expected: FAIL
[Setting hostname with leading U+001F (wpt++:)]
expected: FAIL
[Setting port with leading U+001F (wpt++:)]
expected: FAIL

View file

@ -179,3 +179,6 @@
[X Rendered audio for channel 5 does not equal [0,0.0626220703125,0.125030517578125,0.18695068359375,0.24810791015625,0.308319091796875,0.3673095703125,0.42486572265625,0.480743408203125,0.53472900390625,0.58660888671875,0.636199951171875,0.68328857421875,0.727691650390625,0.76922607421875,0.8077392578125...\] with an element-wise tolerance of {"absoluteThreshold":0.000030517578125,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[1\]\t3.6732959747314453e-1\t6.2622070312500000e-2\t3.0470752716064453e-1\t4.8658168859649127e+0\t3.0517578125000000e-5\n\t[2\]\t6.8329977989196777e-1\t1.2503051757812500e-1\t5.5826926231384277e-1\t4.4650639949963384e+0\t3.0517578125000000e-5\n\t[3\]\t9.0373212099075317e-1\t1.8695068359375000e-1\t7.1678143739700317e-1\t3.8340669508039502e+0\t3.0517578125000000e-5\n\t[4\]\t9.9780619144439697e-1\t2.4810791015625000e-1\t7.4969828128814697e-1\t3.0216621502152523e+0\t3.0517578125000000e-5\n\t[5\]\t9.5236867666244507e-1\t3.0831909179687500e-1\t6.4404958486557007e-1\t2.0889059484187866e+0\t3.0517578125000000e-5\n\t...and 40524 more errors.\n\tMax AbsError of 1.9999794363975525e+0 at index of 37272.\n\t[37272\]\t9.9997943639755249e-1\t-1.0000000000000000e+0\t1.9999794363975525e+0\t1.9999794363975525e+0\t3.0517578125000000e-5\n\tMax RelError of Infinity at index of 12348.\n\t[12348\]\t9.5105654001235962e-1\t0.0000000000000000e+0\t9.5105654001235962e-1\tInfinity\t3.0517578125000000e-5\n] [X Rendered audio for channel 5 does not equal [0,0.0626220703125,0.125030517578125,0.18695068359375,0.24810791015625,0.308319091796875,0.3673095703125,0.42486572265625,0.480743408203125,0.53472900390625,0.58660888671875,0.636199951171875,0.68328857421875,0.727691650390625,0.76922607421875,0.8077392578125...\] with an element-wise tolerance of {"absoluteThreshold":0.000030517578125,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[1\]\t3.6732959747314453e-1\t6.2622070312500000e-2\t3.0470752716064453e-1\t4.8658168859649127e+0\t3.0517578125000000e-5\n\t[2\]\t6.8329977989196777e-1\t1.2503051757812500e-1\t5.5826926231384277e-1\t4.4650639949963384e+0\t3.0517578125000000e-5\n\t[3\]\t9.0373212099075317e-1\t1.8695068359375000e-1\t7.1678143739700317e-1\t3.8340669508039502e+0\t3.0517578125000000e-5\n\t[4\]\t9.9780619144439697e-1\t2.4810791015625000e-1\t7.4969828128814697e-1\t3.0216621502152523e+0\t3.0517578125000000e-5\n\t[5\]\t9.5236867666244507e-1\t3.0831909179687500e-1\t6.4404958486557007e-1\t2.0889059484187866e+0\t3.0517578125000000e-5\n\t...and 40524 more errors.\n\tMax AbsError of 1.9999794363975525e+0 at index of 37272.\n\t[37272\]\t9.9997943639755249e-1\t-1.0000000000000000e+0\t1.9999794363975525e+0\t1.9999794363975525e+0\t3.0517578125000000e-5\n\tMax RelError of Infinity at index of 12348.\n\t[12348\]\t9.5105654001235962e-1\t0.0000000000000000e+0\t9.5105654001235962e-1\tInfinity\t3.0517578125000000e-5\n]
expected: FAIL expected: FAIL
[X Rendered audio for channel 5 does not equal [0,0.0626220703125,0.125030517578125,0.18695068359375,0.24810791015625,0.308319091796875,0.3673095703125,0.42486572265625,0.480743408203125,0.53472900390625,0.58660888671875,0.636199951171875,0.68328857421875,0.727691650390625,0.76922607421875,0.8077392578125...\] with an element-wise tolerance of {"absoluteThreshold":0.000030517578125,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[1\]\t3.6732959747314453e-1\t6.2622070312500000e-2\t3.0470752716064453e-1\t4.8658168859649127e+0\t3.0517578125000000e-5\n\t[2\]\t6.8329977989196777e-1\t1.2503051757812500e-1\t5.5826926231384277e-1\t4.4650639949963384e+0\t3.0517578125000000e-5\n\t[3\]\t9.0373212099075317e-1\t1.8695068359375000e-1\t7.1678143739700317e-1\t3.8340669508039502e+0\t3.0517578125000000e-5\n\t[4\]\t9.9780619144439697e-1\t2.4810791015625000e-1\t7.4969828128814697e-1\t3.0216621502152523e+0\t3.0517578125000000e-5\n\t[5\]\t9.5236867666244507e-1\t3.0831909179687500e-1\t6.4404958486557007e-1\t2.0889059484187866e+0\t3.0517578125000000e-5\n\t...and 40521 more errors.\n\tMax AbsError of 1.9962286949157715e+0 at index of 40997.\n\t[40997\]\t9.9879217147827148e-1\t-9.9743652343750000e-1\t1.9962286949157715e+0\t2.0013591321441684e+0\t3.0517578125000000e-5\n\tMax RelError of Infinity at index of 12348.\n\t[12348\]\t9.5105654001235962e-1\t0.0000000000000000e+0\t9.5105654001235962e-1\tInfinity\t3.0517578125000000e-5\n]
expected: FAIL

View file

@ -1,5 +0,0 @@
[017.html]
expected: TIMEOUT
[origin of the script that invoked the method, about:blank]
expected: TIMEOUT

View file

@ -0,0 +1,4 @@
[postMessage_block.https.html]
[postMessage and block]
expected: FAIL

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before After
Before After

View file

@ -0,0 +1,37 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by /2dcontext/tools/gentest.py. -->
<title>Canvas test: 2d.line.invalid.strokestyle</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/2dcontext/resources/canvas-tests.js"></script>
<link rel="stylesheet" href="/2dcontext/resources/canvas-tests.css">
<body class="show_output">
<h1>2d.line.invalid.strokestyle</h1>
<p class="desc">Verify correct behavior of canvas on an invalid strokeStyle()</p>
<p class="output">Actual output:</p>
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<ul id="d"></ul>
<script>
var t = async_test("Verify correct behavior of canvas on an invalid strokeStyle()");
_addTest(function(canvas, ctx) {
ctx.strokeStyle = 'rgb(0, 255, 0)';
ctx.strokeStyle = 'nonsense';
ctx.lineWidth = 200;
ctx.moveTo(0,100);
ctx.lineTo(200,100);
ctx.stroke();
var imageData = ctx.getImageData(0, 0, 200, 200);
var imgdata = imageData.data;
_assert(imgdata[4] == 0, "imgdata[\""+(4)+"\"] == 0");
_assert(imgdata[5] == 255, "imgdata[\""+(5)+"\"] == 255");
_assert(imgdata[6] == 0, "imgdata[\""+(6)+"\"] == 0");
});
</script>

View file

@ -42,6 +42,18 @@ ctx.miterLimit = 1.5;
ctx.miterLimit = NaN; ctx.miterLimit = NaN;
_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5"); _assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5");
ctx.miterLimit = 1.5;
ctx.miterLimit = 'string';
_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5");
ctx.miterLimit = 1.5;
ctx.miterLimit = true;
_assertSame(ctx.miterLimit, 1, "ctx.miterLimit", "1");
ctx.miterLimit = 1.5;
ctx.miterLimit = false;
_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5");
}); });
</script> </script>

View file

@ -42,6 +42,18 @@ ctx.lineWidth = 1.5;
ctx.lineWidth = NaN; ctx.lineWidth = NaN;
_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5"); _assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5");
ctx.lineWidth = 1.5;
ctx.lineWidth = 'string';
_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5");
ctx.lineWidth = 1.5;
ctx.lineWidth = true;
_assertSame(ctx.lineWidth, 1, "ctx.lineWidth", "1");
ctx.lineWidth = 1.5;
ctx.lineWidth = false;
_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5");
}); });
</script> </script>

View file

@ -0,0 +1,27 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by /2dcontext/tools/gentest.py. -->
<title>Canvas test: 2d.imageData.get.large.crash</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/2dcontext/resources/canvas-tests.js"></script>
<link rel="stylesheet" href="/2dcontext/resources/canvas-tests.css">
<body class="show_output">
<h1>2d.imageData.get.large.crash</h1>
<p class="desc">Test that canvas crash when image data cannot be allocated.</p>
<p class="output">Actual output:</p>
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<ul id="d"></ul>
<script>
var t = async_test("Test that canvas crash when image data cannot be allocated.");
_addTest(function(canvas, ctx) {
assert_throws_js(TypeError, function() { ctx.getImageData(10, 0xffffffff, 2147483647, 10); });
});
</script>

View file

@ -0,0 +1,45 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by /2dcontext/tools/gentest.py. -->
<title>Canvas test: 2d.imageData.get.rounding</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/2dcontext/resources/canvas-tests.js"></script>
<link rel="stylesheet" href="/2dcontext/resources/canvas-tests.css">
<body class="show_output">
<h1>2d.imageData.get.rounding</h1>
<p class="desc">Test the handling of non-integer source coordinates in getImageData().</p>
<p class="output">Actual output:</p>
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<ul id="d"></ul>
<script>
var t = async_test("Test the handling of non-integer source coordinates in getImageData().");
_addTest(function(canvas, ctx) {
function testDimensions(sx, sy, sw, sh, width, height)
{
imageData = ctx.getImageData(sx, sy, sw, sh);
_assert(imageData.width == width, "imageData.width == width");
_assert(imageData.height == height, "imageData.height == height");
}
testDimensions(0, 0, 20, 10, 20, 10);
testDimensions(.1, .2, 20, 10, 20, 10);
testDimensions(.9, .8, 20, 10, 20, 10);
testDimensions(0, 0, 20.9, 10.9, 20, 10);
testDimensions(0, 0, 20.1, 10.1, 20, 10);
testDimensions(-1, -1, 20, 10, 20, 10);
testDimensions(-1.1, 0, 20, 10, 20, 10);
testDimensions(-1.9, 0, 20, 10, 20, 10);
});
</script>

View file

@ -35,6 +35,18 @@ ctx.shadowBlur = 1;
ctx.shadowBlur = NaN; ctx.shadowBlur = NaN;
_assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1"); _assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1");
ctx.shadowBlur = 1;
ctx.shadowBlur = 'string';
_assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1");
ctx.shadowBlur = 1;
ctx.shadowBlur = true;
_assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1");
ctx.shadowBlur = 1;
ctx.shadowBlur = false;
_assertSame(ctx.shadowBlur, 0, "ctx.shadowBlur", "0");
}); });
</script> </script>

View file

@ -40,6 +40,27 @@ ctx.shadowOffsetY = NaN;
_assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1"); _assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1");
_assertSame(ctx.shadowOffsetY, 2, "ctx.shadowOffsetY", "2"); _assertSame(ctx.shadowOffsetY, 2, "ctx.shadowOffsetY", "2");
ctx.shadowOffsetX = 1;
ctx.shadowOffsetY = 2;
ctx.shadowOffsetX = 'string';
ctx.shadowOffsetY = 'string';
_assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1");
_assertSame(ctx.shadowOffsetY, 2, "ctx.shadowOffsetY", "2");
ctx.shadowOffsetX = 1;
ctx.shadowOffsetY = 2;
ctx.shadowOffsetX = true;
ctx.shadowOffsetY = true;
_assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1");
_assertSame(ctx.shadowOffsetY, 1, "ctx.shadowOffsetY", "1");
ctx.shadowOffsetX = 1;
ctx.shadowOffsetY = 2;
ctx.shadowOffsetX = false;
ctx.shadowOffsetY = false;
_assertSame(ctx.shadowOffsetX, 0, "ctx.shadowOffsetX", "0");
_assertSame(ctx.shadowOffsetY, 0, "ctx.shadowOffsetY", "0");
}); });
</script> </script>

View file

@ -32,6 +32,7 @@
2d.text.draw.space.collapse.start: "text-styles" 2d.text.draw.space.collapse.start: "text-styles"
2d.state: "the-canvas-state" 2d.state: "the-canvas-state"
2d.scrollPathIntoView: "scroll" 2d.scrollPathIntoView: "scroll"
2d.video: "video"
2d.canvas: "../html/semantics/embedded-content/the-canvas-element" 2d.canvas: "../html/semantics/embedded-content/the-canvas-element"
2d.getcontext: "../html/semantics/embedded-content/the-canvas-element" 2d.getcontext: "../html/semantics/embedded-content/the-canvas-element"
2d.scaled: "../html/semantics/embedded-content/the-canvas-element" 2d.scaled: "../html/semantics/embedded-content/the-canvas-element"

View file

@ -3762,6 +3762,18 @@
ctx.lineWidth = NaN; ctx.lineWidth = NaN;
@assert ctx.lineWidth === 1.5; @assert ctx.lineWidth === 1.5;
ctx.lineWidth = 1.5;
ctx.lineWidth = 'string';
@assert ctx.lineWidth === 1.5;
ctx.lineWidth = 1.5;
ctx.lineWidth = true;
@assert ctx.lineWidth === 1;
ctx.lineWidth = 1.5;
ctx.lineWidth = false;
@assert ctx.lineWidth === 1.5;
- name: 2d.line.cap.butt - name: 2d.line.cap.butt
desc: lineCap 'butt' is rendered correctly desc: lineCap 'butt' is rendered correctly
testing: testing:
@ -4512,6 +4524,18 @@
ctx.miterLimit = NaN; ctx.miterLimit = NaN;
@assert ctx.miterLimit === 1.5; @assert ctx.miterLimit === 1.5;
ctx.miterLimit = 1.5;
ctx.miterLimit = 'string';
@assert ctx.miterLimit === 1.5;
ctx.miterLimit = 1.5;
ctx.miterLimit = true;
@assert ctx.miterLimit === 1;
ctx.miterLimit = 1.5;
ctx.miterLimit = false;
@assert ctx.miterLimit === 1.5;
- name: 2d.line.cross - name: 2d.line.cross
code: | code: |
ctx.fillStyle = '#0f0'; ctx.fillStyle = '#0f0';
@ -4607,6 +4631,18 @@
ctx.shadowBlur = NaN; ctx.shadowBlur = NaN;
@assert ctx.shadowBlur === 1; @assert ctx.shadowBlur === 1;
ctx.shadowBlur = 1;
ctx.shadowBlur = 'string';
@assert ctx.shadowBlur === 1;
ctx.shadowBlur = 1;
ctx.shadowBlur = true;
@assert ctx.shadowBlur === 1;
ctx.shadowBlur = 1;
ctx.shadowBlur = false;
@assert ctx.shadowBlur === 0;
- name: 2d.shadow.attributes.shadowOffset.initial - name: 2d.shadow.attributes.shadowOffset.initial
testing: testing:
- 2d.shadow.offset.initial - 2d.shadow.offset.initial
@ -4669,6 +4705,27 @@
@assert ctx.shadowOffsetX === 1; @assert ctx.shadowOffsetX === 1;
@assert ctx.shadowOffsetY === 2; @assert ctx.shadowOffsetY === 2;
ctx.shadowOffsetX = 1;
ctx.shadowOffsetY = 2;
ctx.shadowOffsetX = 'string';
ctx.shadowOffsetY = 'string';
@assert ctx.shadowOffsetX === 1;
@assert ctx.shadowOffsetY === 2;
ctx.shadowOffsetX = 1;
ctx.shadowOffsetY = 2;
ctx.shadowOffsetX = true;
ctx.shadowOffsetY = true;
@assert ctx.shadowOffsetX === 1;
@assert ctx.shadowOffsetY === 1;
ctx.shadowOffsetX = 1;
ctx.shadowOffsetY = 2;
ctx.shadowOffsetX = false;
ctx.shadowOffsetY = false;
@assert ctx.shadowOffsetX === 0;
@assert ctx.shadowOffsetY === 0;
- name: 2d.shadow.attributes.shadowColor.initial - name: 2d.shadow.attributes.shadowColor.initial
testing: testing:
- 2d.shadow.color.initial - 2d.shadow.color.initial
@ -9732,6 +9789,38 @@
expected: green expected: green
- name: 2d.imageData.get.large.crash
desc: Test that canvas crash when image data cannot be allocated.
testing:
- 2d.getImageData
code: |
@assert throws TypeError ctx.getImageData(10, 0xffffffff, 2147483647, 10);
- name: 2d.imageData.get.rounding
desc: Test the handling of non-integer source coordinates in getImageData().
testing:
- 2d.getImageData
code: |
function testDimensions(sx, sy, sw, sh, width, height)
{
imageData = ctx.getImageData(sx, sy, sw, sh);
@assert imageData.width == width;
@assert imageData.height == height;
}
testDimensions(0, 0, 20, 10, 20, 10);
testDimensions(.1, .2, 20, 10, 20, 10);
testDimensions(.9, .8, 20, 10, 20, 10);
testDimensions(0, 0, 20.9, 10.9, 20, 10);
testDimensions(0, 0, 20.1, 10.1, 20, 10);
testDimensions(-1, -1, 20, 10, 20, 10);
testDimensions(-1.1, 0, 20, 10, 20, 10);
testDimensions(-1.9, 0, 20, 10, 20, 10);
- name: 2d.imageData.object.properties - name: 2d.imageData.object.properties
desc: ImageData objects have the right properties desc: ImageData objects have the right properties
testing: testing:
@ -10365,4 +10454,30 @@
ctx.filter = 'blur( 5px)'; ctx.filter = 'blur( 5px)';
assert_equals(ctx.filter, 'blur( 5px)'); assert_equals(ctx.filter, 'blur( 5px)');
- name: 2d.line.invalid.strokestyle
desc: Verify correct behavior of canvas on an invalid strokeStyle()
testing:
- 2d.strokestyle.invalid
code: |
ctx.strokeStyle = 'rgb(0, 255, 0)';
ctx.strokeStyle = 'nonsense';
ctx.lineWidth = 200;
ctx.moveTo(0,100);
ctx.lineTo(200,100);
ctx.stroke();
var imageData = ctx.getImageData(0, 0, 200, 200);
var imgdata = imageData.data;
@assert imgdata[4] == 0;
@assert imgdata[5] == 255;
@assert imgdata[6] == 0;
- name: 2d.video.invalid
desc: Verify test doesn't crash with invalid video.
testing:
- 2d.video.invalid
code: |
var v = document.createElement('video');
v.play();
// Test is deliberately not waiting for the 'playing' event to fire.
ctx.createPattern(v, 'repeat-x');
ctx.drawImage(v, 0, 0);

View file

@ -0,0 +1,31 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by /2dcontext/tools/gentest.py. -->
<title>Canvas test: 2d.video.invalid</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/2dcontext/resources/canvas-tests.js"></script>
<link rel="stylesheet" href="/2dcontext/resources/canvas-tests.css">
<body class="show_output">
<h1>2d.video.invalid</h1>
<p class="desc">Verify test doesn't crash with invalid video.</p>
<p class="output">Actual output:</p>
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<ul id="d"></ul>
<script>
var t = async_test("Verify test doesn't crash with invalid video.");
_addTest(function(canvas, ctx) {
var v = document.createElement('video');
v.play();
// Test is deliberately not waiting for the 'playing' event to fire.
ctx.createPattern(v, 'repeat-x');
ctx.drawImage(v, 0, 0);
});
</script>

View file

@ -195,20 +195,21 @@ function simulateGATTDisconnectionAndWait(device, fake_peripheral) {
* @returns {Promise<Array<FakePeripheral>>} The fake devices are initialized as * @returns {Promise<Array<FakePeripheral>>} The fake devices are initialized as
* Health Thermometer and Heart Rate devices. * Health Thermometer and Heart Rate devices.
*/ */
function setUpHealthThermometerAndHeartRateDevices() { async function setUpHealthThermometerAndHeartRateDevices() {
return navigator.bluetooth.test.simulateCentral({state: 'powered-on'}) let fake_central =
.then(fake_central => Promise.all([ await navigator.bluetooth.test.simulateCentral({state: 'powered-on'});
fake_central.simulatePreconnectedPeripheral({ return Promise.all([
address: '09:09:09:09:09:09', fake_central.simulatePreconnectedPeripheral({
name: 'Health Thermometer', address: '09:09:09:09:09:09',
knownServiceUUIDs: ['generic_access', 'health_thermometer'], name: 'Health Thermometer',
}), knownServiceUUIDs: ['generic_access', 'health_thermometer'],
fake_central.simulatePreconnectedPeripheral({ }),
address: '08:08:08:08:08:08', fake_central.simulatePreconnectedPeripheral({
name: 'Heart Rate', address: '08:08:08:08:08:08',
knownServiceUUIDs: ['generic_access', 'heart_rate'], name: 'Heart Rate',
}) knownServiceUUIDs: ['generic_access', 'heart_rate'],
])); })
]);
} }
/** /**
@ -221,17 +222,18 @@ function setUpHealthThermometerAndHeartRateDevices() {
* @returns {Promise<FakePeripheral>} The fake devices are initialized with the * @returns {Promise<FakePeripheral>} The fake devices are initialized with the
* parameter values. * parameter values.
*/ */
function setUpPreconnectedDevice({ async function setUpPreconnectedDevice({
address = '00:00:00:00:00:00', address = '00:00:00:00:00:00',
name = 'LE Device', name = 'LE Device',
knownServiceUUIDs = [] knownServiceUUIDs = []
}) { }) {
return navigator.bluetooth.test.simulateCentral({state: 'powered-on'}) let fake_central =
.then(fake_central => fake_central.simulatePreconnectedPeripheral({ await navigator.bluetooth.test.simulateCentral({state: 'powered-on'})
address: address, return fake_central.simulatePreconnectedPeripheral({
name: name, address: address,
knownServiceUUIDs: knownServiceUUIDs, name: name,
})); knownServiceUUIDs: knownServiceUUIDs,
});
} }
/** Blocklisted GATT Device Helper Methods */ /** Blocklisted GATT Device Helper Methods */
@ -266,65 +268,52 @@ function setUpPreconnectedDevice({
* object containing the BluetoothDevice object and its corresponding * object containing the BluetoothDevice object and its corresponding
* GATT fake objects. * GATT fake objects.
*/ */
function getBlocklistDevice(options = { async function getBlocklistDevice(options = {
filters: [{services: [blocklist_test_service_uuid]}] filters: [{services: [blocklist_test_service_uuid]}]
}) { }) {
let device, fake_peripheral, fake_blocklist_test_service, let fake_peripheral = await setUpPreconnectedDevice({
fake_blocklist_exclude_reads_characteristic, address: '11:11:11:11:11:11',
fake_blocklist_exclude_writes_characteristic, fake_blocklist_descriptor, name: 'Blocklist Device',
fake_blocklist_exclude_reads_descriptor, knownServiceUUIDs: ['generic_access', blocklist_test_service_uuid],
fake_blocklist_exclude_writes_descriptor; })
return setUpPreconnectedDevice({ let device = await requestDeviceWithTrustedClick(options);
address: '11:11:11:11:11:11', await fake_peripheral.setNextGATTConnectionResponse({
name: 'Blocklist Device', code: HCI_SUCCESS,
knownServiceUUIDs: ['generic_access', blocklist_test_service_uuid], });
}) await device.gatt.connect();
.then(_ => fake_peripheral = _) let fake_blocklist_test_service = await fake_peripheral.addFakeService({
.then(() => requestDeviceWithTrustedClick(options)) uuid: blocklist_test_service_uuid,
.then(_ => device = _) });
.then(() => fake_peripheral.setNextGATTConnectionResponse({ let fake_blocklist_exclude_reads_characteristic =
code: HCI_SUCCESS, await fake_blocklist_test_service.addFakeCharacteristic({
}))
.then(() => device.gatt.connect())
.then(() => fake_peripheral.addFakeService({
uuid: blocklist_test_service_uuid,
}))
.then(_ => fake_blocklist_test_service = _)
.then(() => fake_blocklist_test_service.addFakeCharacteristic({
uuid: blocklist_exclude_reads_characteristic_uuid, uuid: blocklist_exclude_reads_characteristic_uuid,
properties: ['read', 'write'], properties: ['read', 'write'],
})) });
.then(_ => fake_blocklist_exclude_reads_characteristic = _) let fake_blocklist_exclude_writes_characteristic =
.then(() => fake_blocklist_test_service.addFakeCharacteristic({ await fake_blocklist_test_service.addFakeCharacteristic({
uuid: 'gap.peripheral_privacy_flag', uuid: 'gap.peripheral_privacy_flag',
properties: ['read', 'write'], properties: ['read', 'write'],
})) });
.then(_ => fake_blocklist_exclude_writes_characteristic = _) let fake_blocklist_descriptor =
.then( await fake_blocklist_exclude_writes_characteristic.addFakeDescriptor(
() => fake_blocklist_exclude_writes_characteristic.addFakeDescriptor( {uuid: blocklist_test_descriptor_uuid});
{uuid: blocklist_test_descriptor_uuid})) let fake_blocklist_exclude_reads_descriptor =
.then(_ => fake_blocklist_descriptor = _) await fake_blocklist_exclude_writes_characteristic.addFakeDescriptor(
.then( {uuid: blocklist_exclude_reads_descriptor_uuid});
() => fake_blocklist_exclude_writes_characteristic.addFakeDescriptor( let fake_blocklist_exclude_writes_descriptor =
{uuid: blocklist_exclude_reads_descriptor_uuid})) await fake_blocklist_exclude_writes_characteristic.addFakeDescriptor(
.then(_ => fake_blocklist_exclude_reads_descriptor = _) {uuid: 'gatt.client_characteristic_configuration'});
.then( await fake_peripheral.setNextGATTDiscoveryResponse({code: HCI_SUCCESS});
() => fake_blocklist_exclude_writes_characteristic.addFakeDescriptor( return {
{uuid: 'gatt.client_characteristic_configuration'})) device,
.then(_ => fake_blocklist_exclude_writes_descriptor = _) fake_peripheral,
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({ fake_blocklist_test_service,
code: HCI_SUCCESS, fake_blocklist_exclude_reads_characteristic,
})) fake_blocklist_exclude_writes_characteristic,
.then(() => ({ fake_blocklist_descriptor,
device, fake_blocklist_exclude_reads_descriptor,
fake_peripheral, fake_blocklist_exclude_writes_descriptor,
fake_blocklist_test_service, };
fake_blocklist_exclude_reads_characteristic,
fake_blocklist_exclude_writes_characteristic,
fake_blocklist_descriptor,
fake_blocklist_exclude_reads_descriptor,
fake_blocklist_exclude_writes_descriptor,
}));
} }
/** /**
@ -343,17 +332,14 @@ function getBlocklistDevice(options = {
* fake_service: FakeBluetoothRemoteGATTService}>} An object containing the * fake_service: FakeBluetoothRemoteGATTService}>} An object containing the
* BluetoothDevice object and its corresponding GATT fake objects. * BluetoothDevice object and its corresponding GATT fake objects.
*/ */
function getBlocklistTestService() { async function getBlocklistTestService() {
let result; let result = await getBlocklistDevice();
return getBlocklistDevice() let service =
.then(_ => result = _) await result.device.gatt.getPrimaryService(blocklist_test_service_uuid);
.then( return Object.assign(result, {
() => service,
result.device.gatt.getPrimaryService(blocklist_test_service_uuid)) fake_service: result.fake_blocklist_test_service,
.then(service => Object.assign(result, { });
service,
fake_service: result.fake_blocklist_test_service,
}));
} }
/** /**
@ -375,17 +361,14 @@ function getBlocklistTestService() {
* containing the BluetoothDevice object and its corresponding GATT fake * containing the BluetoothDevice object and its corresponding GATT fake
* objects. * objects.
*/ */
function getBlocklistExcludeReadsCharacteristic() { async function getBlocklistExcludeReadsCharacteristic() {
let result, fake_characteristic; let result = await getBlocklistTestService();
return getBlocklistTestService() let characteristic = await result.service.getCharacteristic(
.then(_ => result = _) blocklist_exclude_reads_characteristic_uuid);
.then( return Object.assign(result, {
() => result.service.getCharacteristic( characteristic,
blocklist_exclude_reads_characteristic_uuid)) fake_characteristic: result.fake_blocklist_exclude_reads_characteristic
.then(characteristic => Object.assign(result, { });
characteristic,
fake_characteristic: result.fake_blocklist_exclude_reads_characteristic
}));
} }
/** /**
@ -407,16 +390,14 @@ function getBlocklistExcludeReadsCharacteristic() {
* containing the BluetoothDevice object and its corresponding GATT fake * containing the BluetoothDevice object and its corresponding GATT fake
* objects. * objects.
*/ */
function getBlocklistExcludeWritesCharacteristic() { async function getBlocklistExcludeWritesCharacteristic() {
let result, fake_characteristic; let result = await getBlocklistTestService();
return getBlocklistTestService() let characteristic =
.then(_ => result = _) await result.service.getCharacteristic('gap.peripheral_privacy_flag');
.then( return Object.assign(result, {
() => result.service.getCharacteristic('gap.peripheral_privacy_flag')) characteristic,
.then(characteristic => Object.assign(result, { fake_characteristic: result.fake_blocklist_exclude_writes_characteristic
characteristic, });
fake_characteristic: result.fake_blocklist_exclude_writes_characteristic
}));
} }
/** /**
@ -440,17 +421,14 @@ function getBlocklistExcludeWritesCharacteristic() {
* containing the BluetoothDevice object and its corresponding GATT fake * containing the BluetoothDevice object and its corresponding GATT fake
* objects. * objects.
*/ */
function getBlocklistExcludeReadsDescriptor() { async function getBlocklistExcludeReadsDescriptor() {
let result; let result = await getBlocklistExcludeWritesCharacteristic();
return getBlocklistExcludeWritesCharacteristic() let descriptor = await result.characteristic.getDescriptor(
.then(_ => result = _) blocklist_exclude_reads_descriptor_uuid);
.then( return Object.assign(result, {
() => result.characteristic.getDescriptor( descriptor,
blocklist_exclude_reads_descriptor_uuid)) fake_descriptor: result.fake_blocklist_exclude_reads_descriptor
.then(descriptor => Object.assign(result, { });
descriptor,
fake_descriptor: result.fake_blocklist_exclude_reads_descriptor
}));
} }
/** /**
@ -474,17 +452,14 @@ function getBlocklistExcludeReadsDescriptor() {
* containing the BluetoothDevice object and its corresponding GATT fake * containing the BluetoothDevice object and its corresponding GATT fake
* objects. * objects.
*/ */
function getBlocklistExcludeWritesDescriptor() { async function getBlocklistExcludeWritesDescriptor() {
let result; let result = await getBlocklistExcludeWritesCharacteristic();
return getBlocklistExcludeWritesCharacteristic() let descriptor = await result.characteristic.getDescriptor(
.then(_ => result = _) 'gatt.client_characteristic_configuration');
.then( return Object.assign(result, {
() => result.characteristic.getDescriptor( descriptor: descriptor,
'gatt.client_characteristic_configuration')) fake_descriptor: result.fake_blocklist_exclude_writes_descriptor,
.then(descriptor => Object.assign(result, { });
descriptor: descriptor,
fake_descriptor: result.fake_blocklist_exclude_writes_descriptor,
}));
} }
/** Bluetooth HID Device Helper Methods */ /** Bluetooth HID Device Helper Methods */
@ -498,40 +473,37 @@ function getBlocklistExcludeWritesDescriptor() {
* @returns {device: BluetoothDevice, fake_peripheral: FakePeripheral} An object * @returns {device: BluetoothDevice, fake_peripheral: FakePeripheral} An object
* containing a requested BluetoothDevice and its fake counter part. * containing a requested BluetoothDevice and its fake counter part.
*/ */
function getConnectedHIDDevice(options) { async function getConnectedHIDDevice(options) {
let device, fake_peripheral; let fake_peripheral = await setUpPreconnectedDevice({
return setUpPreconnectedDevice({ address: '10:10:10:10:10:10',
address: '10:10:10:10:10:10', name: 'HID Device',
name: 'HID Device', knownServiceUUIDs: [
knownServiceUUIDs: [ 'generic_access',
'generic_access', 'device_information',
'device_information', 'human_interface_device',
'human_interface_device', ],
], });
}) let device = await requestDeviceWithTrustedClick(options);
.then(_ => (fake_peripheral = _)) await fake_peripheral.setNextGATTConnectionResponse({
.then(() => requestDeviceWithTrustedClick(options)) code: HCI_SUCCESS,
.then(_ => (device = _)) });
.then(() => fake_peripheral.setNextGATTConnectionResponse({ await device.gatt.connect();
code: HCI_SUCCESS, await fake_peripheral.addFakeService({
})) uuid: 'generic_access',
.then(() => device.gatt.connect()) });
.then(() => fake_peripheral.addFakeService({ let dev_info = await fake_peripheral.addFakeService({
uuid: 'generic_access', uuid: 'device_information',
})) });
.then(() => fake_peripheral.addFakeService({ // Blocklisted Characteristic:
uuid: 'device_information', // https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt
})) await dev_info.addFakeCharacteristic({
// Blocklisted Characteristic: uuid: 'serial_number_string',
// https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt properties: ['read'],
.then(dev_info => dev_info.addFakeCharacteristic({ });
uuid: 'serial_number_string', await fake_peripheral.addFakeService({
properties: ['read'], uuid: 'human_interface_device',
})) });
.then(() => fake_peripheral.addFakeService({ return {device, fake_peripheral};
uuid: 'human_interface_device',
}))
.then(() => ({device, fake_peripheral}));
} }
/** /**
@ -547,14 +519,12 @@ function getConnectedHIDDevice(options) {
* @returns {device: BluetoothDevice, fake_peripheral: FakePeripheral} An object * @returns {device: BluetoothDevice, fake_peripheral: FakePeripheral} An object
* containing a requested BluetoothDevice and its fake counter part. * containing a requested BluetoothDevice and its fake counter part.
*/ */
function getHIDDevice(options) { async function getHIDDevice(options) {
let device, fake_peripheral; let result = await getConnectedHIDDevice(options);
return getConnectedHIDDevice(options) await result.fake_peripheral.setNextGATTDiscoveryResponse({
.then(_ => ({device, fake_peripheral} = _)) code: HCI_SUCCESS,
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({ });
code: HCI_SUCCESS, return result;
}))
.then(() => ({device, fake_peripheral}));
} }
/** Health Thermometer Bluetooth Device Helper Methods */ /** Health Thermometer Bluetooth Device Helper Methods */
@ -563,7 +533,7 @@ function getHIDDevice(options) {
* Returns a FakePeripheral that corresponds to a simulated pre-connected device * Returns a FakePeripheral that corresponds to a simulated pre-connected device
* called 'Health Thermometer'. The device has two known serviceUUIDs: * called 'Health Thermometer'. The device has two known serviceUUIDs:
* 'generic_access' and 'health_thermometer'. * 'generic_access' and 'health_thermometer'.
* @returns {FakePeripheral} The device fake initialized as a Health * @returns {Promise<FakePeripheral>} The device fake initialized as a Health
* Thermometer device. * Thermometer device.
*/ */
function setUpHealthThermometerDevice() { function setUpHealthThermometerDevice() {
@ -580,14 +550,12 @@ function setUpHealthThermometerDevice() {
* @returns {Promise<FakePeripheral>} The device fake initialized as a * @returns {Promise<FakePeripheral>} The device fake initialized as a
* connectable Health Thermometer device. * connectable Health Thermometer device.
*/ */
function setUpConnectableHealthThermometerDevice() { async function setUpConnectableHealthThermometerDevice() {
let fake_peripheral; let fake_peripheral = await setUpHealthThermometerDevice();
return setUpHealthThermometerDevice() await fake_peripheral.setNextGATTConnectionResponse({
.then(_ => fake_peripheral = _) code: HCI_SUCCESS,
.then(() => fake_peripheral.setNextGATTConnectionResponse({ });
code: HCI_SUCCESS, return fake_peripheral;
}))
.then(() => fake_peripheral);
} }
/** /**
@ -607,49 +575,44 @@ function setUpConnectableHealthThermometerDevice() {
* passed into this method along with the fake GATT services, characteristics, * passed into this method along with the fake GATT services, characteristics,
* and descriptors added to it. * and descriptors added to it.
*/ */
function populateHealthThermometerFakes(fake_peripheral) { async function populateHealthThermometerFakes(fake_peripheral) {
let fake_generic_access, fake_health_thermometer, fake_measurement_interval, let fake_generic_access =
fake_user_description, fake_cccd, fake_temperature_measurement, await fake_peripheral.addFakeService({uuid: 'generic_access'});
fake_temperature_type; let fake_health_thermometer = await fake_peripheral.addFakeService({
return fake_peripheral.addFakeService({uuid: 'generic_access'}) uuid: 'health_thermometer',
.then(_ => fake_generic_access = _) });
.then(() => fake_peripheral.addFakeService({ let fake_measurement_interval =
uuid: 'health_thermometer', await fake_health_thermometer.addFakeCharacteristic({
}))
.then(_ => fake_health_thermometer = _)
.then(() => fake_health_thermometer.addFakeCharacteristic({
uuid: 'measurement_interval', uuid: 'measurement_interval',
properties: ['read', 'write', 'indicate'], properties: ['read', 'write', 'indicate'],
})) });
.then(_ => fake_measurement_interval = _) let fake_user_description =
.then(() => fake_measurement_interval.addFakeDescriptor({ await fake_measurement_interval.addFakeDescriptor({
uuid: 'gatt.characteristic_user_description', uuid: 'gatt.characteristic_user_description',
})) });
.then(_ => fake_user_description = _) let fake_cccd = await fake_measurement_interval.addFakeDescriptor({
.then(() => fake_measurement_interval.addFakeDescriptor({ uuid: 'gatt.client_characteristic_configuration',
uuid: 'gatt.client_characteristic_configuration', });
})) let fake_temperature_measurement =
.then(_ => fake_cccd = _) await fake_health_thermometer.addFakeCharacteristic({
.then(() => fake_health_thermometer.addFakeCharacteristic({
uuid: 'temperature_measurement', uuid: 'temperature_measurement',
properties: ['indicate'], properties: ['indicate'],
})) });
.then(_ => fake_temperature_measurement = _) let fake_temperature_type =
.then(() => fake_health_thermometer.addFakeCharacteristic({ await fake_health_thermometer.addFakeCharacteristic({
uuid: 'temperature_type', uuid: 'temperature_type',
properties: ['read'], properties: ['read'],
})) });
.then(_ => fake_temperature_type = _) return {
.then(() => ({ fake_peripheral,
fake_peripheral, fake_generic_access,
fake_generic_access, fake_health_thermometer,
fake_health_thermometer, fake_measurement_interval,
fake_measurement_interval, fake_cccd,
fake_cccd, fake_user_description,
fake_user_description, fake_temperature_measurement,
fake_temperature_measurement, fake_temperature_type,
fake_temperature_type, };
}));
} }
/** /**
@ -670,50 +633,45 @@ function populateHealthThermometerFakes(fake_peripheral) {
* containing a requested BluetoothDevice and all of the GATT fake * containing a requested BluetoothDevice and all of the GATT fake
* objects. * objects.
*/ */
function getHealthThermometerDeviceWithServicesDiscovered(options) { async function getHealthThermometerDeviceWithServicesDiscovered(options) {
let device, fake_peripheral, fakes;
let iframe = document.createElement('iframe'); let iframe = document.createElement('iframe');
return setUpConnectableHealthThermometerDevice() let fake_peripheral = await setUpConnectableHealthThermometerDevice();
.then(_ => fake_peripheral = _) let fakes = populateHealthThermometerFakes(fake_peripheral);
.then(() => populateHealthThermometerFakes(fake_peripheral)) await fake_peripheral.setNextGATTDiscoveryResponse({
.then(_ => fakes = _) code: HCI_SUCCESS,
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({ });
code: HCI_SUCCESS, await new Promise(resolve => {
})) let src = '/bluetooth/resources/health-thermometer-iframe.html';
.then( // TODO(509038): Can be removed once LayoutTests/bluetooth/* that
() => new Promise(resolve => { // use health-thermometer-iframe.html have been moved to
let src = '/bluetooth/resources/health-thermometer-iframe.html'; // LayoutTests/external/wpt/bluetooth/*
// TODO(509038): Can be removed once LayoutTests/bluetooth/* that if (window.location.pathname.includes('/LayoutTests/')) {
// use health-thermometer-iframe.html have been moved to src =
// LayoutTests/external/wpt/bluetooth/* '../../../external/wpt/bluetooth/resources/health-thermometer-iframe.html';
if (window.location.pathname.includes('/LayoutTests/')) { }
src = iframe.src = src;
'../../../external/wpt/bluetooth/resources/health-thermometer-iframe.html'; document.body.appendChild(iframe);
} iframe.addEventListener('load', resolve);
iframe.src = src; });
document.body.appendChild(iframe); await new Promise((resolve, reject) => {
iframe.addEventListener('load', resolve); callWithTrustedClick(() => {
})) iframe.contentWindow.postMessage(
.then(() => new Promise((resolve, reject) => { {type: 'DiscoverServices', options: options}, '*');
callWithTrustedClick(() => { });
iframe.contentWindow.postMessage(
{type: 'DiscoverServices', options: options}, '*');
});
function messageHandler(messageEvent) { function messageHandler(messageEvent) {
if (messageEvent.data == 'DiscoveryComplete') { if (messageEvent.data == 'DiscoveryComplete') {
window.removeEventListener('message', messageHandler); window.removeEventListener('message', messageHandler);
resolve(); resolve();
} else { } else {
reject(new Error(`Unexpected message: ${messageEvent.data}`)); reject(new Error(`Unexpected message: ${messageEvent.data}`));
} }
} }
window.addEventListener('message', messageHandler); window.addEventListener('message', messageHandler);
})) });
.then(() => requestDeviceWithTrustedClick(options)) let device = await requestDeviceWithTrustedClick(options);
.then(_ => device = _) await device.gatt.connect();
.then(device => device.gatt.connect()) return Object.assign({device}, fakes);
.then(_ => Object.assign({device}, fakes));
} }
/** /**
@ -725,13 +683,12 @@ function getHealthThermometerDeviceWithServicesDiscovered(options) {
* @returns {device: BluetoothDevice, fake_peripheral: FakePeripheral} An object * @returns {device: BluetoothDevice, fake_peripheral: FakePeripheral} An object
* containing a requested BluetoothDevice and its fake counter part. * containing a requested BluetoothDevice and its fake counter part.
*/ */
function getDiscoveredHealthThermometerDevice(options = { async function getDiscoveredHealthThermometerDevice(options = {
filters: [{services: ['health_thermometer']}] filters: [{services: ['health_thermometer']}]
}) { }) {
return setUpHealthThermometerDevice().then(fake_peripheral => { let fake_peripheral = await setUpHealthThermometerDevice();
return requestDeviceWithTrustedClick(options).then( let device = await requestDeviceWithTrustedClick(options);
device => ({device: device, fake_peripheral: fake_peripheral})); return {device: device, fake_peripheral: fake_peripheral};
});
} }
/** /**
@ -742,17 +699,14 @@ function getDiscoveredHealthThermometerDevice(options = {
* @returns {device: BluetoothDevice, fake_peripheral: FakePeripheral} An object * @returns {device: BluetoothDevice, fake_peripheral: FakePeripheral} An object
* containing a requested BluetoothDevice and its fake counter part. * containing a requested BluetoothDevice and its fake counter part.
*/ */
function getEmptyHealthThermometerDevice(options) { async function getEmptyHealthThermometerDevice(options) {
return getDiscoveredHealthThermometerDevice(options).then( let result = await getDiscoveredHealthThermometerDevice(options);
({device, fake_peripheral}) => { await result.fake_peripheral.setNextGATTConnectionResponse(
return fake_peripheral {code: HCI_SUCCESS});
.setNextGATTConnectionResponse({code: HCI_SUCCESS}) await result.device.gatt.connect();
.then(() => device.gatt.connect()) await result.fake_peripheral.setNextGATTDiscoveryResponse(
.then( {code: HCI_SUCCESS});
() => fake_peripheral.setNextGATTDiscoveryResponse( return result;
{code: HCI_SUCCESS}))
.then(() => ({device: device, fake_peripheral: fake_peripheral}));
});
} }
/** /**
@ -764,26 +718,21 @@ function getEmptyHealthThermometerDevice(options) {
* fake_health_thermometer: FakeRemoteGATTService} An object containing the * fake_health_thermometer: FakeRemoteGATTService} An object containing the
* health themometer service object and its corresponding fake. * health themometer service object and its corresponding fake.
*/ */
function getEmptyHealthThermometerService(options) { async function getEmptyHealthThermometerService(options) {
let device; let result = await getDiscoveredHealthThermometerDevice(options);
let fake_peripheral; await result.fake_peripheral.setNextGATTConnectionResponse(
let fake_health_thermometer; {code: HCI_SUCCESS});
return getDiscoveredHealthThermometerDevice(options) await result.device.gatt.connect();
.then(result => ({device, fake_peripheral} = result)) let fake_health_thermometer =
.then( await result.fake_peripheral.addFakeService({uuid: 'health_thermometer'});
() => fake_peripheral.setNextGATTConnectionResponse( await result.fake_peripheral.setNextGATTDiscoveryResponse(
{code: HCI_SUCCESS})) {code: HCI_SUCCESS});
.then(() => device.gatt.connect()) let service =
.then(() => fake_peripheral.addFakeService({uuid: 'health_thermometer'})) await result.device.gatt.getPrimaryService('health_thermometer');
.then(s => fake_health_thermometer = s) return {
.then( service: service,
() => fake_health_thermometer: fake_health_thermometer,
fake_peripheral.setNextGATTDiscoveryResponse({code: HCI_SUCCESS})) };
.then(() => device.gatt.getPrimaryService('health_thermometer'))
.then(service => ({
service: service,
fake_health_thermometer: fake_health_thermometer,
}));
} }
/** /**
@ -803,17 +752,14 @@ function getEmptyHealthThermometerService(options) {
* containing a requested BluetoothDevice and all of the GATT fake * containing a requested BluetoothDevice and all of the GATT fake
* objects. * objects.
*/ */
function getConnectedHealthThermometerDevice(options) { async function getConnectedHealthThermometerDevice(options) {
let device, fake_peripheral, fakes; let result = await getDiscoveredHealthThermometerDevice(options);
return getDiscoveredHealthThermometerDevice(options) await result.fake_peripheral.setNextGATTConnectionResponse({
.then(_ => ({device, fake_peripheral} = _)) code: HCI_SUCCESS,
.then(() => fake_peripheral.setNextGATTConnectionResponse({ });
code: HCI_SUCCESS, let fakes = await populateHealthThermometerFakes(result.fake_peripheral);
})) await result.device.gatt.connect();
.then(() => populateHealthThermometerFakes(fake_peripheral)) return Object.assign({device: result.device}, fakes);
.then(_ => fakes = _)
.then(() => device.gatt.connect())
.then(() => Object.assign({device}, fakes));
} }
/** /**
@ -845,14 +791,12 @@ function getConnectedHealthThermometerDevice(options) {
* containing a requested BluetoothDevice and all of the GATT fake * containing a requested BluetoothDevice and all of the GATT fake
* objects. * objects.
*/ */
function getHealthThermometerDevice(options) { async function getHealthThermometerDevice(options) {
let result; let result = await getConnectedHealthThermometerDevice(options);
return getConnectedHealthThermometerDevice(options) await result.fake_peripheral.setNextGATTDiscoveryResponse({
.then(_ => result = _) code: HCI_SUCCESS,
.then(() => result.fake_peripheral.setNextGATTDiscoveryResponse({ });
code: HCI_SUCCESS, return result;
}))
.then(() => result);
} }
/** /**
@ -866,34 +810,19 @@ function getHealthThermometerDevice(options) {
* object containing a requested Bluetooth device and two fake health * object containing a requested Bluetooth device and two fake health
* thermometer GATT services. * thermometer GATT services.
*/ */
function getTwoHealthThermometerServicesDevice(options) { async function getTwoHealthThermometerServicesDevice(options) {
let device; let result = await getConnectedHealthThermometerDevice(options);
let fake_peripheral; let fake_health_thermometer2 =
let fake_generic_access; await result.fake_peripheral.addFakeService({uuid: 'health_thermometer'});
let fake_health_thermometer1; await result.fake_peripheral.setNextGATTDiscoveryResponse(
let fake_health_thermometer2; {code: HCI_SUCCESS});
return {
return getConnectedHealthThermometerDevice(options) device: result.device,
.then(result => { fake_peripheral: result.fake_peripheral,
({ fake_generic_access: result.fake_generic_access,
device, fake_health_thermometer1: result.fake_health_thermometer,
fake_peripheral, fake_health_thermometer2: fake_health_thermometer2
fake_generic_access, };
fake_health_thermometer: fake_health_thermometer1,
} = result);
})
.then(() => fake_peripheral.addFakeService({uuid: 'health_thermometer'}))
.then(s => fake_health_thermometer2 = s)
.then(
() =>
fake_peripheral.setNextGATTDiscoveryResponse({code: HCI_SUCCESS}))
.then(() => ({
device: device,
fake_peripheral: fake_peripheral,
fake_generic_access: fake_generic_access,
fake_health_thermometer1: fake_health_thermometer1,
fake_health_thermometer2: fake_health_thermometer2
}));
} }
/** /**
@ -913,15 +842,14 @@ function getTwoHealthThermometerServicesDevice(options) {
* containing a requested BluetoothDevice and all of the GATT fake * containing a requested BluetoothDevice and all of the GATT fake
* objects. * objects.
*/ */
function getHealthThermometerService() { async function getHealthThermometerService() {
let result; let result = await getHealthThermometerDevice();
return getHealthThermometerDevice() let service =
.then(r => result = r) await result.device.gatt.getPrimaryService('health_thermometer');
.then(() => result.device.gatt.getPrimaryService('health_thermometer')) return Object.assign(result, {
.then(service => Object.assign(result, { service,
service, fake_service: result.fake_health_thermometer,
fake_service: result.fake_health_thermometer, });
}));
} }
/** /**
@ -944,15 +872,14 @@ function getHealthThermometerService() {
* containing a requested BluetoothDevice and all of the GATT fake * containing a requested BluetoothDevice and all of the GATT fake
* objects. * objects.
*/ */
function getMeasurementIntervalCharacteristic() { async function getMeasurementIntervalCharacteristic() {
let result; let result = await getHealthThermometerService();
return getHealthThermometerService() let characteristic =
.then(r => result = r) await result.service.getCharacteristic('measurement_interval');
.then(() => result.service.getCharacteristic('measurement_interval')) return Object.assign(result, {
.then(characteristic => Object.assign(result, { characteristic,
characteristic, fake_characteristic: result.fake_measurement_interval,
fake_characteristic: result.fake_measurement_interval, });
}));
} }
/** /**
@ -977,15 +904,12 @@ function getMeasurementIntervalCharacteristic() {
* containing a requested BluetoothDevice and all of the GATT fake * containing a requested BluetoothDevice and all of the GATT fake
* objects. * objects.
*/ */
function getUserDescriptionDescriptor() { async function getUserDescriptionDescriptor() {
let result; let result = await getMeasurementIntervalCharacteristic();
return getMeasurementIntervalCharacteristic() let descriptor = await result.characteristic.getDescriptor(
.then(r => result = r) 'gatt.characteristic_user_description');
.then( return Object.assign(result, {
() => result.characteristic.getDescriptor( descriptor,
'gatt.characteristic_user_description')) fake_descriptor: result.fake_user_description,
.then(descriptor => Object.assign(result, { });
descriptor,
fake_descriptor: result.fake_user_description,
}));
} }

View file

@ -24,12 +24,11 @@ function loadScript(path) {
* @returns {Promise<void>} A promise chain that resolves when all scripts have * @returns {Promise<void>} A promise chain that resolves when all scripts have
* finished loading. * finished loading.
*/ */
function loadScripts(paths) { async function loadScripts(paths) {
let chain = Promise.resolve();
for (let path of paths) { for (let path of paths) {
chain = chain.then(() => loadScript(path)); await loadScript(path);
} }
return chain; return;
} }
/** /**
@ -42,7 +41,7 @@ function loadScripts(paths) {
* Bluetooth Blink Web Tests have been migrated into this repository. * Bluetooth Blink Web Tests have been migrated into this repository.
* @returns {Promise<void>} Resolves when Chromium specific setup is complete. * @returns {Promise<void>} Resolves when Chromium specific setup is complete.
*/ */
function performChromiumSetup() { async function performChromiumSetup() {
// Make sure we are actually on Chromium with Mojo enabled. // Make sure we are actually on Chromium with Mojo enabled.
if (typeof Mojo === 'undefined') { if (typeof Mojo === 'undefined') {
return; return;
@ -65,27 +64,26 @@ function performChromiumSetup() {
'/js-test-resources/bluetooth/bluetooth-fake-adapter.js', '/js-test-resources/bluetooth/bluetooth-fake-adapter.js',
]; ];
} }
return loadScripts([ await loadScripts([
`${genPrefix}/layout_test_data/mojo/public/js/mojo_bindings.js`, `${genPrefix}/layout_test_data/mojo/public/js/mojo_bindings.js`,
`${genPrefix}/content/test/data/mojo_web_test_helper_test.mojom.js`, `${genPrefix}/content/test/data/mojo_web_test_helper_test.mojom.js`,
`${genPrefix}/device/bluetooth/public/mojom/uuid.mojom.js`, `${genPrefix}/device/bluetooth/public/mojom/uuid.mojom.js`,
`${genPrefix}/url/mojom/origin.mojom.js`, `${genPrefix}/url/mojom/origin.mojom.js`,
`${genPrefix}/device/bluetooth/public/mojom/test/fake_bluetooth.mojom.js`, `${genPrefix}/device/bluetooth/public/mojom/test/fake_bluetooth.mojom.js`,
`${genPrefix}/content/shell/common/web_test/fake_bluetooth_chooser.mojom.js`, `${genPrefix}/content/shell/common/web_test/fake_bluetooth_chooser.mojom.js`,
`${prefix}/web-bluetooth-test.js`, `${prefix}/web-bluetooth-test.js`,
].concat(extra)) ].concat(extra));
// Call setBluetoothFakeAdapter() to clean up any fake adapters left over
// by legacy tests. // Call setBluetoothFakeAdapter() to clean up any fake adapters left over by
// Legacy tests that use setBluetoothFakeAdapter() sometimes fail to clean // legacy tests. Legacy tests that use setBluetoothFakeAdapter() sometimes
// their fake adapter. This is not a problem for these tests because the // fail to clean their fake adapter. This is not a problem for these tests
// next setBluetoothFakeAdapter() will clean it up anyway but it is a // because the next setBluetoothFakeAdapter() will clean it up anyway but it
// problem for the new tests that do not use setBluetoothFakeAdapter(). // is a problem for the new tests that do not use setBluetoothFakeAdapter().
// TODO(https://crbug.com/569709): Remove once setBluetoothFakeAdapter is // TODO(https://crbug.com/569709): Remove once setBluetoothFakeAdapter is no
// no longer used. // longer used.
.then( if (typeof setBluetoothFakeAdapter !== 'undefined') {
() => typeof setBluetoothFakeAdapter === 'undefined' ? setBluetoothFakeAdapter('');
undefined : }
setBluetoothFakeAdapter(''));
} }
/** /**
@ -99,16 +97,13 @@ function performChromiumSetup() {
* rejects if the test failed. * rejects if the test failed.
*/ */
function bluetooth_test(test_function, name, properties) { function bluetooth_test(test_function, name, properties) {
Promise.resolve().then( return promise_test(async (t) => {
() => promise_test( // Trigger Chromium-specific setup.
t => Promise await performChromiumSetup();
.resolve() await test_function(t);
// Trigger Chromium-specific setup. let consumed = await navigator.bluetooth.test.allResponsesConsumed();
.then(performChromiumSetup) assert_true(consumed);
.then(() => test_function(t)) }, name, properties);
.then(() => navigator.bluetooth.test.allResponsesConsumed())
.then(consumed => assert_true(consumed)),
name, properties));
} }
/** /**
@ -138,22 +133,21 @@ function waitForDocumentReady() {
* @returns {Promise<*>} Resolves when the user activation has been simulated * @returns {Promise<*>} Resolves when the user activation has been simulated
* with the result of |callback|. * with the result of |callback|.
*/ */
function callWithTrustedClick(callback) { async function callWithTrustedClick(callback) {
return waitForDocumentReady().then(() => new Promise(resolve => { await waitForDocumentReady();
let button = return new Promise(resolve => {
document.createElement('button'); let button = document.createElement('button');
button.textContent = button.textContent = 'click to continue test';
'click to continue test'; button.style.display = 'block';
button.style.display = 'block'; button.style.fontSize = '20px';
button.style.fontSize = '20px'; button.style.padding = '10px';
button.style.padding = '10px'; button.onclick = () => {
button.onclick = () => { document.body.removeChild(button);
document.body.removeChild(button); resolve(callback());
resolve(callback()); };
}; document.body.appendChild(button);
document.body.appendChild(button); test_driver.click(button);
test_driver.click(button); });
}));
} }
/** /**
@ -356,7 +350,7 @@ function assert_promise_resolves_after_event(
* @returns {Promise<void>} Resolves if no events were fired. * @returns {Promise<void>} Resolves if no events were fired.
*/ */
function assert_no_events(object, event_name) { function assert_no_events(object, event_name) {
return new Promise((resolve, reject) => { return new Promise((resolve) => {
let event_listener = (e) => { let event_listener = (e) => {
object.removeEventListener(event_name, event_listener); object.removeEventListener(event_name, event_listener);
assert_unreached('Object should not fire an event.'); assert_unreached('Object should not fire an event.');

View file

@ -9,8 +9,8 @@
{ {
iframe.name = "theiframe"; iframe.name = "theiframe";
iframe.src = iframe.src =
"http://www1.{{host}}/content-security-policy/support/frame.html#0"; "http://www1.{{host}}:{{ports[http][0]}}/content-security-policy/frame-src/support/frame.html?0";
let iframeLoaded = new Promise(resolve => { iframe.onload = resolve; }); let iframeLoaded = new Promise(resolve => { iframe.onload = resolve });
document.body.appendChild(iframe); document.body.appendChild(iframe);
await iframeLoaded; await iframeLoaded;
} }
@ -26,10 +26,10 @@
// 3. Blocked same-document navigation using iframe.src. // 3. Blocked same-document navigation using iframe.src.
{ {
let violation = new Promise(resolve => { let violation = new Promise(resolve => {
window.addEventListener('securitypolicyviolation', resolve); window.addEventListener('securitypolicyviolation', () => resolve());
}); });
iframe.src = iframe.src =
"http://www1.{{host}}/content-security-policy/support/frame.html#1"; "http://www1.{{host}}:{{ports[http][0]}}/content-security-policy/frame-src/support/frame.html?1";
await violation; await violation;
} }
@ -39,7 +39,7 @@
window.addEventListener('securitypolicyviolation', resolve); window.addEventListener('securitypolicyviolation', resolve);
}); });
window.open( window.open(
"http://www1.{{host}}/content-security-policy/support/frame.html#2", "http://www1.{{host}}:{{ports[http][0]}}/content-security-policy/frame-src/support/frame.html?2",
"theiframe"); "theiframe");
await violation; await violation;
} }

View file

@ -4,7 +4,7 @@
<body></body> <body></body>
<script> <script>
let crossOriginUrl = let crossOriginUrl =
"http://www1.{{host}}/content-security-policy/support/frame.html"; "http://www1.{{host}}:{{ports[http][0]}}/content-security-policy/support/frame.html";
async_test(async test => { async_test(async test => {
test.done(); test.done();

View file

@ -1,5 +1,5 @@
// META: title=Cookie Store API: cookieListItem attributes // META: title=Cookie Store API: cookieListItem attributes
// META: global=!default,serviceworker,window // META: global=window,serviceworker
'use strict'; 'use strict';

View file

@ -1,5 +1,5 @@
// META: title=Cookie Store API: ServiceWorker without cookie change subscriptions // META: title=Cookie Store API: ServiceWorker without cookie change subscriptions
// META: global=!default,serviceworker,window // META: global=window,serviceworker
// META: script=/service-workers/service-worker/resources/test-helpers.sub.js // META: script=/service-workers/service-worker/resources/test-helpers.sub.js
'use strict'; 'use strict';

View file

@ -1,5 +1,5 @@
// META: title=Cookie Store API: ServiceWorker with multiple cookie change subscriptions // META: title=Cookie Store API: ServiceWorker with multiple cookie change subscriptions
// META: global=!default,serviceworker,window // META: global=window,serviceworker
// META: script=/service-workers/service-worker/resources/test-helpers.sub.js // META: script=/service-workers/service-worker/resources/test-helpers.sub.js
'use strict'; 'use strict';

View file

@ -1,5 +1,5 @@
// META: title=Cookie Store API: ServiceWorker with one cookie change subscription // META: title=Cookie Store API: ServiceWorker with one cookie change subscription
// META: global=!default,serviceworker,window // META: global=window,serviceworker
// META: script=/service-workers/service-worker/resources/test-helpers.sub.js // META: script=/service-workers/service-worker/resources/test-helpers.sub.js
'use strict'; 'use strict';

View file

@ -1,5 +1,5 @@
// META: title=Cookie Store API: cookieStore.delete() arguments // META: title=Cookie Store API: cookieStore.delete() arguments
// META: global=!default,serviceworker,window // META: global=window,serviceworker
'use strict'; 'use strict';

View file

@ -1,5 +1,5 @@
// META: title=Cookie Store API: cookieStore.delete() return type // META: title=Cookie Store API: cookieStore.delete() return type
// META: global=!default,serviceworker,window // META: global=window,serviceworker
'use strict'; 'use strict';

View file

@ -1,5 +1,5 @@
// META: title=Cookie Store API: cookieStore.delete() with insecure cookies // META: title=Cookie Store API: cookieStore.delete() with insecure cookies
// META: global=!default,serviceworker,window // META: global=window,serviceworker
'use strict'; 'use strict';

View file

@ -1,5 +1,5 @@
// META: title=Cookie Store API: cookieStore.getAll() arguments // META: title=Cookie Store API: cookieStore.getAll() arguments
// META: global=!default,serviceworker,window // META: global=window,serviceworker
'use strict'; 'use strict';

View file

@ -1,5 +1,5 @@
// META: title=Cookie Store API: cookieStore.getAll() with multiple cookies // META: title=Cookie Store API: cookieStore.getAll() with multiple cookies
// META: global=!default,serviceworker,window // META: global=window,serviceworker
'use strict'; 'use strict';

View file

@ -1,5 +1,5 @@
// META: title=Cookie Store API: Interaction between cookieStore.set() and cookieStore.getAll() // META: title=Cookie Store API: Interaction between cookieStore.set() and cookieStore.getAll()
// META: global=!default,serviceworker,window // META: global=window,serviceworker
'use strict'; 'use strict';

View file

@ -1,5 +1,5 @@
// META: title=Cookie Store API: cookieStore.get() arguments // META: title=Cookie Store API: cookieStore.get() arguments
// META: global=!default,serviceworker,window // META: global=window,serviceworker
'use strict'; 'use strict';

View file

@ -1,5 +1,5 @@
// META: title=Cookie Store API: Interaction between cookieStore.set() and cookieStore.delete() // META: title=Cookie Store API: Interaction between cookieStore.set() and cookieStore.delete()
// META: global=!default,serviceworker,window // META: global=window,serviceworker
'use strict'; 'use strict';

View file

@ -1,5 +1,5 @@
// META: title=Cookie Store API: Interaction between cookieStore.set() and cookieStore.get() // META: title=Cookie Store API: Interaction between cookieStore.set() and cookieStore.get()
// META: global=!default,serviceworker,window // META: global=window,serviceworker
'use strict'; 'use strict';

View file

@ -1,5 +1,5 @@
// META: title=Cookie Store API: Cookie ordering // META: title=Cookie Store API: Cookie ordering
// META: global=!default,serviceworker,window // META: global=window,serviceworker
'use strict'; 'use strict';

View file

@ -1,5 +1,5 @@
// META: title=Cookie Store API: cookieStore.set() arguments // META: title=Cookie Store API: cookieStore.set() arguments
// META: global=!default,serviceworker,window // META: global=window,serviceworker
'use strict'; 'use strict';

View file

@ -1,5 +1,5 @@
// META: title=Cookie Store API: cookieStore.set()/get()/delete() for cookies with special names // META: title=Cookie Store API: cookieStore.set()/get()/delete() for cookies with special names
// META: global=!default,serviceworker,window // META: global=window,serviceworker
'use strict'; 'use strict';

View file

@ -1,5 +1,5 @@
// META: title=Cookie Store API: cookieStore.subscribe() arguments // META: title=Cookie Store API: cookieStore.subscribe() arguments
// META: global=!default,serviceworker,window // META: global=window,serviceworker
// META: script=/service-workers/service-worker/resources/test-helpers.sub.js // META: script=/service-workers/service-worker/resources/test-helpers.sub.js
'use strict'; 'use strict';

View file

@ -1,5 +1,5 @@
// META: title=Cookie Store API: cookie encoding // META: title=Cookie Store API: cookie encoding
// META: global=!default,serviceworker,window // META: global=window,serviceworker
// META: script=resources/cookie-test-helpers.js // META: script=resources/cookie-test-helpers.js
'use strict'; 'use strict';

View file

@ -1,4 +1,4 @@
// META: global=!default,serviceworker,window // META: global=window,serviceworker
// META: timeout=long // META: timeout=long
// META: script=/resources/WebIDLParser.js // META: script=/resources/WebIDLParser.js
// META: script=/resources/idlharness.js // META: script=/resources/idlharness.js

View file

@ -1,5 +1,5 @@
// META: title=Cookie Store API: cookiechange event in ServiceWorker with mismatched subscription // META: title=Cookie Store API: cookiechange event in ServiceWorker with mismatched subscription
// META: global=!default,serviceworker // META: global=serviceworker
'use strict'; 'use strict';

View file

@ -1,5 +1,5 @@
// META: title=Cookie Store API: cookiechange event in ServiceWorker with multiple subscriptions // META: title=Cookie Store API: cookiechange event in ServiceWorker with multiple subscriptions
// META: global=!default,serviceworker // META: global=serviceworker
'use strict'; 'use strict';

View file

@ -1,5 +1,5 @@
// META: title=Cookie Store API: cookiechange event in ServiceWorker with overlapping subscriptions // META: title=Cookie Store API: cookiechange event in ServiceWorker with overlapping subscriptions
// META: global=!default,serviceworker // META: global=serviceworker
'use strict'; 'use strict';

View file

@ -1,5 +1,5 @@
// META: title=Cookie Store API: cookiechange event in ServiceWorker with single subscription // META: title=Cookie Store API: cookiechange event in ServiceWorker with single subscription
// META: global=!default,serviceworker // META: global=serviceworker
'use strict'; 'use strict';

View file

@ -1,5 +1,5 @@
// META: title=Cookie Store API: oncookiechange event in ServiceWorker with single subscription // META: title=Cookie Store API: oncookiechange event in ServiceWorker with single subscription
// META: global=!default,serviceworker // META: global=serviceworker
'use strict'; 'use strict';

View file

@ -18,6 +18,20 @@
@keyframes animRight { @keyframes animRight {
to { right: 100px } to { right: 100px }
} }
@keyframes anim1 {
to { left: 100px }
}
@keyframes anim2 {
to { top: 100px }
}
@keyframes anim3 {
to { bottom: 100px }
}
@keyframes anim4 {
to { right: 100px }
}
</style> </style>
<div id="log"></div> <div id="log"></div>
<script> <script>
@ -285,6 +299,84 @@ test(t => {
'returned'); 'returned');
}, 'CSS Animations canceled and restarted via the API are returned'); }, 'CSS Animations canceled and restarted via the API are returned');
test(t => {
addStyle(t, {
'#parent::after': "content: ''; animation: anim1 100s ; ",
'#parent::before': "content: ''; animation: anim2 100s;",
'#child::after': "content: ''; animation: anim3 100s;",
'#child::before': "content: ''; animation: anim4 100s;",
});
const parent = addDiv(t, { id: 'parent' });
const child = addDiv(t, { id: 'child'});
parent.appendChild(child);
var animations = document.getAnimations();
var expectedAnimations = [
[parent, '::before', 'anim2'],
[parent, '::after', 'anim1'],
[child, '::before', 'anim4'],
[child, '::after', 'anim3'],
];
pseudoAnimCompare(animations, expectedAnimations)
// Swap animation1 and aimation3's effect
var anim1 = animations[0];
var anim3 = animations[2];
const temp = anim1.effect;
anim1.effect = anim3.effect;
anim3.effect = temp;
animations = document.getAnimations();
expectedAnimations = [
[child, '::before', 'anim2'],
[parent, '::after', 'anim1'],
[parent, '::before', 'anim4'],
[child, '::after', 'anim3'],
];
pseudoAnimCompare(animations, expectedAnimations)
}, 'pseudo element with replaced target does not affect animation ordering');
function pseudoAnimCompare(animations, expectedAnimations) {
assert_equals(
animations.length,
expectedAnimations.length,
'CSS animations on both pseudo-elements and elements are returned'
);
for (const [index, expected] of expectedAnimations.entries()) {
const [element, pseudo, name] = expected;
const actual = animations[index];
if (pseudo) {
assert_equals(
actual.effect.target,
element,
`Animation #${index + 1} has the expected target`
);
assert_equals(
actual.effect.pseudoElement,
pseudo,
`Animation #${index + 1} has the expected pseudo type`
);
if (name) {
assert_equals(
actual.animationName,
name,
`Animation #${index + 1} has the expected name`
);
}
} else {
assert_equals(
actual.effect.target,
element,
`Animation #${index + 1} has the expected target`
);
assert_equals(
actual.effect.pseudoElement,
null,
`Animation #${index + 1} has a null pseudo type`
);
}
}
}
function pseudoTest(description, testMarkerPseudos) { function pseudoTest(description, testMarkerPseudos) {
test(t => { test(t => {
// Create two divs with the following arrangement: // Create two divs with the following arrangement:
@ -327,40 +419,7 @@ function pseudoTest(description, testMarkerPseudos) {
} }
const animations = document.getAnimations(); const animations = document.getAnimations();
assert_equals( pseudoAnimCompare(animations, expectedAnimations)
animations.length,
expectedAnimations.length,
'CSS animations on both pseudo-elements and elements are returned'
);
for (const [index, expected] of expectedAnimations.entries()) {
const [element, pseudo] = expected;
const actual = animations[index];
if (pseudo) {
assert_equals(
actual.effect.target,
element,
`Animation #${index + 1} has expected target`
);
assert_equals(
actual.effect.pseudoElement,
pseudo,
`Animation #${index + 1} has expected pseudo type`
);
} else {
assert_equals(
actual.effect.target,
element,
`Animation #${index + 1} has expected target`
);
assert_equals(
actual.effect.pseudoElement,
null,
`Animation #${index + 1} has null pseudo type`
);
}
}
}, description); }, description);
} }
@ -368,5 +427,4 @@ pseudoTest('CSS Animations targetting (pseudo-)elements should have correct '
+ 'order after sorting', false); + 'order after sorting', false);
pseudoTest('CSS Animations targetting (pseudo-)elements should have correct ' pseudoTest('CSS Animations targetting (pseudo-)elements should have correct '
+ 'order after sorting (::marker)', true); + 'order after sorting (::marker)', true);
</script> </script>

Some files were not shown because too many files have changed in this diff Show more