diff --git a/tests/wpt/meta-legacy-layout/css/CSS2/linebox/inline-negative-margin-001.html.ini b/tests/wpt/meta-legacy-layout/css/CSS2/linebox/inline-negative-margin-001.html.ini index 5e3a96e5999..a057f038339 100644 --- a/tests/wpt/meta-legacy-layout/css/CSS2/linebox/inline-negative-margin-001.html.ini +++ b/tests/wpt/meta-legacy-layout/css/CSS2/linebox/inline-negative-margin-001.html.ini @@ -8,5 +8,8 @@ [[data-expected-height\] 3] expected: FAIL - [[data-expected-height\] 4] + [[data-expected-height\] 1] + expected: FAIL + + [[data-expected-height\] 2] expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-color/animation/opacity-animation-ending-correctly-001.html.ini b/tests/wpt/meta-legacy-layout/css/css-color/animation/opacity-animation-ending-correctly-001.html.ini new file mode 100644 index 00000000000..304b1579ca4 --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-color/animation/opacity-animation-ending-correctly-001.html.ini @@ -0,0 +1,2 @@ +[opacity-animation-ending-correctly-001.html] + expected: TIMEOUT diff --git a/tests/wpt/meta-legacy-layout/css/css-content/parsing/content-computed.html.ini b/tests/wpt/meta-legacy-layout/css/css-content/parsing/content-computed.html.ini new file mode 100644 index 00000000000..6d5b5bfc0ae --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-content/parsing/content-computed.html.ini @@ -0,0 +1,66 @@ +[content-computed.html] + [Property content value 'open-quote / "alt text"'] + expected: FAIL + + [Property content value 'close-quote / "alt text"'] + expected: FAIL + + [Property content value 'no-open-quote / "alt text"'] + expected: FAIL + + [Property content value 'no-close-quote / "alt text"'] + expected: FAIL + + [Property content value 'counter(counter-name) / "alt text"'] + expected: FAIL + + [Property content value 'counter(counter-name, counter-style)'] + expected: FAIL + + [Property content value 'counter(counter-name, counter-style) / "alt text"'] + expected: FAIL + + [Property content value 'counter(counter-name, dECiMaL) / "alt text"'] + expected: FAIL + + [Property content value 'counter(counter-name, DECIMAL) / "alt text"'] + expected: FAIL + + [Property content value 'counters(counter-name, ".") / "alt text"'] + expected: FAIL + + [Property content value 'counters(counter-name, ".", counter-style)'] + expected: FAIL + + [Property content value 'counters(counter-name, ".", counter-style) / "alt text"'] + expected: FAIL + + [Property content value 'counters(counter-name, ".", dECiMaL) / "alt text"'] + expected: FAIL + + [Property content value 'counters(counter-name, ".", DECIMAL) / "alt text"'] + expected: FAIL + + [Property content value 'url("https://www.example.com/picture.svg") / "alt text"'] + expected: FAIL + + [Property content value '"hello" / "alt text"'] + expected: FAIL + + [Property content value 'counter(counter-name) "potato" / "alt text"'] + expected: FAIL + + [Property content value 'counters(counter-name, ".") "potato" / "alt text"'] + expected: FAIL + + [Property content value '"(" counters(counter-name, ".", counter-style) ")"'] + expected: FAIL + + [Property content value '"(" counters(counter-name, ".", counter-style) ")" / "alt text"'] + expected: FAIL + + [Property content value 'open-quote "hello" "world" close-quote / "alt text"'] + expected: FAIL + + [Property content value 'url("https://www.example.com/picture.svg") "hello" / "alt text"'] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-content/parsing/content-valid.html.ini b/tests/wpt/meta-legacy-layout/css/css-content/parsing/content-valid.html.ini new file mode 100644 index 00000000000..ec3fb653e49 --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-content/parsing/content-valid.html.ini @@ -0,0 +1,216 @@ +[content-valid.html] + [e.style['content'\] = "open-quote / \\"alt text\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "open-quote / \\"alt text\\" attr(foo) \\"bar\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "open-quote / attr(foo)" should set the property value] + expected: FAIL + + [e.style['content'\] = "close-quote / \\"alt text\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "close-quote / \\"alt text\\" attr(foo) \\"bar\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "close-quote / attr(foo)" should set the property value] + expected: FAIL + + [e.style['content'\] = "no-open-quote / \\"alt text\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "no-open-quote / \\"alt text\\" attr(foo) \\"bar\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "no-open-quote / attr(foo)" should set the property value] + expected: FAIL + + [e.style['content'\] = "no-close-quote / \\"alt text\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "no-close-quote / \\"alt text\\" attr(foo) \\"bar\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "no-close-quote / attr(foo)" should set the property value] + expected: FAIL + + [e.style['content'\] = "attr(alt) / \\"alt text\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "attr(alt) / \\"alt text\\" attr(foo) \\"bar\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "attr(alt) / attr(foo)" should set the property value] + expected: FAIL + + [e.style['content'\] = "attr(data-foo) / \\"alt text\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "attr(data-foo) / \\"alt text\\" attr(foo) \\"bar\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "attr(data-foo) / attr(foo)" should set the property value] + expected: FAIL + + [e.style['content'\] = "counter(counter-name) / \\"alt text\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "counter(counter-name) / \\"alt text\\" attr(foo) \\"bar\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "counter(counter-name) / attr(foo)" should set the property value] + expected: FAIL + + [e.style['content'\] = "counter(counter-name, counter-style)" should set the property value] + expected: FAIL + + [e.style['content'\] = "counter(counter-name, counter-style) / \\"alt text\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "counter(counter-name, counter-style) / \\"alt text\\" attr(foo) \\"bar\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "counter(counter-name, counter-style) / attr(foo)" should set the property value] + expected: FAIL + + [e.style['content'\] = "counter(counter-name, dECiMaL) / \\"alt text\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "counter(counter-name, dECiMaL) / \\"alt text\\" attr(foo) \\"bar\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "counter(counter-name, dECiMaL) / attr(foo)" should set the property value] + expected: FAIL + + [e.style['content'\] = "counter(counter-name, DECIMAL) / \\"alt text\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "counter(counter-name, DECIMAL) / \\"alt text\\" attr(foo) \\"bar\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "counter(counter-name, DECIMAL) / attr(foo)" should set the property value] + expected: FAIL + + [e.style['content'\] = "counters(counter-name, \\".\\") / \\"alt text\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "counters(counter-name, \\".\\") / \\"alt text\\" attr(foo) \\"bar\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "counters(counter-name, \\".\\") / attr(foo)" should set the property value] + expected: FAIL + + [e.style['content'\] = "counters(counter-name, \\".\\", counter-style)" should set the property value] + expected: FAIL + + [e.style['content'\] = "counters(counter-name, \\".\\", counter-style) / \\"alt text\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "counters(counter-name, \\".\\", counter-style) / \\"alt text\\" attr(foo) \\"bar\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "counters(counter-name, \\".\\", counter-style) / attr(foo)" should set the property value] + expected: FAIL + + [e.style['content'\] = "counters(counter-name, \\".\\", dECiMaL) / \\"alt text\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "counters(counter-name, \\".\\", dECiMaL) / \\"alt text\\" attr(foo) \\"bar\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "counters(counter-name, \\".\\", dECiMaL) / attr(foo)" should set the property value] + expected: FAIL + + [e.style['content'\] = "counters(counter-name, \\".\\", DECIMAL) / \\"alt text\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "counters(counter-name, \\".\\", DECIMAL) / \\"alt text\\" attr(foo) \\"bar\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "counters(counter-name, \\".\\", DECIMAL) / attr(foo)" should set the property value] + expected: FAIL + + [e.style['content'\] = "url(\\"https://www.example.com/picture.svg\\") / \\"alt text\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "url(\\"https://www.example.com/picture.svg\\") / \\"alt text\\" attr(foo) \\"bar\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "url(\\"https://www.example.com/picture.svg\\") / attr(foo)" should set the property value] + expected: FAIL + + [e.style['content'\] = "\\"hello\\" / \\"alt text\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "\\"hello\\" / \\"alt text\\" attr(foo) \\"bar\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "\\"hello\\" / attr(foo)" should set the property value] + expected: FAIL + + [e.style['content'\] = "\\"hello\\" \\"world\\" / \\"alt text\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "\\"hello\\" \\"world\\" / \\"alt text\\" attr(foo) \\"bar\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "\\"hello\\" \\"world\\" / attr(foo)" should set the property value] + expected: FAIL + + [e.style['content'\] = "\\"hello\\" attr(alt) \\"world\\" / \\"alt text\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "\\"hello\\" attr(alt) \\"world\\" / \\"alt text\\" attr(foo) \\"bar\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "\\"hello\\" attr(alt) \\"world\\" / attr(foo)" should set the property value] + expected: FAIL + + [e.style['content'\] = "counter(counter-name) \\"potato\\" / \\"alt text\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "counter(counter-name) \\"potato\\" / \\"alt text\\" attr(foo) \\"bar\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "counter(counter-name) \\"potato\\" / attr(foo)" should set the property value] + expected: FAIL + + [e.style['content'\] = "counters(counter-name, \\".\\") \\"potato\\" / \\"alt text\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "counters(counter-name, \\".\\") \\"potato\\" / \\"alt text\\" attr(foo) \\"bar\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "counters(counter-name, \\".\\") \\"potato\\" / attr(foo)" should set the property value] + expected: FAIL + + [e.style['content'\] = "\\"(\\" counters(counter-name, \\".\\", counter-style) \\")\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "\\"(\\" counters(counter-name, \\".\\", counter-style) \\")\\" / \\"alt text\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "\\"(\\" counters(counter-name, \\".\\", counter-style) \\")\\" / \\"alt text\\" attr(foo) \\"bar\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "\\"(\\" counters(counter-name, \\".\\", counter-style) \\")\\" / attr(foo)" should set the property value] + expected: FAIL + + [e.style['content'\] = "open-quote \\"hello\\" \\"world\\" close-quote / \\"alt text\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "open-quote \\"hello\\" \\"world\\" close-quote / \\"alt text\\" attr(foo) \\"bar\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "open-quote \\"hello\\" \\"world\\" close-quote / attr(foo)" should set the property value] + expected: FAIL + + [e.style['content'\] = "url(\\"https://www.example.com/picture.svg\\") \\"hello\\" / \\"alt text\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "url(\\"https://www.example.com/picture.svg\\") \\"hello\\" / \\"alt text\\" attr(foo) \\"bar\\"" should set the property value] + expected: FAIL + + [e.style['content'\] = "url(\\"https://www.example.com/picture.svg\\") \\"hello\\" / attr(foo)" should set the property value] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-text/parsing/text-spacing-computed.html.ini b/tests/wpt/meta-legacy-layout/css/css-text/parsing/text-spacing-computed.html.ini index f084a73611d..5aa68b9f2d9 100644 --- a/tests/wpt/meta-legacy-layout/css/css-text/parsing/text-spacing-computed.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-text/parsing/text-spacing-computed.html.ini @@ -34,3 +34,12 @@ [Property text-spacing value 'space-all no-autospace'] expected: FAIL + + [Property text-spacing value 'trim-start'] + expected: FAIL + + [Property text-spacing value 'no-autospace normal'] + expected: FAIL + + [Property text-spacing value 'normal no-autospace'] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-text/parsing/text-spacing-trim-computed.html.ini b/tests/wpt/meta-legacy-layout/css/css-text/parsing/text-spacing-trim-computed.html.ini index 55f43aa1353..5fab60bb026 100644 --- a/tests/wpt/meta-legacy-layout/css/css-text/parsing/text-spacing-trim-computed.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-text/parsing/text-spacing-trim-computed.html.ini @@ -22,3 +22,9 @@ [Property text-spacing-trim value 'space-first allow-end'] expected: FAIL + + [Property text-spacing-trim value 'normal'] + expected: FAIL + + [Property text-spacing-trim value 'trim-start'] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-text/parsing/text-spacing-trim-valid.html.ini b/tests/wpt/meta-legacy-layout/css/css-text/parsing/text-spacing-trim-valid.html.ini index dc325c5f4c5..48ded869ba1 100644 --- a/tests/wpt/meta-legacy-layout/css/css-text/parsing/text-spacing-trim-valid.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-text/parsing/text-spacing-trim-valid.html.ini @@ -22,3 +22,9 @@ [e.style['text-spacing-trim'\] = "space-first allow-end" should set the property value] expected: FAIL + + [e.style['text-spacing-trim'\] = "normal" should set the property value] + expected: FAIL + + [e.style['text-spacing-trim'\] = "trim-start" should set the property value] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-text/parsing/text-spacing-valid.html.ini b/tests/wpt/meta-legacy-layout/css/css-text/parsing/text-spacing-valid.html.ini index 5e2575b4053..7b223b35219 100644 --- a/tests/wpt/meta-legacy-layout/css/css-text/parsing/text-spacing-valid.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-text/parsing/text-spacing-valid.html.ini @@ -34,3 +34,12 @@ [e.style['text-spacing'\] = "space-all no-autospace" should set the property value] expected: FAIL + + [e.style['text-spacing'\] = "trim-start" should set the property value] + expected: FAIL + + [e.style['text-spacing'\] = "no-autospace normal" should set the property value] + expected: FAIL + + [e.style['text-spacing'\] = "normal no-autospace" should set the property value] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-text/text-spacing-trim/text-spacing-trim-space-first-wrap-001.html.ini b/tests/wpt/meta-legacy-layout/css/css-text/text-spacing-trim/text-spacing-trim-space-first-wrap-001.html.ini new file mode 100644 index 00000000000..bad56becd0b --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-text/text-spacing-trim/text-spacing-trim-space-first-wrap-001.html.ini @@ -0,0 +1,11 @@ +[text-spacing-trim-space-first-wrap-001.html?class=chws,vrl] + expected: FAIL + +[text-spacing-trim-space-first-wrap-001.html?class=halt,htb] + expected: FAIL + +[text-spacing-trim-space-first-wrap-001.html?class=chws,htb] + expected: FAIL + +[text-spacing-trim-space-first-wrap-001.html?class=halt,vrl] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-text/text-spacing-trim/text-spacing-trim-space-first-wrap-br-001.html.ini b/tests/wpt/meta-legacy-layout/css/css-text/text-spacing-trim/text-spacing-trim-space-first-wrap-br-001.html.ini new file mode 100644 index 00000000000..8c8ff980a52 --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-text/text-spacing-trim/text-spacing-trim-space-first-wrap-br-001.html.ini @@ -0,0 +1,11 @@ +[text-spacing-trim-space-first-wrap-br-001.html?class=halt,htb] + expected: FAIL + +[text-spacing-trim-space-first-wrap-br-001.html?class=chws,vrl] + expected: FAIL + +[text-spacing-trim-space-first-wrap-br-001.html?class=halt,vrl] + expected: FAIL + +[text-spacing-trim-space-first-wrap-br-001.html?class=chws,htb] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-text/text-spacing-trim/text-spacing-trim-wrap-001.html.ini b/tests/wpt/meta-legacy-layout/css/css-text/text-spacing-trim/text-spacing-trim-wrap-001.html.ini deleted file mode 100644 index 98b57ffa091..00000000000 --- a/tests/wpt/meta-legacy-layout/css/css-text/text-spacing-trim/text-spacing-trim-wrap-001.html.ini +++ /dev/null @@ -1,11 +0,0 @@ -[text-spacing-trim-wrap-001.html?class=chws,vrl] - expected: FAIL - -[text-spacing-trim-wrap-001.html?class=halt,vrl] - expected: FAIL - -[text-spacing-trim-wrap-001.html?class=halt,htb] - expected: FAIL - -[text-spacing-trim-wrap-001.html?class=chws,htb] - expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-text/white-space/trailing-other-space-separators-break-spaces-008.html.ini b/tests/wpt/meta-legacy-layout/css/css-text/white-space/trailing-other-space-separators-break-spaces-008.html.ini new file mode 100644 index 00000000000..f6bf6aa789e --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-text/white-space/trailing-other-space-separators-break-spaces-008.html.ini @@ -0,0 +1,2 @@ +[trailing-other-space-separators-break-spaces-008.html] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/css-transitions/render-blocking/no-transition-from-ua-to-blocking-stylesheet.html.ini b/tests/wpt/meta-legacy-layout/css/css-transitions/render-blocking/no-transition-from-ua-to-blocking-stylesheet.html.ini new file mode 100644 index 00000000000..e35a452a186 --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/css-transitions/render-blocking/no-transition-from-ua-to-blocking-stylesheet.html.ini @@ -0,0 +1,2 @@ +[no-transition-from-ua-to-blocking-stylesheet.html] + expected: TIMEOUT diff --git a/tests/wpt/meta-legacy-layout/css/css-values/progress-computed.tentative.html.ini b/tests/wpt/meta-legacy-layout/css/css-values/progress-computed.tentative.html.ini index 441914bc0c4..a08341d7a0f 100644 --- a/tests/wpt/meta-legacy-layout/css/css-values/progress-computed.tentative.html.ini +++ b/tests/wpt/meta-legacy-layout/css/css-values/progress-computed.tentative.html.ini @@ -52,3 +52,6 @@ [calc(progress(sign(1001em - 10lh * progress(100px from 2rex to 10ex)) * 20em from 2rem to 12em) * 4) should be used-value-equivalent to 8] expected: FAIL + + [calc(progress(sign(1001em - 10lh * progress(100px from 2rex to 10ex)) * 20em from 2rem to 12em) * 2) should be used-value-equivalent to 4] + expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini b/tests/wpt/meta-legacy-layout/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini index 314dca9c1f5..d52a3e77a70 100644 --- a/tests/wpt/meta-legacy-layout/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini +++ b/tests/wpt/meta-legacy-layout/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini @@ -1,3 +1,6 @@ [MediaQueryList-addListener-removeListener.html] [listeners are called when ") + + await bidi_session.browsing_context.navigate( + context=top_context["context"], url=page_url, wait="complete" + ) + + contexts = await bidi_session.browsing_context.get_tree(root=top_context["context"]) + iframe_context = contexts[0]["children"][0] + + result = await bidi_session.browsing_context.locate_nodes( + context=iframe_context["context"], + locator={"type": "css", "value": "#in-iframe"} + ) + + expected = [ + { + "type": "node", + "sharedId": any_string, + "value": { + "attributes": {"id": "in-iframe"}, + "childNodeCount": 1, + "localName": "div", + "namespaceURI": "http://www.w3.org/1999/xhtml", + "nodeType": 1, + } + } + ] + + recursive_compare(expected, result["nodes"]) diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/locate_nodes/invalid.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/locate_nodes/invalid.py index d549cf35de2..ff00de91ed0 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/locate_nodes/invalid.py +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/locate_nodes/invalid.py @@ -1,6 +1,8 @@ import pytest import webdriver.bidi.error as error +from webdriver.bidi.modules.script import ContextTarget + pytestmark = pytest.mark.asyncio @@ -47,7 +49,6 @@ async def test_params_locator_type_invalid_value(bidi_session, inline, top_conte @pytest.mark.parametrize("type,value", [ ("css", "a*b"), ("xpath", ""), - ("xpath", "invalid-xpath") ("innerText", "") ]) async def test_params_locator_value_invalid_value(bidi_session, inline, top_context, type, value): @@ -59,6 +60,15 @@ async def test_params_locator_value_invalid_value(bidi_session, inline, top_cont ) +async def test_params_locator_xpath_unknown_error(bidi_session, inline, top_context): + await navigate_to_page(bidi_session, inline, top_context) + + with pytest.raises(error.UnknownErrorException): + await bidi_session.browsing_context.locate_nodes( + context=top_context["context"], locator={"type": "xpath", "value": "/foo:bar"} + ) + + @pytest.mark.parametrize("value", [False, "string", 1.5, {}, []]) async def test_params_max_node_count_invalid_type(bidi_session, inline, top_context, value): await navigate_to_page(bidi_session, inline, top_context) @@ -148,6 +158,71 @@ async def test_params_start_nodes_empty_list(bidi_session, inline, top_context): with pytest.raises(error.InvalidArgumentException): await bidi_session.browsing_context.locate_nodes( context=top_context["context"], - locator={ "type": "invalid", "value": "div" }, + locator={ "type": "css", "value": "div" }, start_nodes=[] ) + + +@pytest.mark.parametrize( + "value", + [ + {"type": "number", "value": 3}, + {"type": "window"}, + {"type": "array", "value": ["test"]}, + { + "type": "object", + "value": [ + ["1", {"type": "string", "value": "foo"}], + ], + }, + ], +) +async def test_params_start_nodes_not_dom_node( + bidi_session, inline, top_context, value +): + await navigate_to_page(bidi_session, inline, top_context) + + if value["type"] == "window": + value["value"] = top_context["context"] + + with pytest.raises(error.InvalidArgumentException): + await bidi_session.browsing_context.locate_nodes( + context=top_context["context"], + locator={"type": "css", "value": "div"}, + start_nodes=[value], + ) + + +@pytest.mark.parametrize( + "expression", + [ + "document.querySelector('input#button').attributes[0]", + "document.querySelector('#with-text-node').childNodes[0]", + """document.createProcessingInstruction("xml-stylesheet", "href='foo.css'")""", + "document.querySelector('#with-comment').childNodes[0]", + "document.doctype", + "document.getElementsByTagName('div')", + "document.querySelectorAll('div')" + ], +) +async def test_params_start_nodes_dom_node_not_element( + bidi_session, inline, top_context, get_test_page, expression +): + await navigate_to_page(bidi_session, inline, top_context) + + await bidi_session.browsing_context.navigate( + context=top_context['context'], url=get_test_page(), wait="complete" + ) + + remote_reference = await bidi_session.script.evaluate( + expression=expression, + await_promise=False, + target=ContextTarget(top_context["context"]), + ) + + with pytest.raises(error.InvalidArgumentException): + await bidi_session.browsing_context.locate_nodes( + context=top_context["context"], + locator={"type": "css", "value": "div"}, + start_nodes=[remote_reference], + ) diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/locate_nodes/max_node_count.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/locate_nodes/max_node_count.py index 9147fb31832..4652026e96f 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/locate_nodes/max_node_count.py +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/locate_nodes/max_node_count.py @@ -3,7 +3,7 @@ import pytest from ... import any_string, recursive_compare -@pytest.mark.parametrize("type,value,max,expected", [ +@pytest.mark.parametrize("type,value,max_count,expected", [ ("css", "div", 1, [ { "type": "node", @@ -124,7 +124,7 @@ from ... import any_string, recursive_compare "inner_text_multiple" ]) @pytest.mark.asyncio -async def test_find_by_css_limit_return_count(bidi_session, inline, top_context, type, value, max_count, expected): +async def test_find_by_locator_limit_return_count(bidi_session, inline, top_context, type, value, max_count, expected): url = inline("""
foo
foo
""") await bidi_session.browsing_context.navigate( context=top_context["context"], url=url, wait="complete" @@ -137,3 +137,45 @@ async def test_find_by_css_limit_return_count(bidi_session, inline, top_context, ) recursive_compare(expected, result["nodes"]) + + +@pytest.mark.asyncio +async def test_several_context_nodes(bidi_session, inline, top_context): + url = inline( + """ +
+
should be returned
+
+
+
should not be returned
+
should not be returned
+
should not be returned
+
should not be returned
+
should not be returned
+
should not be returned
+
should not be returned
+
should not be returned
+
should not be returned
+
+ """ + ) + await bidi_session.browsing_context.navigate( + context=top_context["context"], url=url, wait="complete" + ) + + result_context_nodes = await bidi_session.browsing_context.locate_nodes( + context=top_context["context"], + locator={"type": "css", "value": ".context-node"}, + ) + + result = await bidi_session.browsing_context.locate_nodes( + context=top_context["context"], + locator={"type": "css", "value": "div"}, + max_node_count=1, + start_nodes=[ + {"sharedId": result_context_nodes["nodes"][0]["sharedId"]}, + {"sharedId": result_context_nodes["nodes"][1]["sharedId"]}, + ], + ) + + assert len(result["nodes"]) == 1 diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/locate_nodes/ownership.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/locate_nodes/ownership.py index d5450ffc80c..b1830c740a9 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/locate_nodes/ownership.py +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/locate_nodes/ownership.py @@ -1,6 +1,6 @@ import pytest -from webdriver.bidi.modules.script import assert_handle +from ... import assert_handle @pytest.mark.parametrize("ownership,has_handle", [ @@ -20,7 +20,7 @@ async def test_root_ownership_of_located_nodes(bidi_session, inline, top_context ownership=ownership ) - assert result["nodes"].length == 1 + assert len(result["nodes"]) == 1 result_node = result["nodes"][0] assert_handle(result_node, has_handle) diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/locate_nodes/sandbox.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/locate_nodes/sandbox.py index 7f9cd9dfd85..efa431bf190 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/locate_nodes/sandbox.py +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/locate_nodes/sandbox.py @@ -22,7 +22,7 @@ async def test_locate_nodes_in_sandbox(bidi_session, inline, top_context): # Since the node was found in the sandbox, it should be available # to scripts running in the sandbox. result_in_sandbox = await bidi_session.script.call_function( - function_declaration="() => arguments[0]", + function_declaration="function(){ return arguments[0]; }", target=ContextTarget(top_context["context"], "sandbox"), await_promise=True, arguments=[ @@ -48,7 +48,6 @@ async def test_locate_same_node_in_different_sandboxes_returns_same_id(bidi_sess sandbox="first_sandbox" ) - assert first_result["context"] == top_context["context"] assert len(first_result["nodes"]) == 1 second_result = await bidi_session.browsing_context.locate_nodes( @@ -94,18 +93,17 @@ async def test_locate_same_node_in_different_sandboxes_with_root_ownership_retur first_result = await bidi_session.browsing_context.locate_nodes( context=top_context["context"], locator={ "type": "css", "value": "div[data-class='one']" }, - sandbox="first_sandbox", - ownership=OwnershipModel.ROOT + ownership=OwnershipModel.ROOT.value, + sandbox="first_sandbox" ) - assert first_result["context"] == top_context["context"] assert len(first_result["nodes"]) == 1 second_result = await bidi_session.browsing_context.locate_nodes( context=top_context["context"], locator={ "type": "css", "value": "div[data-class='one']" }, - sandbox="second_sandbox", - ownership=OwnershipModel.ROOT + ownership=OwnershipModel.ROOT.value, + sandbox="second_sandbox" ) assert len(second_result["nodes"]) == 1 diff --git a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/locate_nodes/start_nodes.py b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/locate_nodes/start_nodes.py index 3f46a50642c..707d83a337d 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/browsing_context/locate_nodes/start_nodes.py +++ b/tests/wpt/tests/webdriver/tests/bidi/browsing_context/locate_nodes/start_nodes.py @@ -4,38 +4,14 @@ from webdriver.bidi.modules.script import ContextTarget from ... import any_string, recursive_compare -@pytest.mark.parametrize("type,value", [ - ("css", "div"), - ("xpath", "//div"), - ("innerText", "foo") -]) -@pytest.mark.asyncio -async def test_locate_with_context_nodes(bidi_session, inline, top_context, type, value): - url = inline("""

foo
foo

""") - await bidi_session.browsing_context.navigate( - context=top_context["context"], url=url, wait="complete" - ) - - context_nodes = await bidi_session.script.evaluate( - expression="""document.querySelector("p")""", - target=ContextTarget(top_context["context"]), - await_promise=True, - ) - - result = await bidi_session.browsing_context.locate_nodes( - context=top_context["context"], - locator={ "type": type, "value": value }, - start_nodes=[context_nodes] - ) - - expected = [ - { +@pytest.mark.parametrize("type,value,expected", [ + ("css", "p", [{ "type": "node", "sharedId": any_string, "value": { "attributes": {"data-class":"one"}, "childNodeCount": 1, - "localName": "div", + "localName": "p", "namespaceURI": "http://www.w3.org/1999/xhtml", "nodeType": 1, } @@ -46,33 +22,123 @@ async def test_locate_with_context_nodes(bidi_session, inline, top_context, type "value": { "attributes": {"data-class":"two"}, "childNodeCount": 1, - "localName": "div", + "localName": "p", "namespaceURI": "http://www.w3.org/1999/xhtml", "nodeType": 1, } - } - ] + }]), + ("css", "a span", [{ + "type": "node", + "sharedId": any_string, + "value": { + "attributes": {"id":"text"}, + "childNodeCount": 1, + "localName": "span", + "namespaceURI": "http://www.w3.org/1999/xhtml", + "nodeType": 1, + } + }]), + ("css", "#text", [{ + "type": "node", + "sharedId": any_string, + "value": { + "attributes": {"id":"text"}, + "childNodeCount": 1, + "localName": "span", + "namespaceURI": "http://www.w3.org/1999/xhtml", + "nodeType": 1, + } + }]), + ("xpath", "//p", [{ + "type": "node", + "sharedId": any_string, + "value": { + "attributes": {"data-class":"one"}, + "childNodeCount": 1, + "localName": "p", + "namespaceURI": "http://www.w3.org/1999/xhtml", + "nodeType": 1, + } + }, + { + "type": "node", + "sharedId": any_string, + "value": { + "attributes": {"data-class":"two"}, + "childNodeCount": 1, + "localName": "p", + "namespaceURI": "http://www.w3.org/1999/xhtml", + "nodeType": 1, + } + }]), + ("innerText", "foo", [{ + "type": "node", + "sharedId": any_string, + "value": { + "attributes": {"data-class":"one"}, + "childNodeCount": 1, + "localName": "p", + "namespaceURI": "http://www.w3.org/1999/xhtml", + "nodeType": 1, + } + }, + { + "type": "node", + "sharedId": any_string, + "value": { + "attributes": {"data-class":"two"}, + "childNodeCount": 1, + "localName": "p", + "namespaceURI": "http://www.w3.org/1999/xhtml", + "nodeType": 1, + } + }]) +]) +@pytest.mark.asyncio +async def test_locate_with_context_nodes(bidi_session, inline, top_context, type, value, expected): + url = inline("""
+

foo

+

foo

+ + bar + +
""") + await bidi_session.browsing_context.navigate( + context=top_context["context"], url=url, wait="complete" + ) + + context_nodes = await bidi_session.script.evaluate( + expression="""document.querySelector("div")""", + target=ContextTarget(top_context["context"]), + await_promise=True, + ) + + result = await bidi_session.browsing_context.locate_nodes( + context=top_context["context"], + locator={ "type": type, "value": value }, + start_nodes=[context_nodes] + ) recursive_compare(expected, result["nodes"]) @pytest.mark.parametrize("type,value", [ - ("css", "div[data-class='one']"), - ("xpath", ".//div[@data-class='one']"), + ("css", "p[data-class='one']"), + ("xpath", ".//p[@data-class='one']"), ("innerText", "foo") ]) @pytest.mark.asyncio async def test_locate_with_multiple_context_nodes(bidi_session, inline, top_context, type, value): url = inline(""" -

foo
bar

-

foo
bar

+

foo

bar

+

foo

bar

""") await bidi_session.browsing_context.navigate( context=top_context["context"], url=url, wait="complete" ) script_result = await bidi_session.script.evaluate( - expression="""document.querySelectorAll("p")""", + expression="""document.querySelectorAll("div")""", target=ContextTarget(top_context["context"]), await_promise=True, ) @@ -92,7 +158,7 @@ async def test_locate_with_multiple_context_nodes(bidi_session, inline, top_cont "value": { "attributes": {"data-class":"one"}, "childNodeCount": 1, - "localName": "div", + "localName": "p", "namespaceURI": "http://www.w3.org/1999/xhtml", "nodeType": 1, } @@ -103,7 +169,7 @@ async def test_locate_with_multiple_context_nodes(bidi_session, inline, top_cont "value": { "attributes": {"data-class":"one"}, "childNodeCount": 1, - "localName": "div", + "localName": "p", "namespaceURI": "http://www.w3.org/1999/xhtml", "nodeType": 1, } diff --git a/tests/wpt/tests/webdriver/tests/bidi/network/conftest.py b/tests/wpt/tests/webdriver/tests/bidi/network/conftest.py index fb6dcc45dd7..184073a53ab 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/network/conftest.py +++ b/tests/wpt/tests/webdriver/tests/bidi/network/conftest.py @@ -33,7 +33,7 @@ async def add_intercept(bidi_session): for intercept in intercepts: try: await bidi_session.network.remove_intercept(intercept=intercept) - except (NoSuchInterceptException): + except NoSuchInterceptException: # Ignore exceptions in case a specific intercept was already removed # during the test. pass @@ -44,7 +44,10 @@ def fetch(bidi_session, top_context, configuration): """Perform a fetch from the page of the provided context, default to the top context. """ - async def fetch(url, method="GET", headers=None, context=top_context, timeout_in_seconds=3): + + async def fetch( + url, method="GET", headers=None, context=top_context, timeout_in_seconds=3 + ): method_arg = f"method: '{method}'," headers_arg = "" @@ -76,7 +79,12 @@ def fetch(bidi_session, top_context, configuration): @pytest_asyncio.fixture async def setup_network_test( - bidi_session, subscribe_events, wait_for_event, wait_for_future_safe, top_context, url + bidi_session, + subscribe_events, + wait_for_event, + wait_for_future_safe, + top_context, + url, ): """Navigate the current top level context to the provided url and subscribe to network.beforeRequestSent. @@ -131,12 +139,26 @@ async def setup_network_test( async def setup_blocked_request( setup_network_test, url, add_intercept, fetch, wait_for_event ): - async def setup_blocked_request(phase): + """Creates an intercept for the provided phase, sends a fetch request that + should be blocked by this intercept and resolves when the corresponding + event is received. + + For the "authRequired" phase, the request will be sent to the authentication + http handler. The optional arguments username, password and realm can be used + to configure the handler. + + Returns the `request` id of the intercepted request. + """ + + async def setup_blocked_request( + phase, username="user", password="password", realm="test" + ): await setup_network_test(events=[f"network.{phase}"]) if phase == "authRequired": blocked_url = url( - "/webdriver/tests/support/http_handlers/authentication.py?realm=testrealm" + "/webdriver/tests/support/http_handlers/authentication.py?" + f"username={username}&password={password}&realm={realm}" ) else: blocked_url = url(PAGE_EMPTY_TEXT) diff --git a/tests/wpt/tests/webdriver/tests/bidi/network/continue_with_auth/action.py b/tests/wpt/tests/webdriver/tests/bidi/network/continue_with_auth/action.py new file mode 100644 index 00000000000..a122ce0e492 --- /dev/null +++ b/tests/wpt/tests/webdriver/tests/bidi/network/continue_with_auth/action.py @@ -0,0 +1,148 @@ +import pytest +import webdriver.bidi.error as error +from webdriver.bidi.modules.network import AuthCredentials +from webdriver.error import TimeoutException + +from tests.support.sync import AsyncPoll +from .. import ( + assert_response_event, + AUTH_REQUIRED_EVENT, + PAGE_EMPTY_TEXT, + RESPONSE_COMPLETED_EVENT, +) + +pytestmark = pytest.mark.asyncio + + +async def test_cancel( + setup_blocked_request, subscribe_events, wait_for_event, bidi_session, url +): + request = await setup_blocked_request("authRequired") + await subscribe_events(events=[RESPONSE_COMPLETED_EVENT]) + + on_response_completed = wait_for_event(RESPONSE_COMPLETED_EVENT) + await bidi_session.network.continue_with_auth(request=request, action="cancel") + await on_response_completed + + response_event = await on_response_completed + assert_response_event( + response_event, + expected_response={ + "status": 401, + "statusText": "Unauthorized", + }, + ) + + +async def test_default( + setup_blocked_request, subscribe_events, wait_for_event, bidi_session, url +): + request = await setup_blocked_request("authRequired") + + # Additionally subscribe to all network events + await subscribe_events(events=["network"]) + + # Track all received network.responseCompleted events in the events array + events = [] + + async def on_event(method, data): + events.append(data) + + remove_listener = bidi_session.add_event_listener( + RESPONSE_COMPLETED_EVENT, on_event + ) + + # continueWithAuth using action "default" should show the authentication + # prompt and no new network event should be generated. + await bidi_session.network.continue_with_auth(request=request, action="default") + + wait = AsyncPoll(bidi_session, timeout=0.5) + with pytest.raises(TimeoutException): + await wait.until(lambda _: len(events) > 0) + + remove_listener() + + +async def test_provideCredentials( + setup_blocked_request, subscribe_events, bidi_session, url +): + # Setup unique username / password because browsers cache credentials. + username = "test_provideCredentials" + password = "test_provideCredentials_password" + request = await setup_blocked_request("authRequired", username=username, password=password) + + # Additionally subscribe to network.responseCompleted + await subscribe_events(events=[RESPONSE_COMPLETED_EVENT]) + + # Track all received network.responseCompleted events in the events array + events = [] + + async def on_event(method, data): + events.append(data) + + remove_listener = bidi_session.add_event_listener( + RESPONSE_COMPLETED_EVENT, on_event + ) + + credentials = AuthCredentials(username=username, password=password) + await bidi_session.network.continue_with_auth( + request=request, action="provideCredentials", credentials=credentials + ) + + # TODO: At the moment, the specification does not expect to receive a + # responseCompleted event for each authentication attempt, so only assert + # the last event. See https://github.com/w3c/webdriver-bidi/issues/627 + + # Wait until a a responseCompleted event with status 200 OK is received. + wait = AsyncPoll(bidi_session, message="Didn't receive response completed events") + await wait.until(lambda _: len(events) > 0 and events[-1]["response"]["status"] == 200) + + remove_listener() + + +async def test_provideCredentials_wrong_credentials( + setup_blocked_request, subscribe_events, bidi_session, wait_for_event, url +): + # Setup unique username / password because browsers cache credentials. + username = "test_provideCredentials_wrong_credentials" + password = "test_provideCredentials_wrong_credentials_password" + request = await setup_blocked_request("authRequired", username=username, password=password) + + # Additionally subscribe to network.responseCompleted + await subscribe_events(events=[RESPONSE_COMPLETED_EVENT]) + + # Track all received network.responseCompleted events in the events array + events = [] + + async def on_event(method, data): + events.append(data) + + remove_listener = bidi_session.add_event_listener( + RESPONSE_COMPLETED_EVENT, on_event + ) + + on_auth_required = wait_for_event(AUTH_REQUIRED_EVENT) + + wrong_credentials = AuthCredentials(username=username, password="wrong_password") + await bidi_session.network.continue_with_auth( + request=request, action="provideCredentials", credentials=wrong_credentials + ) + + # We expect to get another authRequired event after providing wrong credentials + await on_auth_required + + # Continue with the correct credentials + correct_credentials = AuthCredentials(username=username, password=password) + await bidi_session.network.continue_with_auth( + request=request, action="provideCredentials", credentials=correct_credentials + ) + + # TODO: At the moment, the specification does not expect to receive a + # responseCompleted event for each authentication attempt, so only assert + # the last event. See https://github.com/w3c/webdriver-bidi/issues/627 + + # Wait until a a responseCompleted event with status 200 OK is received. + wait = AsyncPoll(bidi_session, message="Didn't receive response completed events") + await wait.until(lambda _: len(events) > 0 and events[-1]["response"]["status"] == 200) + + remove_listener() diff --git a/tests/wpt/tests/webdriver/tests/bidi/network/continue_with_auth/invalid.py b/tests/wpt/tests/webdriver/tests/bidi/network/continue_with_auth/invalid.py index ea188cbde88..dc21d0bc53c 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/network/continue_with_auth/invalid.py +++ b/tests/wpt/tests/webdriver/tests/bidi/network/continue_with_auth/invalid.py @@ -46,6 +46,46 @@ async def test_params_request_no_such_request( await bidi_session.network.continue_with_auth(request=request, action="cancel") +async def test_params_request_no_such_request_after_cancel( + setup_blocked_request, bidi_session, subscribe_events, wait_for_event +): + request = await setup_blocked_request("authRequired") + + await subscribe_events(events=[RESPONSE_COMPLETED_EVENT]) + on_response_completed = wait_for_event(RESPONSE_COMPLETED_EVENT) + + await bidi_session.network.continue_with_auth(request=request, action="cancel") + await on_response_completed + + with pytest.raises(error.NoSuchRequestException): + await bidi_session.network.continue_with_auth(request=request, action="cancel") + + +async def test_params_request_no_such_request_after_provideCredentials( + setup_blocked_request, bidi_session, subscribe_events, wait_for_event +): + # Setup unique username / password because browsers cache credentials. + username = "test_params_request_no_such_request_after_provideCredentials" + password = "test_params_request_no_such_request_after_provideCredentials_password" + request = await setup_blocked_request("authRequired", username=username, password=password) + + await subscribe_events(events=[RESPONSE_COMPLETED_EVENT]) + on_response_completed = wait_for_event(RESPONSE_COMPLETED_EVENT) + + credentials = { + "type": "password", + "username": username, + "password": password, + } + await bidi_session.network.continue_with_auth( + request=request, action="provideCredentials", credentials=credentials + ) + await on_response_completed + + with pytest.raises(error.NoSuchRequestException): + await bidi_session.network.continue_with_auth(request=request, action="cancel") + + @pytest.mark.parametrize("value", [None, False, 42, {}, []]) async def test_params_action_invalid_type(setup_blocked_request, bidi_session, value): request = await setup_blocked_request("authRequired") diff --git a/tests/wpt/tests/webdriver/tests/bidi/script/__init__.py b/tests/wpt/tests/webdriver/tests/bidi/script/__init__.py index 0f62fe44756..7feae91f27b 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/script/__init__.py +++ b/tests/wpt/tests/webdriver/tests/bidi/script/__init__.py @@ -5,26 +5,6 @@ from webdriver.bidi.modules.script import ContextTarget from .. import any_int, any_string, recursive_compare -def assert_handle(obj: Mapping[str, Any], should_contain_handle: bool) -> None: - if should_contain_handle: - assert "handle" in obj, f"Result should contain `handle`. Actual: {obj}" - assert isinstance(obj["handle"], str), f"`handle` should be a string, but was {type(obj['handle'])}" - - # Recursively check that handle is not found in any of the nested values. - if "value" in obj: - value = obj["value"] - if type(value) is list: - for v in value: - assert_handle(v, False) - - if type(value) is dict: - for v in value.values(): - assert_handle(v, False) - - else: - assert "handle" not in obj, f"Result should not contain `handle`. Actual: {obj}" - - def specific_error_response(expected_error: Mapping[str, Any]) -> Callable[[Any], None]: return lambda actual: recursive_compare( { diff --git a/tests/wpt/tests/webdriver/tests/bidi/script/call_function/result_ownership.py b/tests/wpt/tests/webdriver/tests/bidi/script/call_function/result_ownership.py index 84b8f776b45..6a96f87ad10 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/script/call_function/result_ownership.py +++ b/tests/wpt/tests/webdriver/tests/bidi/script/call_function/result_ownership.py @@ -1,7 +1,7 @@ import pytest from webdriver.bidi.modules.script import ContextTarget, ScriptEvaluateResultException -from .. import assert_handle +from ... import assert_handle @pytest.mark.asyncio diff --git a/tests/wpt/tests/webdriver/tests/bidi/script/disown/handles.py b/tests/wpt/tests/webdriver/tests/bidi/script/disown/handles.py index e1226463a5c..1dfa318cd18 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/script/disown/handles.py +++ b/tests/wpt/tests/webdriver/tests/bidi/script/disown/handles.py @@ -4,7 +4,7 @@ import webdriver.bidi.error as error from webdriver.bidi.modules.script import ContextTarget -from .. import assert_handle +from ... import assert_handle pytestmark = pytest.mark.asyncio diff --git a/tests/wpt/tests/webdriver/tests/bidi/script/disown/target.py b/tests/wpt/tests/webdriver/tests/bidi/script/disown/target.py index 67d857a0414..bce956d06be 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/script/disown/target.py +++ b/tests/wpt/tests/webdriver/tests/bidi/script/disown/target.py @@ -4,7 +4,7 @@ import webdriver.bidi.error as error from webdriver.bidi.modules.script import ContextTarget, RealmTarget -from .. import assert_handle +from ... import assert_handle pytestmark = pytest.mark.asyncio diff --git a/tests/wpt/tests/webdriver/tests/bidi/script/evaluate/result_ownership.py b/tests/wpt/tests/webdriver/tests/bidi/script/evaluate/result_ownership.py index ab018699eb9..4a417532afb 100644 --- a/tests/wpt/tests/webdriver/tests/bidi/script/evaluate/result_ownership.py +++ b/tests/wpt/tests/webdriver/tests/bidi/script/evaluate/result_ownership.py @@ -1,7 +1,7 @@ import pytest from webdriver.bidi.modules.script import ContextTarget, ScriptEvaluateResultException -from .. import assert_handle +from ... import assert_handle @pytest.mark.asyncio diff --git a/tests/wpt/tests/webdriver/tests/classic/element_send_keys/send_keys.py b/tests/wpt/tests/webdriver/tests/classic/element_send_keys/send_keys.py index 92002f29457..7b25d65a1b1 100644 --- a/tests/wpt/tests/webdriver/tests/classic/element_send_keys/send_keys.py +++ b/tests/wpt/tests/webdriver/tests/classic/element_send_keys/send_keys.py @@ -119,3 +119,14 @@ def test_invalid_text_type(session, inline, value): response = element_send_keys(session, element, value) assert_error(response, "invalid argument") + + +def test_surrogates(session, inline): + session.url = inline("") + element = session.find.css("input", all=False) + + text = "🦥🍄" + response = element_send_keys(session, element, text) + assert_success(response) + + assert element.property("value") == text diff --git a/tests/wpt/tests/webdriver/tests/support/http_handlers/authentication.py b/tests/wpt/tests/webdriver/tests/support/http_handlers/authentication.py index d3c95a948f0..2526a5a4c2c 100644 --- a/tests/wpt/tests/webdriver/tests/support/http_handlers/authentication.py +++ b/tests/wpt/tests/webdriver/tests/support/http_handlers/authentication.py @@ -10,10 +10,18 @@ def basic_authentication(url, **kwargs): def main(request, response): - user = request.auth.username + username = request.auth.username password = request.auth.password - if user == b"user" and password == b"password": + expected_username = "user" + if b"username" in request.GET: + expected_username = request.GET.first(b"username") + + expected_password = "password" + if b"password" in request.GET: + expected_password = request.GET.first(b"password") + + if username == expected_username and password == expected_password: return b"Authentication done" realm = b"test" @@ -22,4 +30,4 @@ def main(request, response): return ((401, b"Unauthorized"), [(b"WWW-Authenticate", b'Basic realm="' + realm + b'"')], - b"Please login with credentials 'user' and 'password'") + f"Please login with credentials '{expected_username}' and '{expected_password}'") diff --git a/tests/wpt/tests/webhid/WEB_FEATURES.yml b/tests/wpt/tests/webhid/WEB_FEATURES.yml new file mode 100644 index 00000000000..7453658f782 --- /dev/null +++ b/tests/wpt/tests/webhid/WEB_FEATURES.yml @@ -0,0 +1,3 @@ +features: +- name: webhid + files: "**" diff --git a/tests/wpt/tests/webmessaging/broadcastchannel/WEB_FEATURES.yml b/tests/wpt/tests/webmessaging/broadcastchannel/WEB_FEATURES.yml new file mode 100644 index 00000000000..378ed57dc52 --- /dev/null +++ b/tests/wpt/tests/webmessaging/broadcastchannel/WEB_FEATURES.yml @@ -0,0 +1,3 @@ +features: +- name: broadcast-channel + files: "**" diff --git a/tests/wpt/tests/webnn/arg_min_max.https.any.js b/tests/wpt/tests/webnn/arg_min_max.https.any.js new file mode 100644 index 00000000000..cff1d6a955c --- /dev/null +++ b/tests/wpt/tests/webnn/arg_min_max.https.any.js @@ -0,0 +1,10 @@ +// META: title=test WebNN API argMin/Max operations +// META: global=window,dedicatedworker +// META: script=./resources/utils.js +// META: timeout=long + +'use strict'; + +// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-argminmax + +testWebNNOperation(['argMin', 'argMax'], buildOperationWithSingleInput); \ No newline at end of file diff --git a/tests/wpt/tests/webnn/gpu/arg_min_max.https.any.js b/tests/wpt/tests/webnn/gpu/arg_min_max.https.any.js new file mode 100644 index 00000000000..76092ea92e6 --- /dev/null +++ b/tests/wpt/tests/webnn/gpu/arg_min_max.https.any.js @@ -0,0 +1,10 @@ +// META: title=test WebNN API argMin/Max operations +// META: global=window,dedicatedworker +// META: script=../resources/utils.js +// META: timeout=long + +'use strict'; + +// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-argminmax + +testWebNNOperation(['argMin', 'argMax'], buildOperationWithSingleInput, 'gpu'); \ No newline at end of file diff --git a/tests/wpt/tests/webnn/resources/test_data/arg_max.json b/tests/wpt/tests/webnn/resources/test_data/arg_max.json new file mode 100644 index 00000000000..9af47a95894 --- /dev/null +++ b/tests/wpt/tests/webnn/resources/test_data/arg_max.json @@ -0,0 +1,919 @@ +{ + "tests": [ + { + "name": "argMax float32 1D tensor default options", + "inputs": { + "input": { + "shape": [24], + "data": [ + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955, + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [], + "data": [ + 3 + ], + "type": "int64" + } + }, + { + "name": "argMax float32 2D tensor default options", + "inputs": { + "input": { + "shape": [4, 6], + "data": [ + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955, + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [], + "data": [ + 3 + ], + "type": "int64" + } + }, + { + "name": "argMax float32 3D tensor default options", + "inputs": { + "input": { + "shape": [2, 3, 4], + "data": [ + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955, + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [], + "data": [ + 3 + ], + "type": "int64" + } + }, + { + "name": "argMax float32 4D tensor default options", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955, + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [], + "data": [ + 3 + ], + "type": "int64" + } + }, + { + "name": "argMax float32 5D tensor default options", + "inputs": { + "input": { + "shape": [2, 1, 4, 1, 3], + "data": [ + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955, + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [], + "data": [ + 3 + ], + "type": "int64" + } + }, + { + "name": "argMax float32 4D tensor options.axes=[2]", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955, + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955 + ], + "type": "float32" + } + }, + "options": { + "axes": [2] + }, + "expected": { + "name": "output", + "shape": [2, 1, 3], + "data": [ + 1, + 2, + 2, + 1, + 2, + 2 + ], + "type": "int64" + } + }, + { + "name": "argMax float32 4D tensor options.axes=[]", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955, + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955 + ], + "type": "float32" + } + }, + "options": { + "axes": [] + }, + "expected": { + "name": "output", + "shape": [2, 1, 4, 3], + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "type": "int64" + } + }, + { + "name": "argMax float32 4D tensor options.keepDimensions=true", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955, + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955 + ], + "type": "float32" + } + }, + "options": { + "keepDimensions": true + }, + "expected": { + "name": "output", + "shape": [1, 1, 1, 1], + "data": [ + 3 + ], + "type": "int64" + } + }, + { + "name": "argMax float32 4D tensor options.keepDimensions=false", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955, + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955 + ], + "type": "float32" + } + }, + "options": { + "keepDimensions": true + }, + "expected": { + "name": "output", + "shape": [], + "data": [ + 3 + ], + "type": "int64" + } + }, + { + "name": "argMax float32 4D tensor options.selectLastIndex=true", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955, + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955 + ], + "type": "float32" + } + }, + "options": { + "selectLastIndex": true + }, + "expected": { + "name": "output", + "shape": [], + "data": [ + 20 + ], + "type": "int64" + } + }, + { + "name": "argMax float32 4D tensor options.selectLastIndex=false", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955, + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955 + ], + "type": "float32" + } + }, + "options": { + "selectLastIndex": false + }, + "expected": { + "name": "output", + "shape": [], + "data": [ + 3 + ], + "type": "int64" + } + }, + { + "name": "argMax float32 4D tensor options.axes=[0, 2] options.keepDimensions=false", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955, + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955 + ], + "type": "float32" + } + }, + "options": { + "axes": [0, 2], + "keepDimensions": false + }, + "expected": { + "name": "output", + "shape": [1, 3], + "data": [ + 1, + 2, + 2 + ], + "type": "int64" + } + }, + { + "name": "argMax float32 4D tensor options.axes=[3, 0, 1] options.keepDimensions=true", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955, + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955 + ], + "type": "float32" + } + }, + "options": { + "axes": [3, 0, 1], + "keepDimensions": true + }, + "expected": { + "name": "output", + "shape": [1, 1, 4, 1], + "data": [ + 2, + 0, + 2, + 1 + ], + "type": "int64" + } + }, + { + "name": "argMax float32 4D tensor options.axes=[0, 2] options.selectLastIndex=false", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955, + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955 + ], + "type": "float32" + } + }, + "options": { + "axes": [0, 2], + "selectLastIndex": false + }, + "expected": { + "name": "output", + "shape": [1, 3], + "data": [ + 1, + 2, + 2 + ], + "type": "int64" + } + }, + { + "name": "argMax float32 4D tensor options.axes=[0, 2] options.selectLastIndex=true", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955, + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955 + ], + "type": "float32" + } + }, + "options": { + "axes": [0, 2], + "selectLastIndex": true + }, + "expected": { + "name": "output", + "shape": [1, 3], + "data": [ + 5, + 6, + 6 + ], + "type": "int64" + } + }, + { + "name": "argMax float32 4D tensor options.axes=[3, 0, 1] options.selectLastIndex=false", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955, + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955 + ], + "type": "float32" + } + }, + "options": { + "axes": [3, 0, 1], + "selectLastIndex": false + }, + "expected": { + "name": "output", + "shape": [4], + "data": [ + 2, + 0, + 2, + 1 + ], + "type": "int64" + } + }, + { + "name": "argMax float32 4D tensor options.axes=[3, 0, 1] options.selectLastIndex=true", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955, + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955 + ], + "type": "float32" + } + }, + "options": { + "axes": [3, 0, 1], + "selectLastIndex": true + }, + "expected": { + "name": "output", + "shape": [4], + "data": [ + 5, + 3, + 5, + 4 + ], + "type": "int64" + } + }, + { + "name": "argMax float32 4D tensor all options", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955, + -51.0936194154457, + -6.5397018645619625, + 73.81338015899149, + 88.46114630531724, + -5.294266751122791, + -79.20668057325759, + -41.70176598864654, + 73.81338015899149, + 88.46114630531724, + -84.939998758247, + -61.488942502520906, + -98.33874402761955 + ], + "type": "float32" + } + }, + "options": { + "axes": [3, 0], + "keepDimensions": true, + "selectLastIndex": false + }, + "expected": { + "name": "output", + "shape": [1, 1, 4, 1], + "data": [ + 2, + 0, + 2, + 1 + ], + "type": "int64" + } + }, + { + "name": "argMax float32 0D scalar options.axes=[]", + "inputs": { + "input": { + "shape": [], + "data": [ + -51.0936194154457 + ], + "type": "float32" + } + }, + "options": { + "axes": [] + }, + "expected": { + "name": "output", + "shape": [], + "data": [ + 0 + ], + "type": "int64" + } + }, + { + "name": "argMax float32 0D scalar options.axes=[] no effect by both keepDimensions and selectLastIndex being true", + "inputs": { + "input": { + "shape": [], + "data": [ + -51.0936194154457 + ], + "type": "float32" + } + }, + "options": { + "axes": [], + "keepDimensions": true, + "selectLastIndex": true + }, + "expected": { + "name": "output", + "shape": [], + "data": [ + 0 + ], + "type": "int64" + } + } + ] +} \ No newline at end of file diff --git a/tests/wpt/tests/webnn/resources/test_data/arg_min.json b/tests/wpt/tests/webnn/resources/test_data/arg_min.json new file mode 100644 index 00000000000..dc0b5cdfd1a --- /dev/null +++ b/tests/wpt/tests/webnn/resources/test_data/arg_min.json @@ -0,0 +1,919 @@ +{ + "tests": [ + { + "name": "argMin float32 1D tensor default options", + "inputs": { + "input": { + "shape": [24], + "data": [ + 3.830124090690262, + -24.986487937638074, + 5.299982630691289, + -48.5486590218902, + 40.30886781808215, + 60.184293919409726, + -82.78385618759043, + -96.50904103637833, + 71.87028201591897, + 38.866394268784035, + -39.143725517854435, + 31.444366685561903, + -82.78385618759043, + -96.50904103637833, + -25.53388886326502, + -16.142265850469343, + 66.63677406472371, + 82.5119815304117, + -82.78385618759043, + -96.50904103637833, + 39.7687246127592, + 42.15040238450999, + 82.66863662444459, + 85.4526923278379 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [], + "data": [ + 7 + ], + "type": "int64" + } + }, + { + "name": "argMin float32 2D tensor default options", + "inputs": { + "input": { + "shape": [4, 6], + "data": [ + 3.830124090690262, + -24.986487937638074, + 5.299982630691289, + -48.5486590218902, + 40.30886781808215, + 60.184293919409726, + -82.78385618759043, + -96.50904103637833, + 71.87028201591897, + 38.866394268784035, + -39.143725517854435, + 31.444366685561903, + -82.78385618759043, + -96.50904103637833, + -25.53388886326502, + -16.142265850469343, + 66.63677406472371, + 82.5119815304117, + -82.78385618759043, + -96.50904103637833, + 39.7687246127592, + 42.15040238450999, + 82.66863662444459, + 85.4526923278379 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [], + "data": [ + 7 + ], + "type": "int64" + } + }, + { + "name": "argMin float32 3D tensor default options", + "inputs": { + "input": { + "shape": [2, 3, 4], + "data": [ + 3.830124090690262, + -24.986487937638074, + 5.299982630691289, + -48.5486590218902, + 40.30886781808215, + 60.184293919409726, + -82.78385618759043, + -96.50904103637833, + 71.87028201591897, + 38.866394268784035, + -39.143725517854435, + 31.444366685561903, + -82.78385618759043, + -96.50904103637833, + -25.53388886326502, + -16.142265850469343, + 66.63677406472371, + 82.5119815304117, + -82.78385618759043, + -96.50904103637833, + 39.7687246127592, + 42.15040238450999, + 82.66863662444459, + 85.4526923278379 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [], + "data": [ + 7 + ], + "type": "int64" + } + }, + { + "name": "argMin float32 4D tensor default options", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + 3.830124090690262, + -24.986487937638074, + 5.299982630691289, + -48.5486590218902, + 40.30886781808215, + 60.184293919409726, + -82.78385618759043, + -96.50904103637833, + 71.87028201591897, + 38.866394268784035, + -39.143725517854435, + 31.444366685561903, + -82.78385618759043, + -96.50904103637833, + -25.53388886326502, + -16.142265850469343, + 66.63677406472371, + 82.5119815304117, + -82.78385618759043, + -96.50904103637833, + 39.7687246127592, + 42.15040238450999, + 82.66863662444459, + 85.4526923278379 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [], + "data": [ + 7 + ], + "type": "int64" + } + }, + { + "name": "argMin float32 5D tensor default options", + "inputs": { + "input": { + "shape": [2, 1, 4, 1, 3], + "data": [ + 3.830124090690262, + -24.986487937638074, + 5.299982630691289, + -48.5486590218902, + 40.30886781808215, + 60.184293919409726, + -82.78385618759043, + -96.50904103637833, + 71.87028201591897, + 38.866394268784035, + -39.143725517854435, + 31.444366685561903, + -82.78385618759043, + -96.50904103637833, + -25.53388886326502, + -16.142265850469343, + 66.63677406472371, + 82.5119815304117, + -82.78385618759043, + -96.50904103637833, + 39.7687246127592, + 42.15040238450999, + 82.66863662444459, + 85.4526923278379 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [], + "data": [ + 7 + ], + "type": "int64" + } + }, + { + "name": "argMin float32 4D tensor options.axes=[2]", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + 3.830124090690262, + -24.986487937638074, + 5.299982630691289, + -48.5486590218902, + 40.30886781808215, + 60.184293919409726, + -82.78385618759043, + -96.50904103637833, + 71.87028201591897, + 38.866394268784035, + -39.143725517854435, + 31.444366685561903, + -82.78385618759043, + -96.50904103637833, + -25.53388886326502, + -16.142265850469343, + 66.63677406472371, + 82.5119815304117, + -82.78385618759043, + -96.50904103637833, + 39.7687246127592, + 42.15040238450999, + 82.66863662444459, + 85.4526923278379 + ], + "type": "float32" + } + }, + "options": { + "axes": [2] + }, + "expected": { + "name": "output", + "shape": [2, 1, 3], + "data": [ + 2, + 2, + 0, + 0, + 0, + 0 + ], + "type": "int64" + } + }, + { + "name": "argMin float32 4D tensor options.axes=[]", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + 3.830124090690262, + -24.986487937638074, + 5.299982630691289, + -48.5486590218902, + 40.30886781808215, + 60.184293919409726, + -82.78385618759043, + -96.50904103637833, + 71.87028201591897, + 38.866394268784035, + -39.143725517854435, + 31.444366685561903, + -82.78385618759043, + -96.50904103637833, + -25.53388886326502, + -16.142265850469343, + 66.63677406472371, + 82.5119815304117, + -82.78385618759043, + -96.50904103637833, + 39.7687246127592, + 42.15040238450999, + 82.66863662444459, + 85.4526923278379 + ], + "type": "float32" + } + }, + "options": { + "axes": [] + }, + "expected": { + "name": "output", + "shape": [2, 1, 4, 3], + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "type": "int64" + } + }, + { + "name": "argMin float32 4D tensor options.keepDimensions=true", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + 3.830124090690262, + -24.986487937638074, + 5.299982630691289, + -48.5486590218902, + 40.30886781808215, + 60.184293919409726, + -82.78385618759043, + -96.50904103637833, + 71.87028201591897, + 38.866394268784035, + -39.143725517854435, + 31.444366685561903, + -82.78385618759043, + -96.50904103637833, + -25.53388886326502, + -16.142265850469343, + 66.63677406472371, + 82.5119815304117, + -82.78385618759043, + -96.50904103637833, + 39.7687246127592, + 42.15040238450999, + 82.66863662444459, + 85.4526923278379 + ], + "type": "float32" + } + }, + "options": { + "keepDimensions": true + }, + "expected": { + "name": "output", + "shape": [1, 1, 1, 1], + "data": [ + 7 + ], + "type": "int64" + } + }, + { + "name": "argMin float32 4D tensor options.keepDimensions=false", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + 3.830124090690262, + -24.986487937638074, + 5.299982630691289, + -48.5486590218902, + 40.30886781808215, + 60.184293919409726, + -82.78385618759043, + -96.50904103637833, + 71.87028201591897, + 38.866394268784035, + -39.143725517854435, + 31.444366685561903, + -82.78385618759043, + -96.50904103637833, + -25.53388886326502, + -16.142265850469343, + 66.63677406472371, + 82.5119815304117, + -82.78385618759043, + -96.50904103637833, + 39.7687246127592, + 42.15040238450999, + 82.66863662444459, + 85.4526923278379 + ], + "type": "float32" + } + }, + "options": { + "keepDimensions": true + }, + "expected": { + "name": "output", + "shape": [], + "data": [ + 7 + ], + "type": "int64" + } + }, + { + "name": "argMin float32 4D tensor options.selectLastIndex=true", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + 3.830124090690262, + -24.986487937638074, + 5.299982630691289, + -48.5486590218902, + 40.30886781808215, + 60.184293919409726, + -82.78385618759043, + -96.50904103637833, + 71.87028201591897, + 38.866394268784035, + -39.143725517854435, + 31.444366685561903, + -82.78385618759043, + -96.50904103637833, + -25.53388886326502, + -16.142265850469343, + 66.63677406472371, + 82.5119815304117, + -82.78385618759043, + -96.50904103637833, + 39.7687246127592, + 42.15040238450999, + 82.66863662444459, + 85.4526923278379 + ], + "type": "float32" + } + }, + "options": { + "selectLastIndex": true + }, + "expected": { + "name": "output", + "shape": [], + "data": [ + 19 + ], + "type": "int64" + } + }, + { + "name": "argMin float32 4D tensor options.selectLastIndex=false", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + 3.830124090690262, + -24.986487937638074, + 5.299982630691289, + -48.5486590218902, + 40.30886781808215, + 60.184293919409726, + -82.78385618759043, + -96.50904103637833, + 71.87028201591897, + 38.866394268784035, + -39.143725517854435, + 31.444366685561903, + -82.78385618759043, + -96.50904103637833, + -25.53388886326502, + -16.142265850469343, + 66.63677406472371, + 82.5119815304117, + -82.78385618759043, + -96.50904103637833, + 39.7687246127592, + 42.15040238450999, + 82.66863662444459, + 85.4526923278379 + ], + "type": "float32" + } + }, + "options": { + "selectLastIndex": false + }, + "expected": { + "name": "output", + "shape": [], + "data": [ + 7 + ], + "type": "int64" + } + }, + { + "name": "argMin float32 4D tensor options.axes=[0, 2] options.keepDimensions=false", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + 3.830124090690262, + -24.986487937638074, + 5.299982630691289, + -48.5486590218902, + 40.30886781808215, + 60.184293919409726, + -82.78385618759043, + -96.50904103637833, + 71.87028201591897, + 38.866394268784035, + -39.143725517854435, + 31.444366685561903, + -82.78385618759043, + -96.50904103637833, + -25.53388886326502, + -16.142265850469343, + 66.63677406472371, + 82.5119815304117, + -82.78385618759043, + -96.50904103637833, + 39.7687246127592, + 42.15040238450999, + 82.66863662444459, + 85.4526923278379 + ], + "type": "float32" + } + }, + "options": { + "axes": [0, 2], + "keepDimensions": false + }, + "expected": { + "name": "output", + "shape": [1, 3], + "data": [ + 2, + 2, + 4 + ], + "type": "int64" + } + }, + { + "name": "argMin float32 4D tensor options.axes=[3, 0, 1] options.keepDimensions=true", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + 3.830124090690262, + -24.986487937638074, + 5.299982630691289, + -48.5486590218902, + 40.30886781808215, + 60.184293919409726, + -82.78385618759043, + -96.50904103637833, + 71.87028201591897, + 38.866394268784035, + -39.143725517854435, + 31.444366685561903, + -82.78385618759043, + -96.50904103637833, + -25.53388886326502, + -16.142265850469343, + 66.63677406472371, + 82.5119815304117, + -82.78385618759043, + -96.50904103637833, + 39.7687246127592, + 42.15040238450999, + 82.66863662444459, + 85.4526923278379 + ], + "type": "float32" + } + }, + "options": { + "axes": [3, 0, 1], + "keepDimensions": true + }, + "expected": { + "name": "output", + "shape": [1, 1, 4, 1], + "data": [ + 4, + 0, + 1, + 1 + ], + "type": "int64" + } + }, + { + "name": "argMin float32 4D tensor options.axes=[0, 2] options.selectLastIndex=false", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + 3.830124090690262, + -24.986487937638074, + 5.299982630691289, + -48.5486590218902, + 40.30886781808215, + 60.184293919409726, + -82.78385618759043, + -96.50904103637833, + 71.87028201591897, + 38.866394268784035, + -39.143725517854435, + 31.444366685561903, + -82.78385618759043, + -96.50904103637833, + -25.53388886326502, + -16.142265850469343, + 66.63677406472371, + 82.5119815304117, + -82.78385618759043, + -96.50904103637833, + 39.7687246127592, + 42.15040238450999, + 82.66863662444459, + 85.4526923278379 + ], + "type": "float32" + } + }, + "options": { + "axes": [0, 2], + "selectLastIndex": false + }, + "expected": { + "name": "output", + "shape": [1, 3], + "data": [ + 2, + 2, + 4 + ], + "type": "int64" + } + }, + { + "name": "argMin float32 4D tensor options.axes=[0, 2] options.selectLastIndex=true", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + 3.830124090690262, + -24.986487937638074, + 5.299982630691289, + -48.5486590218902, + 40.30886781808215, + 60.184293919409726, + -82.78385618759043, + -96.50904103637833, + 71.87028201591897, + 38.866394268784035, + -39.143725517854435, + 31.444366685561903, + -82.78385618759043, + -96.50904103637833, + -25.53388886326502, + -16.142265850469343, + 66.63677406472371, + 82.5119815304117, + -82.78385618759043, + -96.50904103637833, + 39.7687246127592, + 42.15040238450999, + 82.66863662444459, + 85.4526923278379 + ], + "type": "float32" + } + }, + "options": { + "axes": [0, 2], + "selectLastIndex": true + }, + "expected": { + "name": "output", + "shape": [1, 3], + "data": [ + 6, + 6, + 4 + ], + "type": "int64" + } + }, + { + "name": "argMin float32 4D tensor options.axes=[3, 0, 1] options.selectLastIndex=false", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + 3.830124090690262, + -24.986487937638074, + 5.299982630691289, + -48.5486590218902, + 40.30886781808215, + 60.184293919409726, + -82.78385618759043, + -96.50904103637833, + 71.87028201591897, + 38.866394268784035, + -39.143725517854435, + 31.444366685561903, + -82.78385618759043, + -96.50904103637833, + -25.53388886326502, + -16.142265850469343, + 66.63677406472371, + 82.5119815304117, + -82.78385618759043, + -96.50904103637833, + 39.7687246127592, + 42.15040238450999, + 82.66863662444459, + 85.4526923278379 + ], + "type": "float32" + } + }, + "options": { + "axes": [3, 0, 1], + "selectLastIndex": false + }, + "expected": { + "name": "output", + "shape": [4], + "data": [ + 4, + 0, + 1, + 1 + ], + "type": "int64" + } + }, + { + "name": "argMin float32 4D tensor options.axes=[3, 0, 1] options.selectLastIndex=true", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + 3.830124090690262, + -24.986487937638074, + 5.299982630691289, + -48.5486590218902, + 40.30886781808215, + 60.184293919409726, + -82.78385618759043, + -96.50904103637833, + 71.87028201591897, + 38.866394268784035, + -39.143725517854435, + 31.444366685561903, + -82.78385618759043, + -96.50904103637833, + -25.53388886326502, + -16.142265850469343, + 66.63677406472371, + 82.5119815304117, + -82.78385618759043, + -96.50904103637833, + 39.7687246127592, + 42.15040238450999, + 82.66863662444459, + 85.4526923278379 + ], + "type": "float32" + } + }, + "options": { + "axes": [3, 0, 1], + "selectLastIndex": true + }, + "expected": { + "name": "output", + "shape": [4], + "data": [ + 4, + 0, + 4, + 1 + ], + "type": "int64" + } + }, + { + "name": "argMin float32 4D tensor all options", + "inputs": { + "input": { + "shape": [2, 1, 4, 3], + "data": [ + 3.830124090690262, + -24.986487937638074, + 5.299982630691289, + -48.5486590218902, + 40.30886781808215, + 60.184293919409726, + -82.78385618759043, + -96.50904103637833, + 71.87028201591897, + 38.866394268784035, + -39.143725517854435, + 31.444366685561903, + -82.78385618759043, + -96.50904103637833, + -25.53388886326502, + -16.142265850469343, + 66.63677406472371, + 82.5119815304117, + -82.78385618759043, + -96.50904103637833, + 39.7687246127592, + 42.15040238450999, + 82.66863662444459, + 85.4526923278379 + ], + "type": "float32" + } + }, + "options": { + "axes": [3, 0], + "keepDimensions": true, + "selectLastIndex": false + }, + "expected": { + "name": "output", + "shape": [1, 1, 4, 1], + "data": [ + 4, + 0, + 1, + 1 + ], + "type": "int64" + } + }, + { + "name": "argMin float32 0D scalar options.axes=[]", + "inputs": { + "input": { + "shape": [], + "data": [ + 3.830124090690262 + ], + "type": "float32" + } + }, + "options": { + "axes": [] + }, + "expected": { + "name": "output", + "shape": [], + "data": [ + 0 + ], + "type": "int64" + } + }, + { + "name": "argMin float32 0D scalar options.axes=[] no effect by both keepDimensions and selectLastIndex being true", + "inputs": { + "input": { + "shape": [], + "data": [ + 3.830124090690262 + ], + "type": "float32" + } + }, + "options": { + "axes": [], + "keepDimensions": true, + "selectLastIndex": true + }, + "expected": { + "name": "output", + "shape": [], + "data": [ + 0 + ], + "type": "int64" + } + } + ] +} \ No newline at end of file diff --git a/tests/wpt/tests/webnn/resources/test_data/expand.json b/tests/wpt/tests/webnn/resources/test_data/expand.json new file mode 100644 index 00000000000..be56ca14890 --- /dev/null +++ b/tests/wpt/tests/webnn/resources/test_data/expand.json @@ -0,0 +1,949 @@ +{ + "tests": [ + { + "name": "expand float32 0D scalar to 1D", + "inputs": { + "input": { + "shape": [], + "data": [ + -6.461850643157959 + ], + "type": "float32" + } + }, + "newShape": [24], + "expected": { + "name": "output", + "shape": [24], + "data": [ + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959 + ], + "type": "float32" + } + }, + { + "name": "expand float32 0D scalar to 2D", + "inputs": { + "input": { + "shape": [], + "data": [ + -6.461850643157959 + ], + "type": "float32" + } + }, + "newShape": [4, 6], + "expected": { + "name": "output", + "shape": [4, 6], + "data": [ + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959 + ], + "type": "float32" + } + }, + { + "name": "expand float32 0D scalar to 3D", + "inputs": { + "input": { + "shape": [], + "data": [ + -6.461850643157959 + ], + "type": "float32" + } + }, + "newShape": [2, 3, 4], + "expected": { + "name": "output", + "shape": [2, 3, 4], + "data": [ + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959 + ], + "type": "float32" + } + }, + { + "name": "expand float32 0D scalar to 4D", + "inputs": { + "input": { + "shape": [], + "data": [ + -6.461850643157959 + ], + "type": "float32" + } + }, + "newShape": [2, 2, 2, 3], + "expected": { + "name": "output", + "shape": [2, 2, 2, 3], + "data": [ + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959 + ], + "type": "float32" + } + }, + { + "name": "expand float32 0D scalar to 5D", + "inputs": { + "input": { + "shape": [], + "data": [ + -6.461850643157959 + ], + "type": "float32" + } + }, + "newShape": [2, 2, 3, 1, 2], + "expected": { + "name": "output", + "shape": [2, 2, 3, 1, 2], + "data": [ + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959 + ], + "type": "float32" + } + }, + { + "name": "expand float32 1D tensor to 1D", + "inputs": { + "input": { + "shape": [1], + "data": [ + -6.461850643157959 + ], + "type": "float32" + } + }, + "newShape": [24], + "expected": { + "name": "output", + "shape": [24], + "data": [ + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959 + ], + "type": "float32" + } + }, + { + "name": "expand float32 1D tensor to 2D", + "inputs": { + "input": { + "shape": [1], + "data": [ + -6.461850643157959 + ], + "type": "float32" + } + }, + "newShape": [4, 6], + "expected": { + "name": "output", + "shape": [4, 6], + "data": [ + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959 + ], + "type": "float32" + } + }, + { + "name": "expand float32 1D tensor to 3D", + "inputs": { + "input": { + "shape": [1], + "data": [ + -6.461850643157959 + ], + "type": "float32" + } + }, + "newShape": [2, 3, 4], + "expected": { + "name": "output", + "shape": [2, 3, 4], + "data": [ + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959 + ], + "type": "float32" + } + }, + { + "name": "expand float32 1D tensor to 4D", + "inputs": { + "input": { + "shape": [1], + "data": [ + -6.461850643157959 + ], + "type": "float32" + } + }, + "newShape": [2, 2, 2, 3], + "expected": { + "name": "output", + "shape": [2, 2, 2, 3], + "data": [ + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959 + ], + "type": "float32" + } + }, + { + "name": "expand float32 1D tensor to 5D", + "inputs": { + "input": { + "shape": [1], + "data": [ + -6.461850643157959 + ], + "type": "float32" + } + }, + "newShape": [2, 2, 3, 1, 2], + "expected": { + "name": "output", + "shape": [2, 2, 3, 1, 2], + "data": [ + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959 + ], + "type": "float32" + } + }, + { + "name": "expand float32 2D tensor to 2D (1st dimension)", + "inputs": { + "input": { + "shape": [1, 6], + "data": [ + 10.898762702941895, + -29.391416549682617, + -73.74250793457031, + 22.456905364990234, + -97.5792465209961, + -76.95013427734375 + ], + "type": "float32" + } + }, + "newShape": [4, 6], + "expected": { + "name": "output", + "shape": [4, 6], + "data": [ + 10.898762702941895, + -29.391416549682617, + -73.74250793457031, + 22.456905364990234, + -97.5792465209961, + -76.95013427734375, + 10.898762702941895, + -29.391416549682617, + -73.74250793457031, + 22.456905364990234, + -97.5792465209961, + -76.95013427734375, + 10.898762702941895, + -29.391416549682617, + -73.74250793457031, + 22.456905364990234, + -97.5792465209961, + -76.95013427734375, + 10.898762702941895, + -29.391416549682617, + -73.74250793457031, + 22.456905364990234, + -97.5792465209961, + -76.95013427734375 + ], + "type": "float32" + } + }, + { + "name": "expand float32 2D tensor to 2D (2nd dimension)", + "inputs": { + "input": { + "shape": [4, 1], + "data": [ + 4.965915679931641, + 66.14382934570312, + 75.28175354003906, + 49.998130798339844 + ], + "type": "float32" + } + }, + "newShape": [4, 6], + "expected": { + "name": "output", + "shape": [4, 6], + "data": [ + 4.965915679931641, + 4.965915679931641, + 4.965915679931641, + 4.965915679931641, + 4.965915679931641, + 4.965915679931641, + 66.14382934570312, + 66.14382934570312, + 66.14382934570312, + 66.14382934570312, + 66.14382934570312, + 66.14382934570312, + 75.28175354003906, + 75.28175354003906, + 75.28175354003906, + 75.28175354003906, + 75.28175354003906, + 75.28175354003906, + 49.998130798339844, + 49.998130798339844, + 49.998130798339844, + 49.998130798339844, + 49.998130798339844, + 49.998130798339844 + ], + "type": "float32" + } + }, + { + "name": "expand float32 2D tensor to 2D (all dimensions)", + "inputs": { + "input": { + "shape": [1, 1], + "data": [ + -6.461850643157959 + ], + "type": "float32" + } + }, + "newShape": [4, 6], + "expected": { + "name": "output", + "shape": [4, 6], + "data": [ + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959 + ], + "type": "float32" + } + }, + { + "name": "expand float32 2D tensor to 3D", + "inputs": { + "input": { + "shape": [4, 1], + "data": [ + 4.965915679931641, + 66.14382934570312, + 75.28175354003906, + 49.998130798339844 + ], + "type": "float32" + } + }, + "newShape": [2, 4, 3], + "expected": { + "name": "output", + "shape": [2, 4, 3], + "data": [ + 4.965915679931641, + 4.965915679931641, + 4.965915679931641, + 66.14382934570312, + 66.14382934570312, + 66.14382934570312, + 75.28175354003906, + 75.28175354003906, + 75.28175354003906, + 49.998130798339844, + 49.998130798339844, + 49.998130798339844, + 4.965915679931641, + 4.965915679931641, + 4.965915679931641, + 66.14382934570312, + 66.14382934570312, + 66.14382934570312, + 75.28175354003906, + 75.28175354003906, + 75.28175354003906, + 49.998130798339844, + 49.998130798339844, + 49.998130798339844 + ], + "type": "float32" + } + }, + { + "name": "expand float32 2D tensor to 4D", + "inputs": { + "input": { + "shape": [1, 6], + "data": [ + 10.898762702941895, + -29.391416549682617, + -73.74250793457031, + 22.456905364990234, + -97.5792465209961, + -76.95013427734375 + ], + "type": "float32" + } + }, + "newShape": [2, 1, 2, 6], + "expected": { + "name": "output", + "shape": [2, 1, 2, 6], + "data": [ + 10.898762702941895, + -29.391416549682617, + -73.74250793457031, + 22.456905364990234, + -97.5792465209961, + -76.95013427734375, + 10.898762702941895, + -29.391416549682617, + -73.74250793457031, + 22.456905364990234, + -97.5792465209961, + -76.95013427734375, + 10.898762702941895, + -29.391416549682617, + -73.74250793457031, + 22.456905364990234, + -97.5792465209961, + -76.95013427734375, + 10.898762702941895, + -29.391416549682617, + -73.74250793457031, + 22.456905364990234, + -97.5792465209961, + -76.95013427734375 + ], + "type": "float32" + } + }, + { + "name": "expand float32 2D tensor to 5D", + "inputs": { + "input": { + "shape": [1, 1], + "data": [ + -6.461850643157959 + ], + "type": "float32" + } + }, + "newShape": [2, 1, 3, 2, 2], + "expected": { + "name": "output", + "shape": [2, 1, 3, 2, 2], + "data": [ + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959, + -6.461850643157959 + ], + "type": "float32" + } + }, + { + "name": "expand float32 3D tensor to 3D", + "inputs": { + "input": { + "shape": [1, 2, 1], + "data": [ + 21.694129943847656, + -72.82571411132812 + ], + "type": "float32" + } + }, + "newShape": [2, 2, 6], + "expected": { + "name": "output", + "shape": [2, 2, 6], + "data": [ + 21.694129943847656, + 21.694129943847656, + 21.694129943847656, + 21.694129943847656, + 21.694129943847656, + 21.694129943847656, + -72.82571411132812, + -72.82571411132812, + -72.82571411132812, + -72.82571411132812, + -72.82571411132812, + -72.82571411132812, + 21.694129943847656, + 21.694129943847656, + 21.694129943847656, + 21.694129943847656, + 21.694129943847656, + 21.694129943847656, + -72.82571411132812, + -72.82571411132812, + -72.82571411132812, + -72.82571411132812, + -72.82571411132812, + -72.82571411132812 + ], + "type": "float32" + } + }, + { + "name": "expand float32 3D tensor to 4D", + "inputs": { + "input": { + "shape": [1, 2, 1], + "data": [ + 21.694129943847656, + -72.82571411132812 + ], + "type": "float32" + } + }, + "newShape": [2, 2, 2, 3], + "expected": { + "name": "output", + "shape": [2, 2, 2, 3], + "data": [ + 21.694129943847656, + 21.694129943847656, + 21.694129943847656, + -72.82571411132812, + -72.82571411132812, + -72.82571411132812, + 21.694129943847656, + 21.694129943847656, + 21.694129943847656, + -72.82571411132812, + -72.82571411132812, + -72.82571411132812, + 21.694129943847656, + 21.694129943847656, + 21.694129943847656, + -72.82571411132812, + -72.82571411132812, + -72.82571411132812, + 21.694129943847656, + 21.694129943847656, + 21.694129943847656, + -72.82571411132812, + -72.82571411132812, + -72.82571411132812 + ], + "type": "float32" + } + }, + { + "name": "expand float32 3D tensor to 5D", + "inputs": { + "input": { + "shape": [1, 2, 1], + "data": [ + 21.694129943847656, + -72.82571411132812 + ], + "type": "float32" + } + }, + "newShape": [2, 1, 2, 2, 3], + "expected": { + "name": "output", + "shape": [2, 1, 2, 2, 3], + "data": [ + 21.694129943847656, + 21.694129943847656, + 21.694129943847656, + -72.82571411132812, + -72.82571411132812, + -72.82571411132812, + 21.694129943847656, + 21.694129943847656, + 21.694129943847656, + -72.82571411132812, + -72.82571411132812, + -72.82571411132812, + 21.694129943847656, + 21.694129943847656, + 21.694129943847656, + -72.82571411132812, + -72.82571411132812, + -72.82571411132812, + 21.694129943847656, + 21.694129943847656, + 21.694129943847656, + -72.82571411132812, + -72.82571411132812, + -72.82571411132812 + ], + "type": "float32" + } + }, + { + "name": "expand float32 4D tensor to 4D", + "inputs": { + "input": { + "shape": [2, 1, 1, 1], + "data": [ + 12.799123764038086, + -26.550199508666992 + ], + "type": "float32" + } + }, + "newShape": [2, 3, 2, 2], + "expected": { + "name": "output", + "shape": [2, 3, 2, 2], + "data": [ + 12.799123764038086, + 12.799123764038086, + 12.799123764038086, + 12.799123764038086, + 12.799123764038086, + 12.799123764038086, + 12.799123764038086, + 12.799123764038086, + 12.799123764038086, + 12.799123764038086, + 12.799123764038086, + 12.799123764038086, + -26.550199508666992, + -26.550199508666992, + -26.550199508666992, + -26.550199508666992, + -26.550199508666992, + -26.550199508666992, + -26.550199508666992, + -26.550199508666992, + -26.550199508666992, + -26.550199508666992, + -26.550199508666992, + -26.550199508666992 + ], + "type": "float32" + } + }, + { + "name": "expand float32 4D tensor to 5D", + "inputs": { + "input": { + "shape": [2, 1, 1, 1], + "data": [ + 12.799123764038086, + -26.550199508666992 + ], + "type": "float32" + } + }, + "newShape": [2, 2, 3, 1, 2], + "expected": { + "name": "output", + "shape": [2, 2, 3, 1, 2], + "data": [ + 12.799123764038086, + 12.799123764038086, + 12.799123764038086, + 12.799123764038086, + 12.799123764038086, + 12.799123764038086, + -26.550199508666992, + -26.550199508666992, + -26.550199508666992, + -26.550199508666992, + -26.550199508666992, + -26.550199508666992, + 12.799123764038086, + 12.799123764038086, + 12.799123764038086, + 12.799123764038086, + 12.799123764038086, + 12.799123764038086, + -26.550199508666992, + -26.550199508666992, + -26.550199508666992, + -26.550199508666992, + -26.550199508666992, + -26.550199508666992 + ], + "type": "float32" + } + } + ] +} \ No newline at end of file diff --git a/tests/wpt/tests/webnn/resources/test_data/where.json b/tests/wpt/tests/webnn/resources/test_data/where.json new file mode 100644 index 00000000000..ce3cda4bad3 --- /dev/null +++ b/tests/wpt/tests/webnn/resources/test_data/where.json @@ -0,0 +1,1688 @@ +{ + "tests": [ + { + "name": "where float32 0D scalars", + "inputs": { + "condition": { + "shape": [], + "data": [ + 247 + ], + "type": "uint8" + }, + "trueValues": { + "shape": [], + "data": [ + -22.83924102783203 + ], + "type": "float32" + }, + "falseValues": { + "shape": [], + "data": [ + -50.02232360839844 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [], + "data": [ + -22.83924102783203 + ], + "type": "float32" + } + }, + { + "name": "where float32 1D tensors", + "inputs": { + "condition": { + "shape": [24], + "data": [ + 241, + 0, + 85, + 0, + 227, + 51, + 202, + 0, + 104, + 227, + 129, + 129, + 175, + 134, + 130, + 140, + 103, + 46, + 158, + 17, + 0, + 41, + 94, + 0 + ], + "type": "uint8" + }, + "trueValues": { + "shape": [24], + "data": [ + 70.27151489257812, + 89.99047088623047, + -1.5351932048797607, + -83.77035522460938, + 29.59670639038086, + -37.10446548461914, + -6.663239002227783, + -83.15333557128906, + -90.47624206542969, + -45.470706939697266, + 50.38861083984375, + 46.510799407958984, + 47.503013610839844, + -21.95842933654785, + 42.89878463745117, + -76.8262710571289, + 67.0030746459961, + 40.09717559814453, + -29.081029891967773, + -12.19106674194336, + -10.8577880859375, + -23.302522659301758, + 30.851404190063477, + -58.82704544067383 + ], + "type": "float32" + }, + "falseValues": { + "shape": [24], + "data": [ + 90.44255065917969, + 66.7642593383789, + -39.82423782348633, + -21.683168411254883, + -67.3449478149414, + -46.46003341674805, + -55.907073974609375, + 65.5730209350586, + 35.14354705810547, + 11.960981369018555, + 76.65287780761719, + 60.741416931152344, + -93.93305206298828, + -30.397233963012695, + 34.315250396728516, + 7.7088470458984375, + -82.2353286743164, + 91.12223052978516, + 22.937334060668945, + 74.97810363769531, + 18.877336502075195, + 62.31299591064453, + 48.867103576660156, + -75.41789245605469 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 70.27151489257812, + 66.7642593383789, + -1.5351932048797607, + -21.683168411254883, + 29.59670639038086, + -37.10446548461914, + -6.663239002227783, + 65.5730209350586, + -90.47624206542969, + -45.470706939697266, + 50.38861083984375, + 46.510799407958984, + 47.503013610839844, + -21.95842933654785, + 42.89878463745117, + -76.8262710571289, + 67.0030746459961, + 40.09717559814453, + -29.081029891967773, + -12.19106674194336, + 18.877336502075195, + -23.302522659301758, + 30.851404190063477, + -75.41789245605469 + ], + "type": "float32" + } + }, + { + "name": "where float32 2D tensors", + "inputs": { + "condition": { + "shape": [4, 6], + "data": [ + 241, + 0, + 85, + 0, + 227, + 51, + 202, + 0, + 104, + 227, + 129, + 129, + 175, + 134, + 130, + 140, + 103, + 46, + 158, + 17, + 0, + 41, + 94, + 0 + ], + "type": "uint8" + }, + "trueValues": { + "shape": [4, 6], + "data": [ + 70.27151489257812, + 89.99047088623047, + -1.5351932048797607, + -83.77035522460938, + 29.59670639038086, + -37.10446548461914, + -6.663239002227783, + -83.15333557128906, + -90.47624206542969, + -45.470706939697266, + 50.38861083984375, + 46.510799407958984, + 47.503013610839844, + -21.95842933654785, + 42.89878463745117, + -76.8262710571289, + 67.0030746459961, + 40.09717559814453, + -29.081029891967773, + -12.19106674194336, + -10.8577880859375, + -23.302522659301758, + 30.851404190063477, + -58.82704544067383 + ], + "type": "float32" + }, + "falseValues": { + "shape": [4, 6], + "data": [ + 90.44255065917969, + 66.7642593383789, + -39.82423782348633, + -21.683168411254883, + -67.3449478149414, + -46.46003341674805, + -55.907073974609375, + 65.5730209350586, + 35.14354705810547, + 11.960981369018555, + 76.65287780761719, + 60.741416931152344, + -93.93305206298828, + -30.397233963012695, + 34.315250396728516, + 7.7088470458984375, + -82.2353286743164, + 91.12223052978516, + 22.937334060668945, + 74.97810363769531, + 18.877336502075195, + 62.31299591064453, + 48.867103576660156, + -75.41789245605469 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape":[4, 6], + "data": [ + 70.27151489257812, + 66.7642593383789, + -1.5351932048797607, + -21.683168411254883, + 29.59670639038086, + -37.10446548461914, + -6.663239002227783, + 65.5730209350586, + -90.47624206542969, + -45.470706939697266, + 50.38861083984375, + 46.510799407958984, + 47.503013610839844, + -21.95842933654785, + 42.89878463745117, + -76.8262710571289, + 67.0030746459961, + 40.09717559814453, + -29.081029891967773, + -12.19106674194336, + 18.877336502075195, + -23.302522659301758, + 30.851404190063477, + -75.41789245605469 + ], + "type": "float32" + } + }, + { + "name": "where float32 3D tensors", + "inputs": { + "condition": { + "shape": [2, 3, 4], + "data": [ + 241, + 0, + 85, + 0, + 227, + 51, + 202, + 0, + 104, + 227, + 129, + 129, + 175, + 134, + 130, + 140, + 103, + 46, + 158, + 17, + 0, + 41, + 94, + 0 + ], + "type": "uint8" + }, + "trueValues": { + "shape": [2, 3, 4], + "data": [ + 70.27151489257812, + 89.99047088623047, + -1.5351932048797607, + -83.77035522460938, + 29.59670639038086, + -37.10446548461914, + -6.663239002227783, + -83.15333557128906, + -90.47624206542969, + -45.470706939697266, + 50.38861083984375, + 46.510799407958984, + 47.503013610839844, + -21.95842933654785, + 42.89878463745117, + -76.8262710571289, + 67.0030746459961, + 40.09717559814453, + -29.081029891967773, + -12.19106674194336, + -10.8577880859375, + -23.302522659301758, + 30.851404190063477, + -58.82704544067383 + ], + "type": "float32" + }, + "falseValues": { + "shape": [2, 3, 4], + "data": [ + 90.44255065917969, + 66.7642593383789, + -39.82423782348633, + -21.683168411254883, + -67.3449478149414, + -46.46003341674805, + -55.907073974609375, + 65.5730209350586, + 35.14354705810547, + 11.960981369018555, + 76.65287780761719, + 60.741416931152344, + -93.93305206298828, + -30.397233963012695, + 34.315250396728516, + 7.7088470458984375, + -82.2353286743164, + 91.12223052978516, + 22.937334060668945, + 74.97810363769531, + 18.877336502075195, + 62.31299591064453, + 48.867103576660156, + -75.41789245605469 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [2, 3, 4], + "data": [ + 70.27151489257812, + 66.7642593383789, + -1.5351932048797607, + -21.683168411254883, + 29.59670639038086, + -37.10446548461914, + -6.663239002227783, + 65.5730209350586, + -90.47624206542969, + -45.470706939697266, + 50.38861083984375, + 46.510799407958984, + 47.503013610839844, + -21.95842933654785, + 42.89878463745117, + -76.8262710571289, + 67.0030746459961, + 40.09717559814453, + -29.081029891967773, + -12.19106674194336, + 18.877336502075195, + -23.302522659301758, + 30.851404190063477, + -75.41789245605469 + ], + "type": "float32" + } + }, + { + "name": "where float32 4D tensors", + "inputs": { + "condition": { + "shape": [2, 2, 2, 3], + "data": [ + 241, + 0, + 85, + 0, + 227, + 51, + 202, + 0, + 104, + 227, + 129, + 129, + 175, + 134, + 130, + 140, + 103, + 46, + 158, + 17, + 0, + 41, + 94, + 0 + ], + "type": "uint8" + }, + "trueValues": { + "shape": [2, 2, 2, 3], + "data": [ + 70.27151489257812, + 89.99047088623047, + -1.5351932048797607, + -83.77035522460938, + 29.59670639038086, + -37.10446548461914, + -6.663239002227783, + -83.15333557128906, + -90.47624206542969, + -45.470706939697266, + 50.38861083984375, + 46.510799407958984, + 47.503013610839844, + -21.95842933654785, + 42.89878463745117, + -76.8262710571289, + 67.0030746459961, + 40.09717559814453, + -29.081029891967773, + -12.19106674194336, + -10.8577880859375, + -23.302522659301758, + 30.851404190063477, + -58.82704544067383 + ], + "type": "float32" + }, + "falseValues": { + "shape": [2, 2, 2, 3], + "data": [ + 90.44255065917969, + 66.7642593383789, + -39.82423782348633, + -21.683168411254883, + -67.3449478149414, + -46.46003341674805, + -55.907073974609375, + 65.5730209350586, + 35.14354705810547, + 11.960981369018555, + 76.65287780761719, + 60.741416931152344, + -93.93305206298828, + -30.397233963012695, + 34.315250396728516, + 7.7088470458984375, + -82.2353286743164, + 91.12223052978516, + 22.937334060668945, + 74.97810363769531, + 18.877336502075195, + 62.31299591064453, + 48.867103576660156, + -75.41789245605469 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [2, 2, 2, 3], + "data": [ + 70.27151489257812, + 66.7642593383789, + -1.5351932048797607, + -21.683168411254883, + 29.59670639038086, + -37.10446548461914, + -6.663239002227783, + 65.5730209350586, + -90.47624206542969, + -45.470706939697266, + 50.38861083984375, + 46.510799407958984, + 47.503013610839844, + -21.95842933654785, + 42.89878463745117, + -76.8262710571289, + 67.0030746459961, + 40.09717559814453, + -29.081029891967773, + -12.19106674194336, + 18.877336502075195, + -23.302522659301758, + 30.851404190063477, + -75.41789245605469 + ], + "type": "float32" + } + }, + { + "name": "where float32 5D tensors", + "inputs": { + "condition": { + "shape": [2, 2, 1, 2, 3], + "data": [ + 241, + 0, + 85, + 0, + 227, + 51, + 202, + 0, + 104, + 227, + 129, + 129, + 175, + 134, + 130, + 140, + 103, + 46, + 158, + 17, + 0, + 41, + 94, + 0 + ], + "type": "uint8" + }, + "trueValues": { + "shape": [2, 2, 1, 2, 3], + "data": [ + 70.27151489257812, + 89.99047088623047, + -1.5351932048797607, + -83.77035522460938, + 29.59670639038086, + -37.10446548461914, + -6.663239002227783, + -83.15333557128906, + -90.47624206542969, + -45.470706939697266, + 50.38861083984375, + 46.510799407958984, + 47.503013610839844, + -21.95842933654785, + 42.89878463745117, + -76.8262710571289, + 67.0030746459961, + 40.09717559814453, + -29.081029891967773, + -12.19106674194336, + -10.8577880859375, + -23.302522659301758, + 30.851404190063477, + -58.82704544067383 + ], + "type": "float32" + }, + "falseValues": { + "shape": [2, 2, 1, 2, 3], + "data": [ + 90.44255065917969, + 66.7642593383789, + -39.82423782348633, + -21.683168411254883, + -67.3449478149414, + -46.46003341674805, + -55.907073974609375, + 65.5730209350586, + 35.14354705810547, + 11.960981369018555, + 76.65287780761719, + 60.741416931152344, + -93.93305206298828, + -30.397233963012695, + 34.315250396728516, + 7.7088470458984375, + -82.2353286743164, + 91.12223052978516, + 22.937334060668945, + 74.97810363769531, + 18.877336502075195, + 62.31299591064453, + 48.867103576660156, + -75.41789245605469 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [2, 2, 1, 2, 3], + "data": [ + 70.27151489257812, + 66.7642593383789, + -1.5351932048797607, + -21.683168411254883, + 29.59670639038086, + -37.10446548461914, + -6.663239002227783, + 65.5730209350586, + -90.47624206542969, + -45.470706939697266, + 50.38861083984375, + 46.510799407958984, + 47.503013610839844, + -21.95842933654785, + 42.89878463745117, + -76.8262710571289, + 67.0030746459961, + 40.09717559814453, + -29.081029891967773, + -12.19106674194336, + 18.877336502075195, + -23.302522659301758, + 30.851404190063477, + -75.41789245605469 + ], + "type": "float32" + } + }, + { + "name": "where float32 4D tensors only broadcast condition 0D to 4D", + "inputs": { + "condition": { + "shape": [], + "data": [ + 247 + ], + "type": "uint8" + }, + "trueValues": { + "shape": [2, 2, 2, 3], + "data": [ + 70.27151489257812, + 89.99047088623047, + -1.5351932048797607, + -83.77035522460938, + 29.59670639038086, + -37.10446548461914, + -6.663239002227783, + -83.15333557128906, + -90.47624206542969, + -45.470706939697266, + 50.38861083984375, + 46.510799407958984, + 47.503013610839844, + -21.95842933654785, + 42.89878463745117, + -76.8262710571289, + 67.0030746459961, + 40.09717559814453, + -29.081029891967773, + -12.19106674194336, + -10.8577880859375, + -23.302522659301758, + 30.851404190063477, + -58.82704544067383 + ], + "type": "float32" + }, + "falseValues": { + "shape": [2, 2, 2, 3], + "data": [ + 90.44255065917969, + 66.7642593383789, + -39.82423782348633, + -21.683168411254883, + -67.3449478149414, + -46.46003341674805, + -55.907073974609375, + 65.5730209350586, + 35.14354705810547, + 11.960981369018555, + 76.65287780761719, + 60.741416931152344, + -93.93305206298828, + -30.397233963012695, + 34.315250396728516, + 7.7088470458984375, + -82.2353286743164, + 91.12223052978516, + 22.937334060668945, + 74.97810363769531, + 18.877336502075195, + 62.31299591064453, + 48.867103576660156, + -75.41789245605469 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [2, 2, 2, 3], + "data": [ + 70.27151489257812, + 89.99047088623047, + -1.5351932048797607, + -83.77035522460938, + 29.59670639038086, + -37.10446548461914, + -6.663239002227783, + -83.15333557128906, + -90.47624206542969, + -45.470706939697266, + 50.38861083984375, + 46.510799407958984, + 47.503013610839844, + -21.95842933654785, + 42.89878463745117, + -76.8262710571289, + 67.0030746459961, + 40.09717559814453, + -29.081029891967773, + -12.19106674194336, + -10.8577880859375, + -23.302522659301758, + 30.851404190063477, + -58.82704544067383 + ], + "type": "float32" + } + }, + { + "name": "where float32 4D tensors only broadcast condition 1D to 4D", + "inputs": { + "condition": { + "shape": [3], + "data": [ + 253, + 222, + 0 + ], + "type": "uint8" + }, + "trueValues": { + "shape": [2, 2, 2, 3], + "data": [ + 70.27151489257812, + 89.99047088623047, + -1.5351932048797607, + -83.77035522460938, + 29.59670639038086, + -37.10446548461914, + -6.663239002227783, + -83.15333557128906, + -90.47624206542969, + -45.470706939697266, + 50.38861083984375, + 46.510799407958984, + 47.503013610839844, + -21.95842933654785, + 42.89878463745117, + -76.8262710571289, + 67.0030746459961, + 40.09717559814453, + -29.081029891967773, + -12.19106674194336, + -10.8577880859375, + -23.302522659301758, + 30.851404190063477, + -58.82704544067383 + ], + "type": "float32" + }, + "falseValues": { + "shape": [2, 2, 2, 3], + "data": [ + 90.44255065917969, + 66.7642593383789, + -39.82423782348633, + -21.683168411254883, + -67.3449478149414, + -46.46003341674805, + -55.907073974609375, + 65.5730209350586, + 35.14354705810547, + 11.960981369018555, + 76.65287780761719, + 60.741416931152344, + -93.93305206298828, + -30.397233963012695, + 34.315250396728516, + 7.7088470458984375, + -82.2353286743164, + 91.12223052978516, + 22.937334060668945, + 74.97810363769531, + 18.877336502075195, + 62.31299591064453, + 48.867103576660156, + -75.41789245605469 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [2, 2, 2, 3], + "data": [ + 70.27151489257812, + 89.99047088623047, + -39.82423782348633, + -83.77035522460938, + 29.59670639038086, + -46.46003341674805, + -6.663239002227783, + -83.15333557128906, + 35.14354705810547, + -45.470706939697266, + 50.38861083984375, + 60.741416931152344, + 47.503013610839844, + -21.95842933654785, + 34.315250396728516, + -76.8262710571289, + 67.0030746459961, + 91.12223052978516, + -29.081029891967773, + -12.19106674194336, + 18.877336502075195, + -23.302522659301758, + 30.851404190063477, + -75.41789245605469 + ], + "type": "float32" + } + }, + { + "name": "where float32 4D tensors only broadcast condition 2D to 4D", + "inputs": { + "condition": { + "shape": [2, 1], + "data": [ + 103, + 0 + ], + "type": "uint8" + }, + "trueValues": { + "shape": [2, 2, 2, 3], + "data": [ + 70.27151489257812, + 89.99047088623047, + -1.5351932048797607, + -83.77035522460938, + 29.59670639038086, + -37.10446548461914, + -6.663239002227783, + -83.15333557128906, + -90.47624206542969, + -45.470706939697266, + 50.38861083984375, + 46.510799407958984, + 47.503013610839844, + -21.95842933654785, + 42.89878463745117, + -76.8262710571289, + 67.0030746459961, + 40.09717559814453, + -29.081029891967773, + -12.19106674194336, + -10.8577880859375, + -23.302522659301758, + 30.851404190063477, + -58.82704544067383 + ], + "type": "float32" + }, + "falseValues": { + "shape": [2, 2, 2, 3], + "data": [ + 90.44255065917969, + 66.7642593383789, + -39.82423782348633, + -21.683168411254883, + -67.3449478149414, + -46.46003341674805, + -55.907073974609375, + 65.5730209350586, + 35.14354705810547, + 11.960981369018555, + 76.65287780761719, + 60.741416931152344, + -93.93305206298828, + -30.397233963012695, + 34.315250396728516, + 7.7088470458984375, + -82.2353286743164, + 91.12223052978516, + 22.937334060668945, + 74.97810363769531, + 18.877336502075195, + 62.31299591064453, + 48.867103576660156, + -75.41789245605469 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [2, 2, 2, 3], + "data": [ + 70.27151489257812, + 89.99047088623047, + -1.5351932048797607, + -21.683168411254883, + -67.3449478149414, + -46.46003341674805, + -6.663239002227783, + -83.15333557128906, + -90.47624206542969, + 11.960981369018555, + 76.65287780761719, + 60.741416931152344, + 47.503013610839844, + -21.95842933654785, + 42.89878463745117, + 7.7088470458984375, + -82.2353286743164, + 91.12223052978516, + -29.081029891967773, + -12.19106674194336, + -10.8577880859375, + 62.31299591064453, + 48.867103576660156, + -75.41789245605469 + ], + "type": "float32" + } + }, + { + "name": "where float32 4D tensors only broadcast condition 3D to 4D", + "inputs": { + "condition": { + "shape": [1, 2, 3], + "data": [ + 235, + 0, + 93, + 213, + 0, + 117 + ], + "type": "uint8" + }, + "trueValues": { + "shape": [2, 2, 2, 3], + "data": [ + 70.27151489257812, + 89.99047088623047, + -1.5351932048797607, + -83.77035522460938, + 29.59670639038086, + -37.10446548461914, + -6.663239002227783, + -83.15333557128906, + -90.47624206542969, + -45.470706939697266, + 50.38861083984375, + 46.510799407958984, + 47.503013610839844, + -21.95842933654785, + 42.89878463745117, + -76.8262710571289, + 67.0030746459961, + 40.09717559814453, + -29.081029891967773, + -12.19106674194336, + -10.8577880859375, + -23.302522659301758, + 30.851404190063477, + -58.82704544067383 + ], + "type": "float32" + }, + "falseValues": { + "shape": [2, 2, 2, 3], + "data": [ + 90.44255065917969, + 66.7642593383789, + -39.82423782348633, + -21.683168411254883, + -67.3449478149414, + -46.46003341674805, + -55.907073974609375, + 65.5730209350586, + 35.14354705810547, + 11.960981369018555, + 76.65287780761719, + 60.741416931152344, + -93.93305206298828, + -30.397233963012695, + 34.315250396728516, + 7.7088470458984375, + -82.2353286743164, + 91.12223052978516, + 22.937334060668945, + 74.97810363769531, + 18.877336502075195, + 62.31299591064453, + 48.867103576660156, + -75.41789245605469 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [2, 2, 2, 3], + "data": [ + 70.27151489257812, + 66.7642593383789, + -1.5351932048797607, + -83.77035522460938, + -67.3449478149414, + -37.10446548461914, + -6.663239002227783, + 65.5730209350586, + -90.47624206542969, + -45.470706939697266, + 76.65287780761719, + 46.510799407958984, + 47.503013610839844, + -30.397233963012695, + 42.89878463745117, + -76.8262710571289, + -82.2353286743164, + 40.09717559814453, + -29.081029891967773, + 74.97810363769531, + -10.8577880859375, + -23.302522659301758, + 48.867103576660156, + -58.82704544067383 + ], + "type": "float32" + } + }, + { + "name": "where float32 4D tensors only broadcast condition 4D to 4D", + "inputs": { + "condition": { + "shape": [1, 2, 2, 1], + "data": [ + 0, + 165, + 0, + 90 + ], + "type": "uint8" + }, + "trueValues": { + "shape": [2, 2, 2, 3], + "data": [ + 70.27151489257812, + 89.99047088623047, + -1.5351932048797607, + -83.77035522460938, + 29.59670639038086, + -37.10446548461914, + -6.663239002227783, + -83.15333557128906, + -90.47624206542969, + -45.470706939697266, + 50.38861083984375, + 46.510799407958984, + 47.503013610839844, + -21.95842933654785, + 42.89878463745117, + -76.8262710571289, + 67.0030746459961, + 40.09717559814453, + -29.081029891967773, + -12.19106674194336, + -10.8577880859375, + -23.302522659301758, + 30.851404190063477, + -58.82704544067383 + ], + "type": "float32" + }, + "falseValues": { + "shape": [2, 2, 2, 3], + "data": [ + 90.44255065917969, + 66.7642593383789, + -39.82423782348633, + -21.683168411254883, + -67.3449478149414, + -46.46003341674805, + -55.907073974609375, + 65.5730209350586, + 35.14354705810547, + 11.960981369018555, + 76.65287780761719, + 60.741416931152344, + -93.93305206298828, + -30.397233963012695, + 34.315250396728516, + 7.7088470458984375, + -82.2353286743164, + 91.12223052978516, + 22.937334060668945, + 74.97810363769531, + 18.877336502075195, + 62.31299591064453, + 48.867103576660156, + -75.41789245605469 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [2, 2, 2, 3], + "data": [ + 90.44255065917969, + 66.7642593383789, + -39.82423782348633, + -83.77035522460938, + 29.59670639038086, + -37.10446548461914, + -55.907073974609375, + 65.5730209350586, + 35.14354705810547, + -45.470706939697266, + 50.38861083984375, + 46.510799407958984, + -93.93305206298828, + -30.397233963012695, + 34.315250396728516, + -76.8262710571289, + 67.0030746459961, + 40.09717559814453, + 22.937334060668945, + 74.97810363769531, + 18.877336502075195, + -23.302522659301758, + 30.851404190063477, + -58.82704544067383 + ], + "type": "float32" + } + }, + { + "name": "where float32 4D tensors only broadcast trueValues 2D to 4D", + "inputs": { + "condition": { + "shape": [2, 2, 2, 3], + "data": [ + 241, + 0, + 85, + 0, + 227, + 51, + 202, + 0, + 104, + 227, + 129, + 129, + 175, + 134, + 130, + 140, + 103, + 46, + 158, + 17, + 0, + 41, + 94, + 0 + ], + "type": "uint8" + }, + "trueValues": { + "shape": [2, 3], + "data": [ + 38.77214050292969, + 18.20477294921875, + -11.542049407958984, + -82.74693298339844, + -18.61202621459961, + -75.77534484863281 + ], + "type": "float32" + }, + "falseValues": { + "shape": [2, 2, 2, 3], + "data": [ + 90.44255065917969, + 66.7642593383789, + -39.82423782348633, + -21.683168411254883, + -67.3449478149414, + -46.46003341674805, + -55.907073974609375, + 65.5730209350586, + 35.14354705810547, + 11.960981369018555, + 76.65287780761719, + 60.741416931152344, + -93.93305206298828, + -30.397233963012695, + 34.315250396728516, + 7.7088470458984375, + -82.2353286743164, + 91.12223052978516, + 22.937334060668945, + 74.97810363769531, + 18.877336502075195, + 62.31299591064453, + 48.867103576660156, + -75.41789245605469 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [2, 2, 2, 3], + "data": [ + 38.77214050292969, + 66.7642593383789, + -11.542049407958984, + -21.683168411254883, + -18.61202621459961, + -75.77534484863281, + 38.77214050292969, + 65.5730209350586, + -11.542049407958984, + -82.74693298339844, + -18.61202621459961, + -75.77534484863281, + 38.77214050292969, + 18.20477294921875, + -11.542049407958984, + -82.74693298339844, + -18.61202621459961, + -75.77534484863281, + 38.77214050292969, + 18.20477294921875, + 18.877336502075195, + -82.74693298339844, + -18.61202621459961, + -75.41789245605469 + ], + "type": "float32" + } + }, + { + "name": "where float32 4D tensors only broadcast trueValues 4D to 4D", + "inputs": { + "condition": { + "shape": [2, 2, 2, 3], + "data": [ + 241, + 0, + 85, + 0, + 227, + 51, + 202, + 0, + 104, + 227, + 129, + 129, + 175, + 134, + 130, + 140, + 103, + 46, + 158, + 17, + 0, + 41, + 94, + 0 + ], + "type": "uint8" + }, + "trueValues": { + "shape": [2, 2, 1, 1], + "data": [ + -29.164173126220703, + 32.200286865234375, + -6.146966457366943, + -24.822790145874023 + ], + "type": "float32" + }, + "falseValues": { + "shape": [2, 2, 2, 3], + "data": [ + 90.44255065917969, + 66.7642593383789, + -39.82423782348633, + -21.683168411254883, + -67.3449478149414, + -46.46003341674805, + -55.907073974609375, + 65.5730209350586, + 35.14354705810547, + 11.960981369018555, + 76.65287780761719, + 60.741416931152344, + -93.93305206298828, + -30.397233963012695, + 34.315250396728516, + 7.7088470458984375, + -82.2353286743164, + 91.12223052978516, + 22.937334060668945, + 74.97810363769531, + 18.877336502075195, + 62.31299591064453, + 48.867103576660156, + -75.41789245605469 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [2, 2, 2, 3], + "data": [ + -29.164173126220703, + 66.7642593383789, + -29.164173126220703, + -21.683168411254883, + -29.164173126220703, + -29.164173126220703, + 32.200286865234375, + 65.5730209350586, + 32.200286865234375, + 32.200286865234375, + 32.200286865234375, + 32.200286865234375, + -6.146966457366943, + -6.146966457366943, + -6.146966457366943, + -6.146966457366943, + -6.146966457366943, + -6.146966457366943, + -24.822790145874023, + -24.822790145874023, + 18.877336502075195, + -24.822790145874023, + -24.822790145874023, + -75.41789245605469 + ], + "type": "float32" + } + }, + { + "name": "where float32 4D tensors only broadcast falseValues 3D to 4D", + "inputs": { + "condition": { + "shape": [2, 2, 2, 3], + "data": [ + 241, + 0, + 85, + 0, + 227, + 51, + 202, + 0, + 104, + 227, + 129, + 129, + 175, + 134, + 130, + 140, + 103, + 46, + 158, + 17, + 0, + 41, + 94, + 0 + ], + "type": "uint8" + }, + "trueValues": { + "shape": [2, 2, 2, 3], + "data": [ + 70.27151489257812, + 89.99047088623047, + -1.5351932048797607, + -83.77035522460938, + 29.59670639038086, + -37.10446548461914, + -6.663239002227783, + -83.15333557128906, + -90.47624206542969, + -45.470706939697266, + 50.38861083984375, + 46.510799407958984, + 47.503013610839844, + -21.95842933654785, + 42.89878463745117, + -76.8262710571289, + 67.0030746459961, + 40.09717559814453, + -29.081029891967773, + -12.19106674194336, + -10.8577880859375, + -23.302522659301758, + 30.851404190063477, + -58.82704544067383 + ], + "type": "float32" + }, + "falseValues": { + "shape": [2, 2, 1], + "data": [ + -86.59848022460938, + -67.72773742675781, + -30.731334686279297, + -93.49223327636719 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [2, 2, 2, 3], + "data": [ + 70.27151489257812, + -86.59848022460938, + -1.5351932048797607, + -67.72773742675781, + 29.59670639038086, + -37.10446548461914, + -6.663239002227783, + -30.731334686279297, + -90.47624206542969, + -45.470706939697266, + 50.38861083984375, + 46.510799407958984, + 47.503013610839844, + -21.95842933654785, + 42.89878463745117, + -76.8262710571289, + 67.0030746459961, + 40.09717559814453, + -29.081029891967773, + -12.19106674194336, + -30.731334686279297, + -23.302522659301758, + 30.851404190063477, + -93.49223327636719 + ], + "type": "float32" + } + }, + { + "name": "where float32 4D tensors only broadcast falseValues 4D to 4D", + "inputs": { + "condition": { + "shape": [2, 2, 2, 3], + "data": [ + 241, + 0, + 85, + 0, + 227, + 51, + 202, + 0, + 104, + 227, + 129, + 129, + 175, + 134, + 130, + 140, + 103, + 46, + 158, + 17, + 0, + 41, + 94, + 0 + ], + "type": "uint8" + }, + "trueValues": { + "shape": [2, 2, 2, 3], + "data": [ + 70.27151489257812, + 89.99047088623047, + -1.5351932048797607, + -83.77035522460938, + 29.59670639038086, + -37.10446548461914, + -6.663239002227783, + -83.15333557128906, + -90.47624206542969, + -45.470706939697266, + 50.38861083984375, + 46.510799407958984, + 47.503013610839844, + -21.95842933654785, + 42.89878463745117, + -76.8262710571289, + 67.0030746459961, + 40.09717559814453, + -29.081029891967773, + -12.19106674194336, + -10.8577880859375, + -23.302522659301758, + 30.851404190063477, + -58.82704544067383 + ], + "type": "float32" + }, + "falseValues": { + "shape": [1, 2, 1, 3], + "data": [ + 17.777414321899414, + -1.9890096187591553, + -57.28207015991211, + -80.01390838623047, + 66.87323760986328, + -31.328258514404297 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [2, 2, 2, 3], + "data": [ + 70.27151489257812, + -1.9890096187591553, + -1.5351932048797607, + 17.777414321899414, + 29.59670639038086, + -37.10446548461914, + -6.663239002227783, + 66.87323760986328, + -90.47624206542969, + -45.470706939697266, + 50.38861083984375, + 46.510799407958984, + 47.503013610839844, + -21.95842933654785, + 42.89878463745117, + -76.8262710571289, + 67.0030746459961, + 40.09717559814453, + -29.081029891967773, + -12.19106674194336, + -31.328258514404297, + -23.302522659301758, + 30.851404190063477, + -31.328258514404297 + ], + "type": "float32" + } + }, + { + "name": "where float32 4D tensors all broadcast 4D", + "inputs": { + "condition": { + "shape": [2, 1, 1, 1], + "data": [ + 58, + 217 + ], + "type": "uint8" + }, + "trueValues": { + "shape": [2, 3], + "data": [ + 38.77214050292969, + 18.20477294921875, + -11.542049407958984, + -82.74693298339844, + -18.61202621459961, + -75.77534484863281 + ], + "type": "float32" + }, + "falseValues": { + "shape": [2, 2, 1], + "data":[ + -86.59848022460938, + -67.72773742675781, + -30.731334686279297, + -93.49223327636719 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [2, 2, 2, 3], + "data": [ + 38.77214050292969, + 18.20477294921875, + -11.542049407958984, + -82.74693298339844, + -18.61202621459961, + -75.77534484863281, + 38.77214050292969, + 18.20477294921875, + -11.542049407958984, + -82.74693298339844, + -18.61202621459961, + -75.77534484863281, + 38.77214050292969, + 18.20477294921875, + -11.542049407958984, + -82.74693298339844, + -18.61202621459961, + -75.77534484863281, + 38.77214050292969, + 18.20477294921875, + -11.542049407958984, + -82.74693298339844, + -18.61202621459961, + -75.77534484863281 + ], + "type": "float32" + } + } + ] +} \ No newline at end of file diff --git a/tests/wpt/tests/webnn/resources/utils.js b/tests/wpt/tests/webnn/resources/utils.js index c3b10a70201..0e2687ec22b 100644 --- a/tests/wpt/tests/webnn/resources/utils.js +++ b/tests/wpt/tests/webnn/resources/utils.js @@ -12,6 +12,7 @@ const TypedArrayDict = { uint32: Uint32Array, int8: Int8Array, uint8: Uint8Array, + int64: BigInt64Array, }; const getTypedArrayData = (type, data) => { @@ -22,6 +23,11 @@ const getTypedArrayData = (type, data) => { for (let i = 0; i < data.length; i++) { outData[i] = toHalf(data[i]); } + } else if (type === 'int64') { + outData = new TypedArrayDict[type](data.length); + for (let i = 0; i < data.length; i++) { + outData[i] = BigInt(data[i]); + } } else { outData = new TypedArrayDict[type](data); } @@ -280,6 +286,8 @@ const getReductionPrecisionTolerance = (resources, operationName) => { // Refer to precision metrics on https://github.com/webmachinelearning/webnn/issues/265#issuecomment-1256242643 const PrecisionMetrics = { + argMax: {ULP: {int64: 0}}, + argMin: {ULP: {int64: 0}}, batchNormalization: {ULP: {float32: 6, float16: 6}}, clamp: {ULP: {float32: 0, float16: 0}}, concat: {ULP: {float32: 0, float16: 0}}, @@ -428,6 +436,9 @@ const assert_array_approx_equals_ulp = (actual, expected, nulp, dataType, descri actualBitwise = actual[i]; // convert expected data of Float16 to Uint16 expectedBitwise = toHalf(expected[i]); + } else if (dataType === 'int64') { + actualBitwise = actual[i]; + expectedBitwise = BigInt(expected[i]); } distance = actualBitwise - expectedBitwise; distance = distance >= 0 ? distance : -distance; diff --git a/tests/wpt/tests/webtransport/WEB_FEATURES.yml b/tests/wpt/tests/webtransport/WEB_FEATURES.yml new file mode 100644 index 00000000000..057d226047c --- /dev/null +++ b/tests/wpt/tests/webtransport/WEB_FEATURES.yml @@ -0,0 +1,3 @@ +features: +- name: webtransport + files: "**" diff --git a/tests/wpt/webgl/meta/conformance/textures/misc/texture-upload-size.html.ini b/tests/wpt/webgl/meta/conformance/textures/misc/texture-upload-size.html.ini index 9a7eb8a7235..2208f9c110d 100644 --- a/tests/wpt/webgl/meta/conformance/textures/misc/texture-upload-size.html.ini +++ b/tests/wpt/webgl/meta/conformance/textures/misc/texture-upload-size.html.ini @@ -100,3 +100,15 @@ [WebGL test #66: Texture was smaller than the expected size 0x0] expected: FAIL + + [WebGL test #70: Texture was smaller than the expected size 0x0] + expected: FAIL + + [WebGL test #74: Texture was smaller than the expected size 0x0] + expected: FAIL + + [WebGL test #78: Texture was smaller than the expected size 0x0] + expected: FAIL + + [WebGL test #82: Texture was smaller than the expected size 0x0] + expected: FAIL