Update web-platform-tests to revision d9ff48a8babff036c1f9d5285ec0dc55609bebb8
|
@ -0,0 +1,2 @@
|
|||
[2d.imageData.get.large.crash.html]
|
||||
expected: CRASH
|
|
@ -0,0 +1,4 @@
|
|||
[2d.video.invalid.html]
|
||||
[Verify test doesn't crash with invalid video.]
|
||||
expected: FAIL
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
expected: TIMEOUT
|
||||
|
||||
[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.]
|
||||
expected: FAIL
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
[hit-test-floats-004.html]
|
||||
[Miss float below something else]
|
||||
expected: FAIL
|
||||
|
|
@ -5,6 +5,9 @@
|
|||
[[data-expected-height\] 7]
|
||||
expected: FAIL
|
||||
|
||||
[[data-expected-height\] 4]
|
||||
[[data-expected-height\] 1]
|
||||
expected: FAIL
|
||||
|
||||
[[data-expected-height\] 2]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -50,3 +50,6 @@
|
|||
[Yet-to-start CSS Animations are returned]
|
||||
expected: FAIL
|
||||
|
||||
[pseudo element with replaced target does not affect animation ordering]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
[background-attachment-margin-root-001.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
|||
[background-attachment-margin-root-002.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
|||
[svg-image-orientation-none.html]
|
||||
expected: FAIL
|
|
@ -1,2 +1,2 @@
|
|||
[no-transition-from-ua-to-blocking-stylesheet.html]
|
||||
expected: FAIL
|
||||
expected: TIMEOUT
|
||||
|
|
|
@ -17,3 +17,6 @@
|
|||
[test the top of layer]
|
||||
expected: FAIL
|
||||
|
||||
[test some point of the element: top left corner]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -2,6 +2,3 @@
|
|||
[elementsFromPoint on the root document for points in iframe elements]
|
||||
expected: FAIL
|
||||
|
||||
[elementsFromPoint on inner documents]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -318,12 +318,18 @@
|
|||
[<iframe>: combined response Content-Type: text/html;" \\" text/plain]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: combined response Content-Type: text/html */*;charset=gbk]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: separate response Content-Type: text/html;" \\" text/plain]
|
||||
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
|
||||
|
||||
|
|
|
@ -59,6 +59,3 @@
|
|||
[separate text/javascript;charset=windows-1252 error text/javascript]
|
||||
expected: FAIL
|
||||
|
||||
[separate text/javascript;charset=windows-1252 text/javascript]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -11,3 +11,6 @@
|
|||
[X-Content-Type-Options%3A%20nosniff%0C]
|
||||
expected: FAIL
|
||||
|
||||
[X-Content-Type-Options%3A%20%22nosniFF%22]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
[traverse_the_history_1.html]
|
||||
[Multiple history traversals from the same task]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[traverse_the_history_2.html]
|
||||
[Multiple history traversals, last would be aborted]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[traverse_the_history_3.html]
|
||||
[Multiple history traversals, last would be aborted]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
[traverse_the_history_2.html]
|
||||
[traverse_the_history_4.html]
|
||||
[Multiple history traversals, last would be aborted]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
[cross-origin-objects-on-new-window.html]
|
||||
expected: TIMEOUT
|
|
@ -4,14 +4,17 @@
|
|||
expected: FAIL
|
||||
|
||||
[Host element with delegatesFocus including no focusable descendants should be skipped]
|
||||
expected: FAIL
|
||||
expected: NOTRUN
|
||||
|
||||
[Element with tabindex should support autofocus]
|
||||
expected: FAIL
|
||||
|
||||
[Area element should support autofocus]
|
||||
expected: TIMEOUT
|
||||
|
||||
[Host element with delegatesFocus should support autofocus]
|
||||
expected: FAIL
|
||||
[Area element should support autofocus]
|
||||
expected: NOTRUN
|
||||
|
||||
[Host element with delegatesFocus should support autofocus]
|
||||
expected: NOTRUN
|
||||
|
||||
[Non-HTMLElement should not support autofocus]
|
||||
expected: NOTRUN
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[iframe_sandbox_popups_nonescaping-2.html]
|
||||
expected: TIMEOUT
|
||||
expected: CRASH
|
||||
[Check that popups from a sandboxed iframe do not escape the sandbox]
|
||||
expected: NOTRUN
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[iframe_sandbox_popups_nonescaping-3.html]
|
||||
expected: TIMEOUT
|
||||
expected: CRASH
|
||||
[Check that popups from a sandboxed iframe do not escape the sandbox]
|
||||
expected: NOTRUN
|
||||
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
[script-onerror-insertion-point-2.html]
|
||||
expected: TIMEOUT
|
|
@ -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]
|
||||
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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
@ -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]
|
||||
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
|
||||
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
[017.html]
|
||||
expected: TIMEOUT
|
||||
[origin of the script that invoked the method, about:blank]
|
||||
expected: TIMEOUT
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[postMessage_block.https.html]
|
||||
[postMessage and block]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
[2d.imageData.get.large.crash.html]
|
||||
expected: CRASH
|
|
@ -0,0 +1,4 @@
|
|||
[2d.video.invalid.html]
|
||||
[Verify test doesn't crash with invalid video.]
|
||||
expected: FAIL
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
expected: FAIL
|
||||
|
||||
[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.]
|
||||
expected: TIMEOUT
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
[hit-test-floats-004.html]
|
||||
[Miss float below something else]
|
||||
expected: FAIL
|
||||
|
|
@ -8,6 +8,9 @@
|
|||
[[data-expected-height\] 3]
|
||||
expected: FAIL
|
||||
|
||||
[[data-expected-height\] 4]
|
||||
[[data-expected-height\] 1]
|
||||
expected: FAIL
|
||||
|
||||
[[data-expected-height\] 2]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -50,3 +50,6 @@
|
|||
[Order of CSS Animations - free animation vs CSS Transitions]
|
||||
expected: FAIL
|
||||
|
||||
[pseudo element with replaced target does not affect animation ordering]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
[background-attachment-margin-root-001.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
|||
[background-attachment-margin-root-002.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,2 @@
|
|||
[svg-image-orientation-none.html]
|
||||
expected: FAIL
|
|
@ -1,2 +1,2 @@
|
|||
[no-transition-from-ua-to-blocking-stylesheet.html]
|
||||
expected: FAIL
|
||||
expected: TIMEOUT
|
||||
|
|
|
@ -21,3 +21,6 @@
|
|||
[test the top of layer]
|
||||
expected: FAIL
|
||||
|
||||
[test some point of the element: top left corner]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -2,6 +2,3 @@
|
|||
[elementsFromPoint on the root document for points in iframe elements]
|
||||
expected: FAIL
|
||||
|
||||
[elementsFromPoint on inner documents]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -318,12 +318,18 @@
|
|||
[<iframe>: combined response Content-Type: text/html;" \\" text/plain]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: combined response Content-Type: text/html */*;charset=gbk]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: separate response Content-Type: text/html;" \\" text/plain]
|
||||
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
|
||||
|
||||
|
|
|
@ -59,6 +59,3 @@
|
|||
[separate text/javascript;charset=windows-1252 error text/javascript]
|
||||
expected: FAIL
|
||||
|
||||
[separate text/javascript;charset=windows-1252 text/javascript]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -11,3 +11,6 @@
|
|||
[X-Content-Type-Options%3A%20nosniff%2C%2C%40%23%24%23%25%25%26%5E%26%5E*()()11!]
|
||||
expected: FAIL
|
||||
|
||||
[X-Content-Type-Options%3A%20%22nosniFF%22]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
[traverse_the_history_1.html]
|
||||
[Multiple history traversals from the same task]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
[traverse_the_history_3.html]
|
||||
[traverse_the_history_4.html]
|
||||
[Multiple history traversals, last would be aborted]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
[cross-origin-objects-on-new-window.html]
|
||||
expected: TIMEOUT
|
|
@ -4,14 +4,17 @@
|
|||
expected: FAIL
|
||||
|
||||
[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
|
||||
|
||||
[Host element with delegatesFocus should support autofocus]
|
||||
expected: FAIL
|
||||
[Host element with delegatesFocus including no focusable descendants should be skipped]
|
||||
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
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[iframe_sandbox_popups_nonescaping-2.html]
|
||||
type: testharness
|
||||
expected: TIMEOUT
|
||||
expected: CRASH
|
||||
[Check that popups from a sandboxed iframe do not escape the sandbox]
|
||||
expected: NOTRUN
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[iframe_sandbox_popups_nonescaping-3.html]
|
||||
type: testharness
|
||||
expected: TIMEOUT
|
||||
expected: CRASH
|
||||
[Check that popups from a sandboxed iframe do not escape the sandbox]
|
||||
expected: NOTRUN
|
||||
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
[script-onerror-insertion-point-2.html]
|
||||
expected: TIMEOUT
|
|
@ -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]
|
||||
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
|
||||
|
||||
|
|
327
tests/wpt/metadata/url/url-setters-stripping.any.js.ini
Normal 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
|
||||
|
|
@ -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]
|
||||
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
|
||||
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
[017.html]
|
||||
expected: TIMEOUT
|
||||
[origin of the script that invoked the method, about:blank]
|
||||
expected: TIMEOUT
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[postMessage_block.https.html]
|
||||
[postMessage and block]
|
||||
expected: FAIL
|
||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 1.6 KiB |
|
@ -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>
|
||||
|
|
@ -42,6 +42,18 @@ ctx.miterLimit = 1.5;
|
|||
ctx.miterLimit = NaN;
|
||||
_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>
|
||||
|
|
|
@ -42,6 +42,18 @@ ctx.lineWidth = 1.5;
|
|||
ctx.lineWidth = NaN;
|
||||
_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>
|
||||
|
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -35,6 +35,18 @@ ctx.shadowBlur = 1;
|
|||
ctx.shadowBlur = NaN;
|
||||
_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>
|
||||
|
|
|
@ -40,6 +40,27 @@ ctx.shadowOffsetY = NaN;
|
|||
_assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1");
|
||||
_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>
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
2d.text.draw.space.collapse.start: "text-styles"
|
||||
2d.state: "the-canvas-state"
|
||||
2d.scrollPathIntoView: "scroll"
|
||||
2d.video: "video"
|
||||
2d.canvas: "../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"
|
||||
|
|
|
@ -3762,6 +3762,18 @@
|
|||
ctx.lineWidth = NaN;
|
||||
@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
|
||||
desc: lineCap 'butt' is rendered correctly
|
||||
testing:
|
||||
|
@ -4512,6 +4524,18 @@
|
|||
ctx.miterLimit = NaN;
|
||||
@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
|
||||
code: |
|
||||
ctx.fillStyle = '#0f0';
|
||||
|
@ -4607,6 +4631,18 @@
|
|||
ctx.shadowBlur = NaN;
|
||||
@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
|
||||
testing:
|
||||
- 2d.shadow.offset.initial
|
||||
|
@ -4669,6 +4705,27 @@
|
|||
@assert ctx.shadowOffsetX === 1;
|
||||
@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
|
||||
testing:
|
||||
- 2d.shadow.color.initial
|
||||
|
@ -9732,6 +9789,38 @@
|
|||
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
|
||||
desc: ImageData objects have the right properties
|
||||
testing:
|
||||
|
@ -10365,4 +10454,30 @@
|
|||
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);
|
||||
|
|
|
@ -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>
|
||||
|
|
@ -195,20 +195,21 @@ function simulateGATTDisconnectionAndWait(device, fake_peripheral) {
|
|||
* @returns {Promise<Array<FakePeripheral>>} The fake devices are initialized as
|
||||
* Health Thermometer and Heart Rate devices.
|
||||
*/
|
||||
function setUpHealthThermometerAndHeartRateDevices() {
|
||||
return navigator.bluetooth.test.simulateCentral({state: 'powered-on'})
|
||||
.then(fake_central => Promise.all([
|
||||
fake_central.simulatePreconnectedPeripheral({
|
||||
address: '09:09:09:09:09:09',
|
||||
name: 'Health Thermometer',
|
||||
knownServiceUUIDs: ['generic_access', 'health_thermometer'],
|
||||
}),
|
||||
fake_central.simulatePreconnectedPeripheral({
|
||||
address: '08:08:08:08:08:08',
|
||||
name: 'Heart Rate',
|
||||
knownServiceUUIDs: ['generic_access', 'heart_rate'],
|
||||
})
|
||||
]));
|
||||
async function setUpHealthThermometerAndHeartRateDevices() {
|
||||
let fake_central =
|
||||
await navigator.bluetooth.test.simulateCentral({state: 'powered-on'});
|
||||
return Promise.all([
|
||||
fake_central.simulatePreconnectedPeripheral({
|
||||
address: '09:09:09:09:09:09',
|
||||
name: 'Health Thermometer',
|
||||
knownServiceUUIDs: ['generic_access', 'health_thermometer'],
|
||||
}),
|
||||
fake_central.simulatePreconnectedPeripheral({
|
||||
address: '08:08:08:08:08:08',
|
||||
name: 'Heart Rate',
|
||||
knownServiceUUIDs: ['generic_access', 'heart_rate'],
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -221,17 +222,18 @@ function setUpHealthThermometerAndHeartRateDevices() {
|
|||
* @returns {Promise<FakePeripheral>} The fake devices are initialized with the
|
||||
* parameter values.
|
||||
*/
|
||||
function setUpPreconnectedDevice({
|
||||
async function setUpPreconnectedDevice({
|
||||
address = '00:00:00:00:00:00',
|
||||
name = 'LE Device',
|
||||
knownServiceUUIDs = []
|
||||
}) {
|
||||
return navigator.bluetooth.test.simulateCentral({state: 'powered-on'})
|
||||
.then(fake_central => fake_central.simulatePreconnectedPeripheral({
|
||||
address: address,
|
||||
name: name,
|
||||
knownServiceUUIDs: knownServiceUUIDs,
|
||||
}));
|
||||
let fake_central =
|
||||
await navigator.bluetooth.test.simulateCentral({state: 'powered-on'})
|
||||
return fake_central.simulatePreconnectedPeripheral({
|
||||
address: address,
|
||||
name: name,
|
||||
knownServiceUUIDs: knownServiceUUIDs,
|
||||
});
|
||||
}
|
||||
|
||||
/** Blocklisted GATT Device Helper Methods */
|
||||
|
@ -266,65 +268,52 @@ function setUpPreconnectedDevice({
|
|||
* object containing the BluetoothDevice object and its corresponding
|
||||
* GATT fake objects.
|
||||
*/
|
||||
function getBlocklistDevice(options = {
|
||||
async function getBlocklistDevice(options = {
|
||||
filters: [{services: [blocklist_test_service_uuid]}]
|
||||
}) {
|
||||
let device, fake_peripheral, 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;
|
||||
return setUpPreconnectedDevice({
|
||||
address: '11:11:11:11:11:11',
|
||||
name: 'Blocklist Device',
|
||||
knownServiceUUIDs: ['generic_access', blocklist_test_service_uuid],
|
||||
})
|
||||
.then(_ => fake_peripheral = _)
|
||||
.then(() => requestDeviceWithTrustedClick(options))
|
||||
.then(_ => device = _)
|
||||
.then(() => fake_peripheral.setNextGATTConnectionResponse({
|
||||
code: HCI_SUCCESS,
|
||||
}))
|
||||
.then(() => device.gatt.connect())
|
||||
.then(() => fake_peripheral.addFakeService({
|
||||
uuid: blocklist_test_service_uuid,
|
||||
}))
|
||||
.then(_ => fake_blocklist_test_service = _)
|
||||
.then(() => fake_blocklist_test_service.addFakeCharacteristic({
|
||||
let fake_peripheral = await setUpPreconnectedDevice({
|
||||
address: '11:11:11:11:11:11',
|
||||
name: 'Blocklist Device',
|
||||
knownServiceUUIDs: ['generic_access', blocklist_test_service_uuid],
|
||||
})
|
||||
let device = await requestDeviceWithTrustedClick(options);
|
||||
await fake_peripheral.setNextGATTConnectionResponse({
|
||||
code: HCI_SUCCESS,
|
||||
});
|
||||
await device.gatt.connect();
|
||||
let fake_blocklist_test_service = await fake_peripheral.addFakeService({
|
||||
uuid: blocklist_test_service_uuid,
|
||||
});
|
||||
let fake_blocklist_exclude_reads_characteristic =
|
||||
await fake_blocklist_test_service.addFakeCharacteristic({
|
||||
uuid: blocklist_exclude_reads_characteristic_uuid,
|
||||
properties: ['read', 'write'],
|
||||
}))
|
||||
.then(_ => fake_blocklist_exclude_reads_characteristic = _)
|
||||
.then(() => fake_blocklist_test_service.addFakeCharacteristic({
|
||||
});
|
||||
let fake_blocklist_exclude_writes_characteristic =
|
||||
await fake_blocklist_test_service.addFakeCharacteristic({
|
||||
uuid: 'gap.peripheral_privacy_flag',
|
||||
properties: ['read', 'write'],
|
||||
}))
|
||||
.then(_ => fake_blocklist_exclude_writes_characteristic = _)
|
||||
.then(
|
||||
() => fake_blocklist_exclude_writes_characteristic.addFakeDescriptor(
|
||||
{uuid: blocklist_test_descriptor_uuid}))
|
||||
.then(_ => fake_blocklist_descriptor = _)
|
||||
.then(
|
||||
() => fake_blocklist_exclude_writes_characteristic.addFakeDescriptor(
|
||||
{uuid: blocklist_exclude_reads_descriptor_uuid}))
|
||||
.then(_ => fake_blocklist_exclude_reads_descriptor = _)
|
||||
.then(
|
||||
() => fake_blocklist_exclude_writes_characteristic.addFakeDescriptor(
|
||||
{uuid: 'gatt.client_characteristic_configuration'}))
|
||||
.then(_ => fake_blocklist_exclude_writes_descriptor = _)
|
||||
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({
|
||||
code: HCI_SUCCESS,
|
||||
}))
|
||||
.then(() => ({
|
||||
device,
|
||||
fake_peripheral,
|
||||
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,
|
||||
}));
|
||||
});
|
||||
let fake_blocklist_descriptor =
|
||||
await fake_blocklist_exclude_writes_characteristic.addFakeDescriptor(
|
||||
{uuid: blocklist_test_descriptor_uuid});
|
||||
let fake_blocklist_exclude_reads_descriptor =
|
||||
await fake_blocklist_exclude_writes_characteristic.addFakeDescriptor(
|
||||
{uuid: blocklist_exclude_reads_descriptor_uuid});
|
||||
let fake_blocklist_exclude_writes_descriptor =
|
||||
await fake_blocklist_exclude_writes_characteristic.addFakeDescriptor(
|
||||
{uuid: 'gatt.client_characteristic_configuration'});
|
||||
await fake_peripheral.setNextGATTDiscoveryResponse({code: HCI_SUCCESS});
|
||||
return {
|
||||
device,
|
||||
fake_peripheral,
|
||||
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
|
||||
* BluetoothDevice object and its corresponding GATT fake objects.
|
||||
*/
|
||||
function getBlocklistTestService() {
|
||||
let result;
|
||||
return getBlocklistDevice()
|
||||
.then(_ => result = _)
|
||||
.then(
|
||||
() =>
|
||||
result.device.gatt.getPrimaryService(blocklist_test_service_uuid))
|
||||
.then(service => Object.assign(result, {
|
||||
service,
|
||||
fake_service: result.fake_blocklist_test_service,
|
||||
}));
|
||||
async function getBlocklistTestService() {
|
||||
let result = await getBlocklistDevice();
|
||||
let service =
|
||||
await result.device.gatt.getPrimaryService(blocklist_test_service_uuid);
|
||||
return 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
|
||||
* objects.
|
||||
*/
|
||||
function getBlocklistExcludeReadsCharacteristic() {
|
||||
let result, fake_characteristic;
|
||||
return getBlocklistTestService()
|
||||
.then(_ => result = _)
|
||||
.then(
|
||||
() => result.service.getCharacteristic(
|
||||
blocklist_exclude_reads_characteristic_uuid))
|
||||
.then(characteristic => Object.assign(result, {
|
||||
characteristic,
|
||||
fake_characteristic: result.fake_blocklist_exclude_reads_characteristic
|
||||
}));
|
||||
async function getBlocklistExcludeReadsCharacteristic() {
|
||||
let result = await getBlocklistTestService();
|
||||
let characteristic = await result.service.getCharacteristic(
|
||||
blocklist_exclude_reads_characteristic_uuid);
|
||||
return 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
|
||||
* objects.
|
||||
*/
|
||||
function getBlocklistExcludeWritesCharacteristic() {
|
||||
let result, fake_characteristic;
|
||||
return getBlocklistTestService()
|
||||
.then(_ => result = _)
|
||||
.then(
|
||||
() => result.service.getCharacteristic('gap.peripheral_privacy_flag'))
|
||||
.then(characteristic => Object.assign(result, {
|
||||
characteristic,
|
||||
fake_characteristic: result.fake_blocklist_exclude_writes_characteristic
|
||||
}));
|
||||
async function getBlocklistExcludeWritesCharacteristic() {
|
||||
let result = await getBlocklistTestService();
|
||||
let characteristic =
|
||||
await result.service.getCharacteristic('gap.peripheral_privacy_flag');
|
||||
return Object.assign(result, {
|
||||
characteristic,
|
||||
fake_characteristic: result.fake_blocklist_exclude_writes_characteristic
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -440,17 +421,14 @@ function getBlocklistExcludeWritesCharacteristic() {
|
|||
* containing the BluetoothDevice object and its corresponding GATT fake
|
||||
* objects.
|
||||
*/
|
||||
function getBlocklistExcludeReadsDescriptor() {
|
||||
let result;
|
||||
return getBlocklistExcludeWritesCharacteristic()
|
||||
.then(_ => result = _)
|
||||
.then(
|
||||
() => result.characteristic.getDescriptor(
|
||||
blocklist_exclude_reads_descriptor_uuid))
|
||||
.then(descriptor => Object.assign(result, {
|
||||
descriptor,
|
||||
fake_descriptor: result.fake_blocklist_exclude_reads_descriptor
|
||||
}));
|
||||
async function getBlocklistExcludeReadsDescriptor() {
|
||||
let result = await getBlocklistExcludeWritesCharacteristic();
|
||||
let descriptor = await result.characteristic.getDescriptor(
|
||||
blocklist_exclude_reads_descriptor_uuid);
|
||||
return 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
|
||||
* objects.
|
||||
*/
|
||||
function getBlocklistExcludeWritesDescriptor() {
|
||||
let result;
|
||||
return getBlocklistExcludeWritesCharacteristic()
|
||||
.then(_ => result = _)
|
||||
.then(
|
||||
() => result.characteristic.getDescriptor(
|
||||
'gatt.client_characteristic_configuration'))
|
||||
.then(descriptor => Object.assign(result, {
|
||||
descriptor: descriptor,
|
||||
fake_descriptor: result.fake_blocklist_exclude_writes_descriptor,
|
||||
}));
|
||||
async function getBlocklistExcludeWritesDescriptor() {
|
||||
let result = await getBlocklistExcludeWritesCharacteristic();
|
||||
let descriptor = await result.characteristic.getDescriptor(
|
||||
'gatt.client_characteristic_configuration');
|
||||
return Object.assign(result, {
|
||||
descriptor: descriptor,
|
||||
fake_descriptor: result.fake_blocklist_exclude_writes_descriptor,
|
||||
});
|
||||
}
|
||||
|
||||
/** Bluetooth HID Device Helper Methods */
|
||||
|
@ -498,40 +473,37 @@ function getBlocklistExcludeWritesDescriptor() {
|
|||
* @returns {device: BluetoothDevice, fake_peripheral: FakePeripheral} An object
|
||||
* containing a requested BluetoothDevice and its fake counter part.
|
||||
*/
|
||||
function getConnectedHIDDevice(options) {
|
||||
let device, fake_peripheral;
|
||||
return setUpPreconnectedDevice({
|
||||
address: '10:10:10:10:10:10',
|
||||
name: 'HID Device',
|
||||
knownServiceUUIDs: [
|
||||
'generic_access',
|
||||
'device_information',
|
||||
'human_interface_device',
|
||||
],
|
||||
})
|
||||
.then(_ => (fake_peripheral = _))
|
||||
.then(() => requestDeviceWithTrustedClick(options))
|
||||
.then(_ => (device = _))
|
||||
.then(() => fake_peripheral.setNextGATTConnectionResponse({
|
||||
code: HCI_SUCCESS,
|
||||
}))
|
||||
.then(() => device.gatt.connect())
|
||||
.then(() => fake_peripheral.addFakeService({
|
||||
uuid: 'generic_access',
|
||||
}))
|
||||
.then(() => fake_peripheral.addFakeService({
|
||||
uuid: 'device_information',
|
||||
}))
|
||||
// Blocklisted Characteristic:
|
||||
// https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt
|
||||
.then(dev_info => dev_info.addFakeCharacteristic({
|
||||
uuid: 'serial_number_string',
|
||||
properties: ['read'],
|
||||
}))
|
||||
.then(() => fake_peripheral.addFakeService({
|
||||
uuid: 'human_interface_device',
|
||||
}))
|
||||
.then(() => ({device, fake_peripheral}));
|
||||
async function getConnectedHIDDevice(options) {
|
||||
let fake_peripheral = await setUpPreconnectedDevice({
|
||||
address: '10:10:10:10:10:10',
|
||||
name: 'HID Device',
|
||||
knownServiceUUIDs: [
|
||||
'generic_access',
|
||||
'device_information',
|
||||
'human_interface_device',
|
||||
],
|
||||
});
|
||||
let device = await requestDeviceWithTrustedClick(options);
|
||||
await fake_peripheral.setNextGATTConnectionResponse({
|
||||
code: HCI_SUCCESS,
|
||||
});
|
||||
await device.gatt.connect();
|
||||
await fake_peripheral.addFakeService({
|
||||
uuid: 'generic_access',
|
||||
});
|
||||
let dev_info = await fake_peripheral.addFakeService({
|
||||
uuid: 'device_information',
|
||||
});
|
||||
// Blocklisted Characteristic:
|
||||
// https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt
|
||||
await dev_info.addFakeCharacteristic({
|
||||
uuid: 'serial_number_string',
|
||||
properties: ['read'],
|
||||
});
|
||||
await fake_peripheral.addFakeService({
|
||||
uuid: 'human_interface_device',
|
||||
});
|
||||
return {device, fake_peripheral};
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -547,14 +519,12 @@ function getConnectedHIDDevice(options) {
|
|||
* @returns {device: BluetoothDevice, fake_peripheral: FakePeripheral} An object
|
||||
* containing a requested BluetoothDevice and its fake counter part.
|
||||
*/
|
||||
function getHIDDevice(options) {
|
||||
let device, fake_peripheral;
|
||||
return getConnectedHIDDevice(options)
|
||||
.then(_ => ({device, fake_peripheral} = _))
|
||||
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({
|
||||
code: HCI_SUCCESS,
|
||||
}))
|
||||
.then(() => ({device, fake_peripheral}));
|
||||
async function getHIDDevice(options) {
|
||||
let result = await getConnectedHIDDevice(options);
|
||||
await result.fake_peripheral.setNextGATTDiscoveryResponse({
|
||||
code: HCI_SUCCESS,
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/** Health Thermometer Bluetooth Device Helper Methods */
|
||||
|
@ -563,7 +533,7 @@ function getHIDDevice(options) {
|
|||
* Returns a FakePeripheral that corresponds to a simulated pre-connected device
|
||||
* called 'Health Thermometer'. The device has two known serviceUUIDs:
|
||||
* '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.
|
||||
*/
|
||||
function setUpHealthThermometerDevice() {
|
||||
|
@ -580,14 +550,12 @@ function setUpHealthThermometerDevice() {
|
|||
* @returns {Promise<FakePeripheral>} The device fake initialized as a
|
||||
* connectable Health Thermometer device.
|
||||
*/
|
||||
function setUpConnectableHealthThermometerDevice() {
|
||||
let fake_peripheral;
|
||||
return setUpHealthThermometerDevice()
|
||||
.then(_ => fake_peripheral = _)
|
||||
.then(() => fake_peripheral.setNextGATTConnectionResponse({
|
||||
code: HCI_SUCCESS,
|
||||
}))
|
||||
.then(() => fake_peripheral);
|
||||
async function setUpConnectableHealthThermometerDevice() {
|
||||
let fake_peripheral = await setUpHealthThermometerDevice();
|
||||
await fake_peripheral.setNextGATTConnectionResponse({
|
||||
code: HCI_SUCCESS,
|
||||
});
|
||||
return fake_peripheral;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -607,49 +575,44 @@ function setUpConnectableHealthThermometerDevice() {
|
|||
* passed into this method along with the fake GATT services, characteristics,
|
||||
* and descriptors added to it.
|
||||
*/
|
||||
function populateHealthThermometerFakes(fake_peripheral) {
|
||||
let fake_generic_access, fake_health_thermometer, fake_measurement_interval,
|
||||
fake_user_description, fake_cccd, fake_temperature_measurement,
|
||||
fake_temperature_type;
|
||||
return fake_peripheral.addFakeService({uuid: 'generic_access'})
|
||||
.then(_ => fake_generic_access = _)
|
||||
.then(() => fake_peripheral.addFakeService({
|
||||
uuid: 'health_thermometer',
|
||||
}))
|
||||
.then(_ => fake_health_thermometer = _)
|
||||
.then(() => fake_health_thermometer.addFakeCharacteristic({
|
||||
async function populateHealthThermometerFakes(fake_peripheral) {
|
||||
let fake_generic_access =
|
||||
await fake_peripheral.addFakeService({uuid: 'generic_access'});
|
||||
let fake_health_thermometer = await fake_peripheral.addFakeService({
|
||||
uuid: 'health_thermometer',
|
||||
});
|
||||
let fake_measurement_interval =
|
||||
await fake_health_thermometer.addFakeCharacteristic({
|
||||
uuid: 'measurement_interval',
|
||||
properties: ['read', 'write', 'indicate'],
|
||||
}))
|
||||
.then(_ => fake_measurement_interval = _)
|
||||
.then(() => fake_measurement_interval.addFakeDescriptor({
|
||||
});
|
||||
let fake_user_description =
|
||||
await fake_measurement_interval.addFakeDescriptor({
|
||||
uuid: 'gatt.characteristic_user_description',
|
||||
}))
|
||||
.then(_ => fake_user_description = _)
|
||||
.then(() => fake_measurement_interval.addFakeDescriptor({
|
||||
uuid: 'gatt.client_characteristic_configuration',
|
||||
}))
|
||||
.then(_ => fake_cccd = _)
|
||||
.then(() => fake_health_thermometer.addFakeCharacteristic({
|
||||
});
|
||||
let fake_cccd = await fake_measurement_interval.addFakeDescriptor({
|
||||
uuid: 'gatt.client_characteristic_configuration',
|
||||
});
|
||||
let fake_temperature_measurement =
|
||||
await fake_health_thermometer.addFakeCharacteristic({
|
||||
uuid: 'temperature_measurement',
|
||||
properties: ['indicate'],
|
||||
}))
|
||||
.then(_ => fake_temperature_measurement = _)
|
||||
.then(() => fake_health_thermometer.addFakeCharacteristic({
|
||||
});
|
||||
let fake_temperature_type =
|
||||
await fake_health_thermometer.addFakeCharacteristic({
|
||||
uuid: 'temperature_type',
|
||||
properties: ['read'],
|
||||
}))
|
||||
.then(_ => fake_temperature_type = _)
|
||||
.then(() => ({
|
||||
fake_peripheral,
|
||||
fake_generic_access,
|
||||
fake_health_thermometer,
|
||||
fake_measurement_interval,
|
||||
fake_cccd,
|
||||
fake_user_description,
|
||||
fake_temperature_measurement,
|
||||
fake_temperature_type,
|
||||
}));
|
||||
});
|
||||
return {
|
||||
fake_peripheral,
|
||||
fake_generic_access,
|
||||
fake_health_thermometer,
|
||||
fake_measurement_interval,
|
||||
fake_cccd,
|
||||
fake_user_description,
|
||||
fake_temperature_measurement,
|
||||
fake_temperature_type,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -670,50 +633,45 @@ function populateHealthThermometerFakes(fake_peripheral) {
|
|||
* containing a requested BluetoothDevice and all of the GATT fake
|
||||
* objects.
|
||||
*/
|
||||
function getHealthThermometerDeviceWithServicesDiscovered(options) {
|
||||
let device, fake_peripheral, fakes;
|
||||
async function getHealthThermometerDeviceWithServicesDiscovered(options) {
|
||||
let iframe = document.createElement('iframe');
|
||||
return setUpConnectableHealthThermometerDevice()
|
||||
.then(_ => fake_peripheral = _)
|
||||
.then(() => populateHealthThermometerFakes(fake_peripheral))
|
||||
.then(_ => fakes = _)
|
||||
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({
|
||||
code: HCI_SUCCESS,
|
||||
}))
|
||||
.then(
|
||||
() => new Promise(resolve => {
|
||||
let src = '/bluetooth/resources/health-thermometer-iframe.html';
|
||||
// TODO(509038): Can be removed once LayoutTests/bluetooth/* that
|
||||
// use health-thermometer-iframe.html have been moved to
|
||||
// LayoutTests/external/wpt/bluetooth/*
|
||||
if (window.location.pathname.includes('/LayoutTests/')) {
|
||||
src =
|
||||
'../../../external/wpt/bluetooth/resources/health-thermometer-iframe.html';
|
||||
}
|
||||
iframe.src = src;
|
||||
document.body.appendChild(iframe);
|
||||
iframe.addEventListener('load', resolve);
|
||||
}))
|
||||
.then(() => new Promise((resolve, reject) => {
|
||||
callWithTrustedClick(() => {
|
||||
iframe.contentWindow.postMessage(
|
||||
{type: 'DiscoverServices', options: options}, '*');
|
||||
});
|
||||
let fake_peripheral = await setUpConnectableHealthThermometerDevice();
|
||||
let fakes = populateHealthThermometerFakes(fake_peripheral);
|
||||
await fake_peripheral.setNextGATTDiscoveryResponse({
|
||||
code: HCI_SUCCESS,
|
||||
});
|
||||
await new Promise(resolve => {
|
||||
let src = '/bluetooth/resources/health-thermometer-iframe.html';
|
||||
// TODO(509038): Can be removed once LayoutTests/bluetooth/* that
|
||||
// use health-thermometer-iframe.html have been moved to
|
||||
// LayoutTests/external/wpt/bluetooth/*
|
||||
if (window.location.pathname.includes('/LayoutTests/')) {
|
||||
src =
|
||||
'../../../external/wpt/bluetooth/resources/health-thermometer-iframe.html';
|
||||
}
|
||||
iframe.src = src;
|
||||
document.body.appendChild(iframe);
|
||||
iframe.addEventListener('load', resolve);
|
||||
});
|
||||
await new Promise((resolve, reject) => {
|
||||
callWithTrustedClick(() => {
|
||||
iframe.contentWindow.postMessage(
|
||||
{type: 'DiscoverServices', options: options}, '*');
|
||||
});
|
||||
|
||||
function messageHandler(messageEvent) {
|
||||
if (messageEvent.data == 'DiscoveryComplete') {
|
||||
window.removeEventListener('message', messageHandler);
|
||||
resolve();
|
||||
} else {
|
||||
reject(new Error(`Unexpected message: ${messageEvent.data}`));
|
||||
}
|
||||
}
|
||||
window.addEventListener('message', messageHandler);
|
||||
}))
|
||||
.then(() => requestDeviceWithTrustedClick(options))
|
||||
.then(_ => device = _)
|
||||
.then(device => device.gatt.connect())
|
||||
.then(_ => Object.assign({device}, fakes));
|
||||
function messageHandler(messageEvent) {
|
||||
if (messageEvent.data == 'DiscoveryComplete') {
|
||||
window.removeEventListener('message', messageHandler);
|
||||
resolve();
|
||||
} else {
|
||||
reject(new Error(`Unexpected message: ${messageEvent.data}`));
|
||||
}
|
||||
}
|
||||
window.addEventListener('message', messageHandler);
|
||||
});
|
||||
let device = await requestDeviceWithTrustedClick(options);
|
||||
await device.gatt.connect();
|
||||
return Object.assign({device}, fakes);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -725,13 +683,12 @@ function getHealthThermometerDeviceWithServicesDiscovered(options) {
|
|||
* @returns {device: BluetoothDevice, fake_peripheral: FakePeripheral} An object
|
||||
* containing a requested BluetoothDevice and its fake counter part.
|
||||
*/
|
||||
function getDiscoveredHealthThermometerDevice(options = {
|
||||
async function getDiscoveredHealthThermometerDevice(options = {
|
||||
filters: [{services: ['health_thermometer']}]
|
||||
}) {
|
||||
return setUpHealthThermometerDevice().then(fake_peripheral => {
|
||||
return requestDeviceWithTrustedClick(options).then(
|
||||
device => ({device: device, fake_peripheral: fake_peripheral}));
|
||||
});
|
||||
let fake_peripheral = await setUpHealthThermometerDevice();
|
||||
let device = await requestDeviceWithTrustedClick(options);
|
||||
return {device: device, fake_peripheral: fake_peripheral};
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -742,17 +699,14 @@ function getDiscoveredHealthThermometerDevice(options = {
|
|||
* @returns {device: BluetoothDevice, fake_peripheral: FakePeripheral} An object
|
||||
* containing a requested BluetoothDevice and its fake counter part.
|
||||
*/
|
||||
function getEmptyHealthThermometerDevice(options) {
|
||||
return getDiscoveredHealthThermometerDevice(options).then(
|
||||
({device, fake_peripheral}) => {
|
||||
return fake_peripheral
|
||||
.setNextGATTConnectionResponse({code: HCI_SUCCESS})
|
||||
.then(() => device.gatt.connect())
|
||||
.then(
|
||||
() => fake_peripheral.setNextGATTDiscoveryResponse(
|
||||
{code: HCI_SUCCESS}))
|
||||
.then(() => ({device: device, fake_peripheral: fake_peripheral}));
|
||||
});
|
||||
async function getEmptyHealthThermometerDevice(options) {
|
||||
let result = await getDiscoveredHealthThermometerDevice(options);
|
||||
await result.fake_peripheral.setNextGATTConnectionResponse(
|
||||
{code: HCI_SUCCESS});
|
||||
await result.device.gatt.connect();
|
||||
await result.fake_peripheral.setNextGATTDiscoveryResponse(
|
||||
{code: HCI_SUCCESS});
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -764,26 +718,21 @@ function getEmptyHealthThermometerDevice(options) {
|
|||
* fake_health_thermometer: FakeRemoteGATTService} An object containing the
|
||||
* health themometer service object and its corresponding fake.
|
||||
*/
|
||||
function getEmptyHealthThermometerService(options) {
|
||||
let device;
|
||||
let fake_peripheral;
|
||||
let fake_health_thermometer;
|
||||
return getDiscoveredHealthThermometerDevice(options)
|
||||
.then(result => ({device, fake_peripheral} = result))
|
||||
.then(
|
||||
() => fake_peripheral.setNextGATTConnectionResponse(
|
||||
{code: HCI_SUCCESS}))
|
||||
.then(() => device.gatt.connect())
|
||||
.then(() => fake_peripheral.addFakeService({uuid: 'health_thermometer'}))
|
||||
.then(s => fake_health_thermometer = s)
|
||||
.then(
|
||||
() =>
|
||||
fake_peripheral.setNextGATTDiscoveryResponse({code: HCI_SUCCESS}))
|
||||
.then(() => device.gatt.getPrimaryService('health_thermometer'))
|
||||
.then(service => ({
|
||||
service: service,
|
||||
fake_health_thermometer: fake_health_thermometer,
|
||||
}));
|
||||
async function getEmptyHealthThermometerService(options) {
|
||||
let result = await getDiscoveredHealthThermometerDevice(options);
|
||||
await result.fake_peripheral.setNextGATTConnectionResponse(
|
||||
{code: HCI_SUCCESS});
|
||||
await result.device.gatt.connect();
|
||||
let fake_health_thermometer =
|
||||
await result.fake_peripheral.addFakeService({uuid: 'health_thermometer'});
|
||||
await result.fake_peripheral.setNextGATTDiscoveryResponse(
|
||||
{code: HCI_SUCCESS});
|
||||
let service =
|
||||
await result.device.gatt.getPrimaryService('health_thermometer');
|
||||
return {
|
||||
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
|
||||
* objects.
|
||||
*/
|
||||
function getConnectedHealthThermometerDevice(options) {
|
||||
let device, fake_peripheral, fakes;
|
||||
return getDiscoveredHealthThermometerDevice(options)
|
||||
.then(_ => ({device, fake_peripheral} = _))
|
||||
.then(() => fake_peripheral.setNextGATTConnectionResponse({
|
||||
code: HCI_SUCCESS,
|
||||
}))
|
||||
.then(() => populateHealthThermometerFakes(fake_peripheral))
|
||||
.then(_ => fakes = _)
|
||||
.then(() => device.gatt.connect())
|
||||
.then(() => Object.assign({device}, fakes));
|
||||
async function getConnectedHealthThermometerDevice(options) {
|
||||
let result = await getDiscoveredHealthThermometerDevice(options);
|
||||
await result.fake_peripheral.setNextGATTConnectionResponse({
|
||||
code: HCI_SUCCESS,
|
||||
});
|
||||
let fakes = await populateHealthThermometerFakes(result.fake_peripheral);
|
||||
await result.device.gatt.connect();
|
||||
return Object.assign({device: result.device}, fakes);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -845,14 +791,12 @@ function getConnectedHealthThermometerDevice(options) {
|
|||
* containing a requested BluetoothDevice and all of the GATT fake
|
||||
* objects.
|
||||
*/
|
||||
function getHealthThermometerDevice(options) {
|
||||
let result;
|
||||
return getConnectedHealthThermometerDevice(options)
|
||||
.then(_ => result = _)
|
||||
.then(() => result.fake_peripheral.setNextGATTDiscoveryResponse({
|
||||
code: HCI_SUCCESS,
|
||||
}))
|
||||
.then(() => result);
|
||||
async function getHealthThermometerDevice(options) {
|
||||
let result = await getConnectedHealthThermometerDevice(options);
|
||||
await result.fake_peripheral.setNextGATTDiscoveryResponse({
|
||||
code: HCI_SUCCESS,
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -866,34 +810,19 @@ function getHealthThermometerDevice(options) {
|
|||
* object containing a requested Bluetooth device and two fake health
|
||||
* thermometer GATT services.
|
||||
*/
|
||||
function getTwoHealthThermometerServicesDevice(options) {
|
||||
let device;
|
||||
let fake_peripheral;
|
||||
let fake_generic_access;
|
||||
let fake_health_thermometer1;
|
||||
let fake_health_thermometer2;
|
||||
|
||||
return getConnectedHealthThermometerDevice(options)
|
||||
.then(result => {
|
||||
({
|
||||
device,
|
||||
fake_peripheral,
|
||||
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
|
||||
}));
|
||||
async function getTwoHealthThermometerServicesDevice(options) {
|
||||
let result = await getConnectedHealthThermometerDevice(options);
|
||||
let fake_health_thermometer2 =
|
||||
await result.fake_peripheral.addFakeService({uuid: 'health_thermometer'});
|
||||
await result.fake_peripheral.setNextGATTDiscoveryResponse(
|
||||
{code: HCI_SUCCESS});
|
||||
return {
|
||||
device: result.device,
|
||||
fake_peripheral: result.fake_peripheral,
|
||||
fake_generic_access: result.fake_generic_access,
|
||||
fake_health_thermometer1: result.fake_health_thermometer,
|
||||
fake_health_thermometer2: fake_health_thermometer2
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -913,15 +842,14 @@ function getTwoHealthThermometerServicesDevice(options) {
|
|||
* containing a requested BluetoothDevice and all of the GATT fake
|
||||
* objects.
|
||||
*/
|
||||
function getHealthThermometerService() {
|
||||
let result;
|
||||
return getHealthThermometerDevice()
|
||||
.then(r => result = r)
|
||||
.then(() => result.device.gatt.getPrimaryService('health_thermometer'))
|
||||
.then(service => Object.assign(result, {
|
||||
service,
|
||||
fake_service: result.fake_health_thermometer,
|
||||
}));
|
||||
async function getHealthThermometerService() {
|
||||
let result = await getHealthThermometerDevice();
|
||||
let service =
|
||||
await result.device.gatt.getPrimaryService('health_thermometer');
|
||||
return Object.assign(result, {
|
||||
service,
|
||||
fake_service: result.fake_health_thermometer,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -944,15 +872,14 @@ function getHealthThermometerService() {
|
|||
* containing a requested BluetoothDevice and all of the GATT fake
|
||||
* objects.
|
||||
*/
|
||||
function getMeasurementIntervalCharacteristic() {
|
||||
let result;
|
||||
return getHealthThermometerService()
|
||||
.then(r => result = r)
|
||||
.then(() => result.service.getCharacteristic('measurement_interval'))
|
||||
.then(characteristic => Object.assign(result, {
|
||||
characteristic,
|
||||
fake_characteristic: result.fake_measurement_interval,
|
||||
}));
|
||||
async function getMeasurementIntervalCharacteristic() {
|
||||
let result = await getHealthThermometerService();
|
||||
let characteristic =
|
||||
await result.service.getCharacteristic('measurement_interval');
|
||||
return Object.assign(result, {
|
||||
characteristic,
|
||||
fake_characteristic: result.fake_measurement_interval,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -977,15 +904,12 @@ function getMeasurementIntervalCharacteristic() {
|
|||
* containing a requested BluetoothDevice and all of the GATT fake
|
||||
* objects.
|
||||
*/
|
||||
function getUserDescriptionDescriptor() {
|
||||
let result;
|
||||
return getMeasurementIntervalCharacteristic()
|
||||
.then(r => result = r)
|
||||
.then(
|
||||
() => result.characteristic.getDescriptor(
|
||||
'gatt.characteristic_user_description'))
|
||||
.then(descriptor => Object.assign(result, {
|
||||
descriptor,
|
||||
fake_descriptor: result.fake_user_description,
|
||||
}));
|
||||
async function getUserDescriptionDescriptor() {
|
||||
let result = await getMeasurementIntervalCharacteristic();
|
||||
let descriptor = await result.characteristic.getDescriptor(
|
||||
'gatt.characteristic_user_description');
|
||||
return Object.assign(result, {
|
||||
descriptor,
|
||||
fake_descriptor: result.fake_user_description,
|
||||
});
|
||||
}
|
||||
|
|
|
@ -24,12 +24,11 @@ function loadScript(path) {
|
|||
* @returns {Promise<void>} A promise chain that resolves when all scripts have
|
||||
* finished loading.
|
||||
*/
|
||||
function loadScripts(paths) {
|
||||
let chain = Promise.resolve();
|
||||
async function loadScripts(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.
|
||||
* @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.
|
||||
if (typeof Mojo === 'undefined') {
|
||||
return;
|
||||
|
@ -65,27 +64,26 @@ function performChromiumSetup() {
|
|||
'/js-test-resources/bluetooth/bluetooth-fake-adapter.js',
|
||||
];
|
||||
}
|
||||
return loadScripts([
|
||||
`${genPrefix}/layout_test_data/mojo/public/js/mojo_bindings.js`,
|
||||
`${genPrefix}/content/test/data/mojo_web_test_helper_test.mojom.js`,
|
||||
`${genPrefix}/device/bluetooth/public/mojom/uuid.mojom.js`,
|
||||
`${genPrefix}/url/mojom/origin.mojom.js`,
|
||||
`${genPrefix}/device/bluetooth/public/mojom/test/fake_bluetooth.mojom.js`,
|
||||
`${genPrefix}/content/shell/common/web_test/fake_bluetooth_chooser.mojom.js`,
|
||||
`${prefix}/web-bluetooth-test.js`,
|
||||
].concat(extra))
|
||||
// Call setBluetoothFakeAdapter() to clean up any fake adapters left over
|
||||
// by legacy tests.
|
||||
// Legacy tests that use setBluetoothFakeAdapter() sometimes fail to clean
|
||||
// their fake adapter. This is not a problem for these tests because the
|
||||
// next setBluetoothFakeAdapter() will clean it up anyway but it is a
|
||||
// problem for the new tests that do not use setBluetoothFakeAdapter().
|
||||
// TODO(https://crbug.com/569709): Remove once setBluetoothFakeAdapter is
|
||||
// no longer used.
|
||||
.then(
|
||||
() => typeof setBluetoothFakeAdapter === 'undefined' ?
|
||||
undefined :
|
||||
setBluetoothFakeAdapter(''));
|
||||
await loadScripts([
|
||||
`${genPrefix}/layout_test_data/mojo/public/js/mojo_bindings.js`,
|
||||
`${genPrefix}/content/test/data/mojo_web_test_helper_test.mojom.js`,
|
||||
`${genPrefix}/device/bluetooth/public/mojom/uuid.mojom.js`,
|
||||
`${genPrefix}/url/mojom/origin.mojom.js`,
|
||||
`${genPrefix}/device/bluetooth/public/mojom/test/fake_bluetooth.mojom.js`,
|
||||
`${genPrefix}/content/shell/common/web_test/fake_bluetooth_chooser.mojom.js`,
|
||||
`${prefix}/web-bluetooth-test.js`,
|
||||
].concat(extra));
|
||||
|
||||
// Call setBluetoothFakeAdapter() to clean up any fake adapters left over by
|
||||
// legacy tests. Legacy tests that use setBluetoothFakeAdapter() sometimes
|
||||
// fail to clean their fake adapter. This is not a problem for these tests
|
||||
// because the next setBluetoothFakeAdapter() will clean it up anyway but it
|
||||
// is a problem for the new tests that do not use setBluetoothFakeAdapter().
|
||||
// TODO(https://crbug.com/569709): Remove once setBluetoothFakeAdapter is no
|
||||
// longer used.
|
||||
if (typeof setBluetoothFakeAdapter !== 'undefined') {
|
||||
setBluetoothFakeAdapter('');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -99,16 +97,13 @@ function performChromiumSetup() {
|
|||
* rejects if the test failed.
|
||||
*/
|
||||
function bluetooth_test(test_function, name, properties) {
|
||||
Promise.resolve().then(
|
||||
() => promise_test(
|
||||
t => Promise
|
||||
.resolve()
|
||||
// Trigger Chromium-specific setup.
|
||||
.then(performChromiumSetup)
|
||||
.then(() => test_function(t))
|
||||
.then(() => navigator.bluetooth.test.allResponsesConsumed())
|
||||
.then(consumed => assert_true(consumed)),
|
||||
name, properties));
|
||||
return promise_test(async (t) => {
|
||||
// Trigger Chromium-specific setup.
|
||||
await performChromiumSetup();
|
||||
await test_function(t);
|
||||
let consumed = await navigator.bluetooth.test.allResponsesConsumed();
|
||||
assert_true(consumed);
|
||||
}, name, properties);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -138,22 +133,21 @@ function waitForDocumentReady() {
|
|||
* @returns {Promise<*>} Resolves when the user activation has been simulated
|
||||
* with the result of |callback|.
|
||||
*/
|
||||
function callWithTrustedClick(callback) {
|
||||
return waitForDocumentReady().then(() => new Promise(resolve => {
|
||||
let button =
|
||||
document.createElement('button');
|
||||
button.textContent =
|
||||
'click to continue test';
|
||||
button.style.display = 'block';
|
||||
button.style.fontSize = '20px';
|
||||
button.style.padding = '10px';
|
||||
button.onclick = () => {
|
||||
document.body.removeChild(button);
|
||||
resolve(callback());
|
||||
};
|
||||
document.body.appendChild(button);
|
||||
test_driver.click(button);
|
||||
}));
|
||||
async function callWithTrustedClick(callback) {
|
||||
await waitForDocumentReady();
|
||||
return new Promise(resolve => {
|
||||
let button = document.createElement('button');
|
||||
button.textContent = 'click to continue test';
|
||||
button.style.display = 'block';
|
||||
button.style.fontSize = '20px';
|
||||
button.style.padding = '10px';
|
||||
button.onclick = () => {
|
||||
document.body.removeChild(button);
|
||||
resolve(callback());
|
||||
};
|
||||
document.body.appendChild(button);
|
||||
test_driver.click(button);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -356,7 +350,7 @@ function assert_promise_resolves_after_event(
|
|||
* @returns {Promise<void>} Resolves if no events were fired.
|
||||
*/
|
||||
function assert_no_events(object, event_name) {
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise((resolve) => {
|
||||
let event_listener = (e) => {
|
||||
object.removeEventListener(event_name, event_listener);
|
||||
assert_unreached('Object should not fire an event.');
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
{
|
||||
iframe.name = "theiframe";
|
||||
iframe.src =
|
||||
"http://www1.{{host}}/content-security-policy/support/frame.html#0";
|
||||
let iframeLoaded = new Promise(resolve => { iframe.onload = resolve; });
|
||||
"http://www1.{{host}}:{{ports[http][0]}}/content-security-policy/frame-src/support/frame.html?0";
|
||||
let iframeLoaded = new Promise(resolve => { iframe.onload = resolve });
|
||||
document.body.appendChild(iframe);
|
||||
await iframeLoaded;
|
||||
}
|
||||
|
@ -26,10 +26,10 @@
|
|||
// 3. Blocked same-document navigation using iframe.src.
|
||||
{
|
||||
let violation = new Promise(resolve => {
|
||||
window.addEventListener('securitypolicyviolation', resolve);
|
||||
window.addEventListener('securitypolicyviolation', () => resolve());
|
||||
});
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
|||
window.addEventListener('securitypolicyviolation', resolve);
|
||||
});
|
||||
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");
|
||||
await violation;
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
<body></body>
|
||||
<script>
|
||||
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 => {
|
||||
test.done();
|
|
@ -1,5 +1,5 @@
|
|||
// META: title=Cookie Store API: cookieListItem attributes
|
||||
// META: global=!default,serviceworker,window
|
||||
// META: global=window,serviceworker
|
||||
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// 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
|
||||
|
||||
'use strict';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// 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
|
||||
|
||||
'use strict';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// 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
|
||||
|
||||
'use strict';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// META: title=Cookie Store API: cookieStore.delete() arguments
|
||||
// META: global=!default,serviceworker,window
|
||||
// META: global=window,serviceworker
|
||||
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// META: title=Cookie Store API: cookieStore.delete() return type
|
||||
// META: global=!default,serviceworker,window
|
||||
// META: global=window,serviceworker
|
||||
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// META: title=Cookie Store API: cookieStore.delete() with insecure cookies
|
||||
// META: global=!default,serviceworker,window
|
||||
// META: global=window,serviceworker
|
||||
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// META: title=Cookie Store API: cookieStore.getAll() arguments
|
||||
// META: global=!default,serviceworker,window
|
||||
// META: global=window,serviceworker
|
||||
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// META: title=Cookie Store API: cookieStore.getAll() with multiple cookies
|
||||
// META: global=!default,serviceworker,window
|
||||
// META: global=window,serviceworker
|
||||
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// META: title=Cookie Store API: Interaction between cookieStore.set() and cookieStore.getAll()
|
||||
// META: global=!default,serviceworker,window
|
||||
// META: global=window,serviceworker
|
||||
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// META: title=Cookie Store API: cookieStore.get() arguments
|
||||
// META: global=!default,serviceworker,window
|
||||
// META: global=window,serviceworker
|
||||
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// META: title=Cookie Store API: Interaction between cookieStore.set() and cookieStore.delete()
|
||||
// META: global=!default,serviceworker,window
|
||||
// META: global=window,serviceworker
|
||||
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// META: title=Cookie Store API: Interaction between cookieStore.set() and cookieStore.get()
|
||||
// META: global=!default,serviceworker,window
|
||||
// META: global=window,serviceworker
|
||||
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// META: title=Cookie Store API: Cookie ordering
|
||||
// META: global=!default,serviceworker,window
|
||||
// META: global=window,serviceworker
|
||||
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// META: title=Cookie Store API: cookieStore.set() arguments
|
||||
// META: global=!default,serviceworker,window
|
||||
// META: global=window,serviceworker
|
||||
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// 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';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// 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
|
||||
|
||||
'use strict';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// META: title=Cookie Store API: cookie encoding
|
||||
// META: global=!default,serviceworker,window
|
||||
// META: global=window,serviceworker
|
||||
// META: script=resources/cookie-test-helpers.js
|
||||
|
||||
'use strict';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// META: global=!default,serviceworker,window
|
||||
// META: global=window,serviceworker
|
||||
// META: timeout=long
|
||||
// META: script=/resources/WebIDLParser.js
|
||||
// META: script=/resources/idlharness.js
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// META: title=Cookie Store API: cookiechange event in ServiceWorker with mismatched subscription
|
||||
// META: global=!default,serviceworker
|
||||
// META: global=serviceworker
|
||||
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// META: title=Cookie Store API: cookiechange event in ServiceWorker with multiple subscriptions
|
||||
// META: global=!default,serviceworker
|
||||
// META: global=serviceworker
|
||||
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// META: title=Cookie Store API: cookiechange event in ServiceWorker with overlapping subscriptions
|
||||
// META: global=!default,serviceworker
|
||||
// META: global=serviceworker
|
||||
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// META: title=Cookie Store API: cookiechange event in ServiceWorker with single subscription
|
||||
// META: global=!default,serviceworker
|
||||
// META: global=serviceworker
|
||||
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// META: title=Cookie Store API: oncookiechange event in ServiceWorker with single subscription
|
||||
// META: global=!default,serviceworker
|
||||
// META: global=serviceworker
|
||||
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -18,6 +18,20 @@
|
|||
@keyframes animRight {
|
||||
to { right: 100px }
|
||||
}
|
||||
|
||||
@keyframes anim1 {
|
||||
to { left: 100px }
|
||||
}
|
||||
@keyframes anim2 {
|
||||
to { top: 100px }
|
||||
}
|
||||
@keyframes anim3 {
|
||||
to { bottom: 100px }
|
||||
}
|
||||
@keyframes anim4 {
|
||||
to { right: 100px }
|
||||
}
|
||||
|
||||
</style>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
|
@ -285,6 +299,84 @@ test(t => {
|
|||
'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) {
|
||||
test(t => {
|
||||
// Create two divs with the following arrangement:
|
||||
|
@ -327,40 +419,7 @@ function pseudoTest(description, testMarkerPseudos) {
|
|||
}
|
||||
|
||||
const animations = document.getAnimations();
|
||||
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] = 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`
|
||||
);
|
||||
}
|
||||
}
|
||||
pseudoAnimCompare(animations, expectedAnimations)
|
||||
}, description);
|
||||
}
|
||||
|
||||
|
@ -368,5 +427,4 @@ pseudoTest('CSS Animations targetting (pseudo-)elements should have correct '
|
|||
+ 'order after sorting', false);
|
||||
pseudoTest('CSS Animations targetting (pseudo-)elements should have correct '
|
||||
+ 'order after sorting (::marker)', true);
|
||||
|
||||
</script>
|
||||
|
|