diff --git a/tests/wpt/metadata-layout-2020/FileAPI/url/url-in-tags-revoke.window.js.ini b/tests/wpt/metadata-layout-2020/FileAPI/url/url-in-tags-revoke.window.js.ini index 3605e8f3fc9..76b44d9e9cf 100644 --- a/tests/wpt/metadata-layout-2020/FileAPI/url/url-in-tags-revoke.window.js.ini +++ b/tests/wpt/metadata-layout-2020/FileAPI/url/url-in-tags-revoke.window.js.ini @@ -4,7 +4,7 @@ expected: TIMEOUT [Opening a blob URL in a new window immediately before revoking it works.] - expected: TIMEOUT + expected: FAIL [Fetching a blob URL immediately before revoking it works in an iframe.] expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini deleted file mode 100644 index 4bfb0c2053a..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[hit-test-floats-004.html] - [Miss float below something else] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/css/css-paint-api/dynamic-import.html.ini b/tests/wpt/metadata-layout-2020/css/css-paint-api/dynamic-import.html.ini new file mode 100644 index 00000000000..3019c251714 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-paint-api/dynamic-import.html.ini @@ -0,0 +1,2 @@ +[dynamic-import.html] + expected: CRASH diff --git a/tests/wpt/metadata-layout-2020/css/css-paint-api/top-level-await.https.html.ini b/tests/wpt/metadata-layout-2020/css/css-paint-api/top-level-await.https.html.ini new file mode 100644 index 00000000000..92d137159e7 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-paint-api/top-level-await.https.html.ini @@ -0,0 +1,2 @@ +[top-level-await.https.html] + expected: TIMEOUT diff --git a/tests/wpt/metadata-layout-2020/css/css-values/vh-support-transform-translate.html.ini b/tests/wpt/metadata-layout-2020/css/css-values/vh-support-transform-translate.html.ini new file mode 100644 index 00000000000..3d0102bd597 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-values/vh-support-transform-translate.html.ini @@ -0,0 +1,2 @@ +[vh-support-transform-translate.html] + expected: TIMEOUT diff --git a/tests/wpt/metadata-layout-2020/css/cssom-view/offsetTopLeft-border-box.html.ini b/tests/wpt/metadata-layout-2020/css/cssom-view/offsetTopLeft-border-box.html.ini deleted file mode 100644 index 239c35135e4..00000000000 --- a/tests/wpt/metadata-layout-2020/css/cssom-view/offsetTopLeft-border-box.html.ini +++ /dev/null @@ -1,7 +0,0 @@ -[offsetTopLeft-border-box.html] - [container: 1] - expected: FAIL - - [container: 0] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini b/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini index 668cbe97319..b358b7b7bf5 100644 --- a/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini +++ b/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini @@ -309,27 +309,18 @@ [Response: combined response Content-Type: text/html;" \\" text/plain ";charset=GBK] expected: NOTRUN - [ + + diff --git a/tests/wpt/web-platform-tests/lint.ignore b/tests/wpt/web-platform-tests/lint.ignore index 20f90ed585c..e63b152d7ec 100644 --- a/tests/wpt/web-platform-tests/lint.ignore +++ b/tests/wpt/web-platform-tests/lint.ignore @@ -623,14 +623,22 @@ CSS-COLLIDING-REF-NAME: css/css-grid/subgrid/baseline-001-ref.html CSS-COLLIDING-REF-NAME: css/css-backgrounds/simple-bg-color-ref.html CSS-COLLIDING-REF-NAME: css/css-backgrounds/hidpi/simple-bg-color-ref.html -CSS-COLLIDING-TEST-NAME: css/css-contain/inheritance.html CSS-COLLIDING-TEST-NAME: css/css-contain/content-visibility/inheritance.html -CSS-COLLIDING-TEST-NAME: css/css-sizing/contain-intrinsic-size/parsing/contain-intrinsic-size-invalid.html -CSS-COLLIDING-TEST-NAME: css/css-sizing/aspect-ratio/parsing/contain-intrinsic-size-invalid.html -CSS-COLLIDING-TEST-NAME: css/css-sizing/contain-intrinsic-size/parsing/contain-intrinsic-size-computed.html +CSS-COLLIDING-TEST-NAME: css/css-contain/inheritance.html +CSS-COLLIDING-TEST-NAME: css/css-grid/grid-items/replaced-element-001.html +CSS-COLLIDING-TEST-NAME: css/css-grid/grid-items/replaced-element-002.html +CSS-COLLIDING-TEST-NAME: css/css-grid/grid-items/replaced-element-007.html +CSS-COLLIDING-TEST-NAME: css/css-grid/grid-items/replaced-element-010.html CSS-COLLIDING-TEST-NAME: css/css-sizing/aspect-ratio/parsing/contain-intrinsic-size-computed.html -CSS-COLLIDING-TEST-NAME: css/css-sizing/contain-intrinsic-size/parsing/contain-intrinsic-size-valid.html +CSS-COLLIDING-TEST-NAME: css/css-sizing/aspect-ratio/parsing/contain-intrinsic-size-invalid.html CSS-COLLIDING-TEST-NAME: css/css-sizing/aspect-ratio/parsing/contain-intrinsic-size-valid.html +CSS-COLLIDING-TEST-NAME: css/css-sizing/aspect-ratio/replaced-element-001.html +CSS-COLLIDING-TEST-NAME: css/css-sizing/aspect-ratio/replaced-element-002.html +CSS-COLLIDING-TEST-NAME: css/css-sizing/aspect-ratio/replaced-element-007.html +CSS-COLLIDING-TEST-NAME: css/css-sizing/aspect-ratio/replaced-element-010.html +CSS-COLLIDING-TEST-NAME: css/css-sizing/contain-intrinsic-size/parsing/contain-intrinsic-size-computed.html +CSS-COLLIDING-TEST-NAME: css/css-sizing/contain-intrinsic-size/parsing/contain-intrinsic-size-invalid.html +CSS-COLLIDING-TEST-NAME: css/css-sizing/contain-intrinsic-size/parsing/contain-intrinsic-size-valid.html # CSS tests that used to be at the top level and weren't subject to lints MISSING-LINK: css/css-fonts/matching/fixed-stretch-style-over-weight.html diff --git a/tests/wpt/web-platform-tests/media-source/mse-for-webcodecs/tentative/mediasource-webcodecs-addsourcebuffer.html b/tests/wpt/web-platform-tests/media-source/mse-for-webcodecs/tentative/mediasource-webcodecs-addsourcebuffer.html index a9dd7072b07..cc9cdc2b501 100644 --- a/tests/wpt/web-platform-tests/media-source/mse-for-webcodecs/tentative/mediasource-webcodecs-addsourcebuffer.html +++ b/tests/wpt/web-platform-tests/media-source/mse-for-webcodecs/tentative/mediasource-webcodecs-addsourcebuffer.html @@ -162,19 +162,15 @@ function runAddSourceBufferTest(argument, isValidArgument, argumentDescription, assert_equals(mediaSource.readyState, 'open', 'MediaSource is open'); let sourceBuffer; if (isValidArgument) { - // TODO(crbug.com/1144908): Update to expect success once the impl is - // more complete. - assert_throws_dom('QuotaExceededError', - () => { sourceBuffer = mediaSource.addSourceBuffer(argument); }, - 'addSourceBuffer(valid config) throws QuotaExceededError'); - assert_equals(sourceBuffer, undefined, - 'addSourceBuffer result for valid config while "open" should be exception'); + sourceBuffer = mediaSource.addSourceBuffer(argument); + assert_true(sourceBuffer instanceof SourceBuffer, + 'addSourceBuffer result for valid config while "open" should be a SourceBuffer instance'); } else { assert_throws_js(TypeError, - () => { sourceBuffer = mediaSource.addSourceBuffer(argument); }, - 'addSourceBuffer(invalid config) throws TypeError if MediaSource is "open"'); + () => { sourceBuffer = mediaSource.addSourceBuffer(argument); }, + 'addSourceBuffer(invalid config) throws TypeError if MediaSource is "open"'); assert_equals(sourceBuffer, undefined, - 'addSourceBufferResult for invalid config while "open" should be exception'); + 'addSourceBufferResult for invalid config while "open" should be exception'); } }, testDescription); break; diff --git a/tests/wpt/web-platform-tests/native-file-system/showOpenFilePicker-manual.https.html b/tests/wpt/web-platform-tests/native-file-system/showOpenFilePicker-manual.https.html index 370aa45c578..e6405a9c8c6 100644 --- a/tests/wpt/web-platform-tests/native-file-system/showOpenFilePicker-manual.https.html +++ b/tests/wpt/web-platform-tests/native-file-system/showOpenFilePicker-manual.https.html @@ -38,4 +38,25 @@ }, 'showOpenFilePicker returns correct permissions'); }, 'showOpenFilePicker works'); + promise_test(async t => { + await window.test_driver.bless( + 'show a file picker.
Please select native-file-system/resources/data/testfile.txt'); + const files = await self.showOpenFilePicker({ + multiple: false, + startIn: null, + types: [ + { description: 'Text files', accept: { ' text/plain ': ['.txt'] } }, + { description: 'Images', accept: { ' image/* ': ['.jpg', '.jpeg', '.png'] } }, + ], + }); + assert_true(Array.isArray(files)); + assert_equals(files.length, 1); + assert_true(files[0] instanceof FileSystemHandle); + assert_true(files[0] instanceof FileSystemFileHandle); + assert_equals(files[0].kind, "file"); + assert_equals(files[0].name, 'testfile.txt'); + assert_equals(await (await files[0].getFile()).text(), 'Hello World!\n'); + }, 'showOpenFilePicker does not fail when starting directory is null'); + + diff --git a/tests/wpt/web-platform-tests/native-file-system/showPicker-errors.https.window.js b/tests/wpt/web-platform-tests/native-file-system/showPicker-errors.https.window.js index d1dabf37da8..ecc64dfe66d 100644 --- a/tests/wpt/web-platform-tests/native-file-system/showPicker-errors.https.window.js +++ b/tests/wpt/web-platform-tests/native-file-system/showPicker-errors.https.window.js @@ -80,6 +80,12 @@ function define_file_picker_error_tests(showPickerMethod) { showPickerMethod + ': MIME type can\'t have invalid characters in subtype.'); + promise_test(async t => { + await promise_rejects_js(t, TypeError, self[showPickerMethod]({ + startIn: 'secrets', + })); + }, showPickerMethod + ': unknown common starting directory.'); + const invalid_extensions = { '.extensiontoolong': 'extension length more than 16.', '.txt.': 'extenstion ends with "."', diff --git a/tests/wpt/web-platform-tests/network-error-logging/support/nel.sub.js b/tests/wpt/web-platform-tests/network-error-logging/support/nel.sub.js index 8fa83505320..51a01a082e8 100644 --- a/tests/wpt/web-platform-tests/network-error-logging/support/nel.sub.js +++ b/tests/wpt/web-platform-tests/network-error-logging/support/nel.sub.js @@ -24,6 +24,15 @@ function nel_test(callback, name, properties) { }, name, properties); } +function nel_iframe_test(callback, name, properties) { + promise_test(async t => { + await obtainNELLock(); + await clearReportingAndNELConfigurationsInIframe(); + await callback(t); + await releaseNELLock(); + }, name, properties); +} + /* * Helper functions for constructing domain names that contain NEL policies. */ @@ -68,6 +77,37 @@ function fetchResourceWithZeroSuccessFractionPolicy(subdomain) { return fetch(url, {mode: "no-cors"}); } +/* + * Similar to the above methods, but fetch resources in an iframe. Allows matching + * full context of reports sent from an iframe that's same-site relative to the domains + * a policy set. + */ + + function loadResourceWithBasicPolicyInIframe(subdomain) { + return loadResourceWithPolicyInIframe( + getURLForResourceWithBasicPolicy(subdomain)); +} + +function loadResourceWithZeroSuccessFractionPolicyInIframe(subdomain) { + return loadResourceWithPolicyInIframe( + _getNELResourceURL(subdomain, "pass.png?id="+reportID+"&success_fraction=0.0")); +} + +function clearResourceWithBasicPolicyInIframe(subdomain) { + return loadResourceWithPolicyInIframe( + getURLForClearingConfiguration(subdomain)); +} + +function loadResourceWithPolicyInIframe(url) { + return new Promise((resolve, reject) => { + const frame = document.createElement('iframe'); + frame.src = url; + frame.onload = () => resolve(frame); + frame.onerror = () => reject('failed to load ' + url); + document.body.appendChild(frame); + }); +} + /* * Fetches a resource whose headers define an include_subdomains NEL policy. */ @@ -170,6 +210,16 @@ async function clearReportingAndNELConfigurations(subdomain) { return; } +async function clearReportingAndNELConfigurationsInIframe(subdomain) { + await Promise.all([ + clearResourceWithBasicPolicyInIframe(""), + clearResourceWithBasicPolicyInIframe("www"), + clearResourceWithBasicPolicyInIframe("www1"), + clearResourceWithBasicPolicyInIframe("www2"), + ]); + return; +} + /* * Returns whether all of the fields in obj1 also exist in obj2 with the same * values. (Put another way, returns whether obj1 and obj2 are equal, ignoring diff --git a/tests/wpt/web-platform-tests/signed-exchange/reporting/sxg-reporting-navigation-cert_fetch_error-downgraded.tentative.html b/tests/wpt/web-platform-tests/signed-exchange/reporting/sxg-reporting-navigation-cert_fetch_error-downgraded.tentative.html index 420eaaaf260..ce20c4726e9 100644 --- a/tests/wpt/web-platform-tests/signed-exchange/reporting/sxg-reporting-navigation-cert_fetch_error-downgraded.tentative.html +++ b/tests/wpt/web-platform-tests/signed-exchange/reporting/sxg-reporting-navigation-cert_fetch_error-downgraded.tentative.html @@ -10,8 +10,8 @@ const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN; const test_origin = get_host_info().HTTPS_ORIGIN; -nel_test(async t => { - await fetchResourceWithBasicPolicy(); +nel_iframe_test(async t => { + await loadResourceWithBasicPolicyInIframe(); const sxg_url = alt_origin + '/signed-exchange/resources/sxg/sxg-cert-not-found.sxg?navigation'; const cert_url = test_origin + '/signed-exchange/resources/not_found_certfile.cbor'; diff --git a/tests/wpt/web-platform-tests/signed-exchange/reporting/sxg-reporting-navigation-cert_fetch_error.tentative.html b/tests/wpt/web-platform-tests/signed-exchange/reporting/sxg-reporting-navigation-cert_fetch_error.tentative.html index bab50b7f885..15a7176e749 100644 --- a/tests/wpt/web-platform-tests/signed-exchange/reporting/sxg-reporting-navigation-cert_fetch_error.tentative.html +++ b/tests/wpt/web-platform-tests/signed-exchange/reporting/sxg-reporting-navigation-cert_fetch_error.tentative.html @@ -9,8 +9,8 @@ ") response = accept_alert(session) @@ -33,20 +32,20 @@ def test_no_user_prompt(session): assert_error(response, "no such alert") -def test_accept_alert(session): +def test_accept_alert(session, inline): session.url = inline("") response = accept_alert(session) assert_success(response) -def test_accept_confirm(session): +def test_accept_confirm(session, inline): session.url = inline("") response = accept_alert(session) assert_success(response) assert session.execute_script("return window.result") is True -def test_accept_prompt(session): +def test_accept_prompt(session, inline): session.url = inline(""" ") response = dismiss_alert(session) @@ -33,20 +32,20 @@ def test_no_user_prompt(session): assert_error(response, "no such alert") -def test_dismiss_alert(session): +def test_dismiss_alert(session, inline): session.url = inline("") response = dismiss_alert(session) assert_success(response) -def test_dismiss_confirm(session): +def test_dismiss_confirm(session, inline): session.url = inline("") response = dismiss_alert(session) assert_success(response) assert session.execute_script("return window.result;") is False -def test_dismiss_prompt(session): +def test_dismiss_prompt(session, inline): session.url = inline("") response = dismiss_alert(session) assert_success(response) diff --git a/tests/wpt/web-platform-tests/webdriver/tests/element_clear/clear.py b/tests/wpt/web-platform-tests/webdriver/tests/element_clear/clear.py index 8b7bb501043..b65f443aa75 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/element_clear/clear.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/element_clear/clear.py @@ -11,7 +11,6 @@ from tests.support.asserts import ( assert_in_events, assert_success, ) -from tests.support.inline import inline @pytest.fixture @@ -37,7 +36,7 @@ def text_file(tmpdir_factory): return fh -def test_null_response_value(session): +def test_null_response_value(session, inline): session.url = inline("") element = session.find.css("input", all=False) @@ -67,7 +66,7 @@ def test_no_browsing_context(session, closed_frame): assert_error(response, "no such window") -def test_connected_element(session): +def test_connected_element(session, inline): session.url = inline("") element = session.find.css("input", all=False) @@ -76,7 +75,7 @@ def test_connected_element(session): assert_error(response, "stale element reference") -def test_pointer_interactable(session): +def test_pointer_interactable(session, inline): session.url = inline("") element = session.find.css("input", all=False) @@ -84,7 +83,7 @@ def test_pointer_interactable(session): assert_error(response, "element not interactable") -def test_keyboard_interactable(session): +def test_keyboard_interactable(session, inline): session.url = inline("""
@@ -121,7 +120,7 @@ def test_keyboard_interactable(session): ("time", "19:48", ""), ("month", "2017-11", ""), ("week", "2017-W52", "")]) -def test_input(session, add_event_listeners, tracked_events, type, value, default): +def test_input(session, inline, add_event_listeners, tracked_events, type, value, default): session.url = inline("" % (type, value)) element = session.find.css("input", all=False) add_event_listeners(element, tracked_events) @@ -151,7 +150,7 @@ def test_input(session, add_event_listeners, tracked_events, type, value, defaul "month", "week", "file"]) -def test_input_disabled(session, type): +def test_input_disabled(session, inline, type): session.url = inline("" % type) element = session.find.css("input", all=False) @@ -176,7 +175,7 @@ def test_input_disabled(session, type): "month", "week", "file"]) -def test_input_readonly(session, type): +def test_input_readonly(session, inline, type): session.url = inline("" % type) element = session.find.css("input", all=False) @@ -184,7 +183,7 @@ def test_input_readonly(session, type): assert_error(response, "invalid element state") -def test_textarea(session, add_event_listeners, tracked_events): +def test_textarea(session, inline, add_event_listeners, tracked_events): session.url = inline("") element = session.find.css("textarea", all=False) add_event_listeners(element, tracked_events) @@ -196,7 +195,7 @@ def test_textarea(session, add_event_listeners, tracked_events): assert_in_events(session, ["focus", "change", "blur"]) -def test_textarea_disabled(session): +def test_textarea_disabled(session, inline): session.url = inline("") element = session.find.css("textarea", all=False) @@ -204,7 +203,7 @@ def test_textarea_disabled(session): assert_error(response, "invalid element state") -def test_textarea_readonly(session): +def test_textarea_readonly(session, inline): session.url = inline("") element = session.find.css("textarea", all=False) @@ -212,7 +211,7 @@ def test_textarea_readonly(session): assert_error(response, "invalid element state") -def test_input_file(session, text_file): +def test_input_file(session, text_file, inline): session.url = inline("") element = session.find.css("input", all=False) element.send_keys(str(text_file)) @@ -222,7 +221,7 @@ def test_input_file(session, text_file): assert element.property("value") == "" -def test_input_file_multiple(session, text_file): +def test_input_file_multiple(session, text_file, inline): session.url = inline("") element = session.find.css("input", all=False) element.send_keys(str(text_file)) @@ -233,7 +232,7 @@ def test_input_file_multiple(session, text_file): assert element.property("value") == "" -def test_select(session): +def test_select(session, inline): session.url = inline(""" ") element = session.find.css("input", all=False) add_event_listeners(element, tracked_events) @@ -320,7 +319,7 @@ def test_resettable_element_focus_when_empty(session, add_event_listeners, track ("time", "foo"), ("month", "foo"), ("week", "foo")]) -def test_resettable_element_does_not_satisfy_validation_constraints(session, type, invalid_value): +def test_resettable_element_does_not_satisfy_validation_constraints(session, inline, type, invalid_value): """ Some UAs allow invalid input to certain types of constrained form controls. For example, Gecko allows non-valid characters @@ -357,7 +356,7 @@ def test_resettable_element_does_not_satisfy_validation_constraints(session, typ "submit", "button", "image"]) -def test_non_editable_inputs(session, type): +def test_non_editable_inputs(session, inline, type): session.url = inline("" % type) element = session.find.css("input", all=False) @@ -365,7 +364,7 @@ def test_non_editable_inputs(session, type): assert_error(response, "invalid element state") -def test_scroll_into_view(session): +def test_scroll_into_view(session, inline): session.url = inline("""
diff --git a/tests/wpt/web-platform-tests/webdriver/tests/element_clear/user_prompts.py b/tests/wpt/web-platform-tests/webdriver/tests/element_clear/user_prompts.py index cfb850e08d5..7a8564a684a 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/element_clear/user_prompts.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/element_clear/user_prompts.py @@ -3,7 +3,6 @@ import pytest from tests.support.asserts import assert_dialog_handled, assert_error, assert_success -from tests.support.inline import inline def element_clear(session, element): @@ -14,7 +13,7 @@ def element_clear(session, element): @pytest.fixture -def check_user_prompt_closed_without_exception(session, create_dialog): +def check_user_prompt_closed_without_exception(session, create_dialog, inline): def check_user_prompt_closed_without_exception(dialog_type, retval): session.url = inline("") element = session.find.css("input", all=False) @@ -35,7 +34,7 @@ def check_user_prompt_closed_without_exception(session, create_dialog): @pytest.fixture -def check_user_prompt_closed_with_exception(session, create_dialog): +def check_user_prompt_closed_with_exception(session, create_dialog, inline): def check_user_prompt_closed_with_exception(dialog_type, retval): session.url = inline("") element = session.find.css("input", all=False) @@ -56,7 +55,7 @@ def check_user_prompt_closed_with_exception(session, create_dialog): @pytest.fixture -def check_user_prompt_not_closed_but_exception(session, create_dialog): +def check_user_prompt_not_closed_but_exception(session, create_dialog, inline): def check_user_prompt_not_closed_but_exception(dialog_type): session.url = inline("") element = session.find.css("input", all=False) diff --git a/tests/wpt/web-platform-tests/webdriver/tests/element_click/bubbling.py b/tests/wpt/web-platform-tests/webdriver/tests/element_click/bubbling.py index a069a5a5df3..7620ec3224f 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/element_click/bubbling.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/element_click/bubbling.py @@ -1,5 +1,4 @@ from tests.support.asserts import assert_success -from tests.support.inline import inline def element_click(session, element): @@ -9,7 +8,7 @@ def element_click(session, element): element_id=element.id)) -def test_click_event_bubbles_to_parents(session): +def test_click_event_bubbles_to_parents(session, inline): session.url = inline("""