diff --git a/tests/wpt/metadata-layout-2020/WebIDL/ecmascript-binding/interface-prototype-constructor-set-receiver.html.ini b/tests/wpt/metadata-layout-2020/WebIDL/ecmascript-binding/interface-prototype-constructor-set-receiver.html.ini new file mode 100644 index 00000000000..739c434ea33 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/WebIDL/ecmascript-binding/interface-prototype-constructor-set-receiver.html.ini @@ -0,0 +1,4 @@ +[interface-prototype-constructor-set-receiver.html] + [Window, Location, Navigator, HTMLDocument, and HTMLHeadElement] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/css/cssom-view/CaretPosition-001.html.ini b/tests/wpt/metadata-layout-2020/css/cssom-view/CaretPosition-001.html.ini deleted file mode 100644 index 4c79907309b..00000000000 --- a/tests/wpt/metadata-layout-2020/css/cssom-view/CaretPosition-001.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[CaretPosition-001.html] - [Element at (400, 100)] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/css/cssom-view/elementsFromPoint-invalid-cases.html.ini b/tests/wpt/metadata-layout-2020/css/cssom-view/elementsFromPoint-invalid-cases.html.ini deleted file mode 100644 index e181af5397f..00000000000 --- a/tests/wpt/metadata-layout-2020/css/cssom-view/elementsFromPoint-invalid-cases.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[elementsFromPoint-invalid-cases.html] - [The root element is the last element returned for otherwise empty queries within the viewport] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/css/cssom-view/matchMedia-display-none-iframe.html.ini b/tests/wpt/metadata-layout-2020/css/cssom-view/matchMedia-display-none-iframe.html.ini deleted file mode 100644 index e6e1f29e274..00000000000 --- a/tests/wpt/metadata-layout-2020/css/cssom-view/matchMedia-display-none-iframe.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[matchMedia-display-none-iframe.html] - expected: ERROR 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 9df578bb958..8ae6da93e83 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 @@ -312,9 +312,6 @@ [Response: combined response Content-Type: text/html;" \\" text/plain ";charset=GBK] expected: NOTRUN - [ + diff --git a/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/resources/iframe-loading-lazy-in-viewport.html b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/resources/iframe-loading-lazy-in-viewport.html new file mode 100644 index 00000000000..1efd2bd056d --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/resources/iframe-loading-lazy-in-viewport.html @@ -0,0 +1,2 @@ + + diff --git a/tests/wpt/web-platform-tests/payment-request/onmerchantvalidation-attribute.https.html b/tests/wpt/web-platform-tests/merchant-validation/onmerchantvalidation-attribute.https.html similarity index 100% rename from tests/wpt/web-platform-tests/payment-request/onmerchantvalidation-attribute.https.html rename to tests/wpt/web-platform-tests/merchant-validation/onmerchantvalidation-attribute.https.html diff --git a/tests/wpt/web-platform-tests/payment-request/payment-request-abort-method.https.html b/tests/wpt/web-platform-tests/payment-request/payment-request-abort-method.https.html index 8230e2458aa..32b87970b4d 100644 --- a/tests/wpt/web-platform-tests/payment-request/payment-request-abort-method.https.html +++ b/tests/wpt/web-platform-tests/payment-request/payment-request-abort-method.https.html @@ -1,11 +1,11 @@ - + Test for PaymentRequest.abort() method - + - + - If you find a buggy test, please file a bug - and tag one of the suggested reviewers. + If you find a buggy test, please + file a bug and + tag one of the + suggested reviewers. diff --git a/tests/wpt/web-platform-tests/payment-request/payment-request-canmakepayment-method-protection.https.html b/tests/wpt/web-platform-tests/payment-request/payment-request-canmakepayment-method-protection.https.html deleted file mode 100644 index 9c068dfe001..00000000000 --- a/tests/wpt/web-platform-tests/payment-request/payment-request-canmakepayment-method-protection.https.html +++ /dev/null @@ -1,65 +0,0 @@ - - -Tests for PaymentRequest.canMakePayment() method - - - - - - - - - If you find a buggy test, please file a bug - and tag one of the suggested reviewers. - diff --git a/tests/wpt/web-platform-tests/payment-request/payment-request-show-method.https.html b/tests/wpt/web-platform-tests/payment-request/payment-request-show-method.https.html index 20d5bab0d14..e5ee5eed01b 100644 --- a/tests/wpt/web-platform-tests/payment-request/payment-request-show-method.https.html +++ b/tests/wpt/web-platform-tests/payment-request/payment-request-show-method.https.html @@ -1,7 +1,7 @@ - + Test for PaymentRequest.show() method - + @@ -21,7 +21,7 @@ const defaultMethods = Object.freeze([ countryCode: "US", merchantCapabilities: ["supports3DS"], supportedNetworks: ["visa"], - } + }, }, ]); @@ -35,7 +35,7 @@ const defaultDetails = Object.freeze({ }, }); -promise_test(async t => { +promise_test(async (t) => { const request = new PaymentRequest(defaultMethods, defaultDetails); const acceptPromise = request.show(); // Abort the request after 2 seconds if it has not rejected. This allows the @@ -46,62 +46,64 @@ promise_test(async t => { request.abort(); }, 2000); - await promise_rejects_dom(t, "SecurityError", acceptPromise); + await promise_rejects_dom(t, "NotAllowedError", acceptPromise); }, `Calling show() without being triggered by user interaction throws`); -promise_test(async t => { +promise_test(async (t) => { const request = new PaymentRequest(defaultMethods, defaultDetails); - const [acceptPromise] = await test_driver.bless( - "test: throws if the promise [[state]] is not 'created'", - () => { - const acceptPromise = request.show(); // Sets state to "interactive" - return [acceptPromise]; - }); + await test_driver.bless( + "test: throws if the promise [[state]] is not 'created'" + ); + const acceptPromise = request.show(); // Sets state to "interactive" + // No user activation... + await promise_rejects_dom(t, "NotAllowedError", request.show()); + + // Get user activation + await test_driver.bless( + "test: throws if the promise [[state]] is not 'created'" + ); await promise_rejects_dom(t, "InvalidStateError", request.show()); + await request.abort(); await promise_rejects_dom(t, "AbortError", acceptPromise); }, "Throws if the promise [[state]] is not 'created'."); -promise_test(async t => { +promise_test(async (t) => { const request1 = new PaymentRequest(defaultMethods, defaultDetails); const request2 = new PaymentRequest(defaultMethods, defaultDetails); - const [acceptPromise1] = await test_driver.bless( - `test: reject promise with "AbortedError" if payment request is already showing`, - async () => { - const acceptPromise1 = request1.show(); - const acceptPromise2 = request2.show(); - await promise_rejects_dom(t, "AbortError", acceptPromise2); - return [acceptPromise1]; - }); + + await test_driver.bless("payment request"); + const acceptPromise1 = request1.show(); + + // User activation consumed, so... + await promise_rejects_dom(t, "NotAllowedError", request2.show()); + + // Payment request already showing, so... + await test_driver.bless("payment request"); + await promise_rejects_dom(t, "AbortError", request2.show()); await request1.abort(); await promise_rejects_dom(t, "AbortError", acceptPromise1); }, `If the user agent's "payment request is showing" boolean is true, then return a promise rejected with an "AbortError" DOMException.`); -promise_test(async t => { +promise_test(async (t) => { const request = new PaymentRequest( [{ supportedMethods: "this-is-not-supported" }], defaultDetails ); - const [acceptPromise] = await test_driver.bless( - `test: reject promise with "NotSupportedError"`, - () => { - const acceptPromise = request.show(); - return [acceptPromise]; - }); + await test_driver.bless(`test: reject promise with "NotSupportedError"`); + const acceptPromise = request.show(); await promise_rejects_dom(t, "NotSupportedError", acceptPromise); }, `If payment method consultation produces no supported method of payment, then return a promise rejected with a "NotSupportedError" DOMException.`); -promise_test(async t => { +promise_test(async (t) => { const request = new PaymentRequest(defaultMethods, defaultDetails); - const [p1, p2, p3] = await test_driver.bless( - `test: calling show() multiple times always returns a new promise`, - () => { - const p1 = request.show(); - const p2 = request.show(); - const p3 = request.show(); - return [p1, p2, p3]; - }); + await test_driver.bless("call show()"); + const p1 = request.show(); + await test_driver.bless("call show()"); + const p2 = request.show(); + await test_driver.bless("call show()"); + const p3 = request.show(); const promises = new Set([p1, p2, p3]); assert_equals(promises.size, 3, "Must have three unique objects"); @@ -111,9 +113,13 @@ promise_test(async t => { await request.abort(); await promise_rejects_dom(t, "AbortError", p1); }, "Calling show() multiple times always returns a new promise."); - - If you find a buggy test, please file a bug - and tag one of the suggested reviewers. + If you find a buggy test, please + file a bug and + tag one of the + suggested reviewers. diff --git a/tests/wpt/web-platform-tests/payment-request/show-consume-activation.https.html b/tests/wpt/web-platform-tests/payment-request/show-consume-activation.https.html new file mode 100644 index 00000000000..0b92c4c15cf --- /dev/null +++ b/tests/wpt/web-platform-tests/payment-request/show-consume-activation.https.html @@ -0,0 +1,58 @@ + + + + + show() consumes user activation + + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/payment-request/show-method-optional-promise-rejects-manual.https.html b/tests/wpt/web-platform-tests/payment-request/show-method-optional-promise-rejects.https.html similarity index 51% rename from tests/wpt/web-platform-tests/payment-request/show-method-optional-promise-rejects-manual.https.html rename to tests/wpt/web-platform-tests/payment-request/show-method-optional-promise-rejects.https.html index 1a322452eb6..3b429655039 100644 --- a/tests/wpt/web-platform-tests/payment-request/show-method-optional-promise-rejects-manual.https.html +++ b/tests/wpt/web-platform-tests/payment-request/show-method-optional-promise-rejects.https.html @@ -1,15 +1,18 @@ - + Test for PaymentRequest.show(optional detailsPromise) method - + + + -

- PaymentRequest .show(optional detailsPromise) tests -

-

- Bad details - causes `detailsPromise` to reject. -

-

- Click on each button in sequence from top to bottom without refreshing the page. - No payment sheet should be shown, as all provided values cause an error. -

-

- - If you see a payment sheet, it means the test has failed. - -

-
    -
  1. -
  2. + const rejectedPromise = Promise.reject(new SyntaxError("test")); + testBadUpdate( + "Rejection of detailsPromise must abort the update with an 'AbortError' DOMException.", + rejectedPromise, + "AbortError" + ); -
  3. + testBadUpdate( + "Total in the update is a string, so converting to IDL must abort the update with a TypeError.", + { total: `this will cause a TypeError!` }, + TypeError + ); -
  4. + testBadUpdate( + "Total is recursive, so converting to IDL must abort the update with a TypeError.", + { total: recursiveData }, + TypeError + ); -
  5. + testBadUpdate( + "Updating with a negative total results in a TypeError.", + invalidDetailsNegativeTotal, + TypeError + ); -
  6. -
  7. + testBadUpdate( + "Updating with a displayItem with an invalid currency results in RangeError.", + { ...validDetails, displayItems: invalidPaymentItems }, + RangeError + ); -
  8. + testBadUpdate( + "Updating with duplicate shippingOptions (same IDs) results in a TypeError.", + { + ...validDetails, + shippingOptions: [validShippingOption, validShippingOption], + }, + TypeError + ); -
  9. - -
  10. - -
  11. -
- - - If you find a buggy test, please file a bug - and tag one of the suggested reviewers. - + }, + RangeError + ); + testBadUpdate( + "Must throw as Modifier has a recursive dictionary.", + { ...validDetails, modifiers: [modifierWithRecursiveData, validModifier] }, + TypeError + ); + diff --git a/tests/wpt/web-platform-tests/resources/chromium/mock-sms-receiver.js b/tests/wpt/web-platform-tests/resources/chromium/mock-sms-receiver.js deleted file mode 100644 index 903456d6830..00000000000 --- a/tests/wpt/web-platform-tests/resources/chromium/mock-sms-receiver.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -const SmsProvider = (() => { - - class MockWebOTPService { - - constructor() { - this.mojoReceiver_ = new blink.mojom.WebOTPServiceReceiver(this); - - this.interceptor_ = - new MojoInterfaceInterceptor(blink.mojom.WebOTPService.$interfaceName); - - this.interceptor_.oninterfacerequest = (e) => { - this.mojoReceiver_.$.bindHandle(e.handle); - } - this.interceptor_.start(); - - this.returnValues_ = {}; - } - - async receive() { - let call = this.returnValues_.receive ? - this.returnValues_.receive.shift() : null; - if (!call) - return; - return call(); - } - - async abort() {}; - - pushReturnValuesForTesting(callName, value) { - this.returnValues_[callName] = this.returnValues_[callName] || []; - this.returnValues_[callName].push(value); - return this; - } - } - - const mockWebOTPService = new MockWebOTPService(); - - class SmsProviderChromium { - constructor() { - Object.freeze(this); // Make it immutable. - } - - pushReturnValuesForTesting(callName, callback) { - mockWebOTPService.pushReturnValuesForTesting(callName, callback); - } - } - - return SmsProviderChromium; -})(); diff --git a/tests/wpt/web-platform-tests/resources/test-only-api.m.js b/tests/wpt/web-platform-tests/resources/test-only-api.m.js new file mode 100644 index 00000000000..984f635abac --- /dev/null +++ b/tests/wpt/web-platform-tests/resources/test-only-api.m.js @@ -0,0 +1,5 @@ +/* Whether the browser is Chromium-based with MojoJS enabled */ +export const isChromiumBased = 'MojoInterfaceInterceptor' in self; + +/* Whether the browser is WebKit-based with internal test-only API enabled */ +export const isWebKitBased = !isChromiumBased && 'internals' in self; diff --git a/tests/wpt/web-platform-tests/resources/test-only-api.m.js.headers b/tests/wpt/web-platform-tests/resources/test-only-api.m.js.headers new file mode 100644 index 00000000000..5e8f640c665 --- /dev/null +++ b/tests/wpt/web-platform-tests/resources/test-only-api.m.js.headers @@ -0,0 +1,2 @@ +Content-Type: text/javascript; charset=utf-8 +Cache-Control: max-age=3600 diff --git a/tests/wpt/web-platform-tests/resources/test/tests/functional/no-title.html b/tests/wpt/web-platform-tests/resources/test/tests/functional/no-title.html index 3458af44596..ae1333a0f7f 100644 --- a/tests/wpt/web-platform-tests/resources/test/tests/functional/no-title.html +++ b/tests/wpt/web-platform-tests/resources/test/tests/functional/no-title.html @@ -15,6 +15,7 @@ test(function(){assert_true(true, '1')}); test(()=>assert_true(true, '2')); test(() => assert_true(true, '3')); + test(() => assert_true(true, '3')); // test duplicate behaviour test(() => { assert_true(true, '4'); }); @@ -55,6 +56,12 @@ "properties": {}, "message": null }, + { + "status_string": "PASS", + "name": "assert_true(true, '3') 1", + "properties": {}, + "message": null + }, { "status_string": "PASS", "name": "Tests with no title 1", diff --git a/tests/wpt/web-platform-tests/resources/test/tox.ini b/tests/wpt/web-platform-tests/resources/test/tox.ini index a7a02e4b93b..c38b9f2749c 100644 --- a/tests/wpt/web-platform-tests/resources/test/tox.ini +++ b/tests/wpt/web-platform-tests/resources/test/tox.ini @@ -8,7 +8,7 @@ passenv=DISPLAY # Necessary for the spawned GeckoDriver process to connect to # the appropriate display. deps = html5lib - pytest>=2.9 + pytest>=2.9,<6 # pinned to <6 due to https://github.com/web-platform-tests/wpt/issues/26132 pyvirtualdisplay six requests diff --git a/tests/wpt/web-platform-tests/resources/testharness.js b/tests/wpt/web-platform-tests/resources/testharness.js index 85ffcf726af..4fb8cea0bcc 100644 --- a/tests/wpt/web-platform-tests/resources/testharness.js +++ b/tests/wpt/web-platform-tests/resources/testharness.js @@ -520,6 +520,8 @@ policies and contribution forms [3]. Object.prototype.toString.call(worker) == '[object ServiceWorker]'; } + var seen_func_name = Object.create(null); + function get_test_name(func, name) { if (name) { @@ -537,8 +539,17 @@ policies and contribution forms [3]. var trimmed = (arrow[1] !== undefined ? arrow[1] : arrow[2]).trim(); // drop trailing ; if there's no earlier ones trimmed = trimmed.replace(/^([^;]*)(;\s*)+$/, "$1"); - // ignore this if it's then empty - if (trimmed) return trimmed; + + if (trimmed) { + // add a suffix if we already have this string + if (seen_func_name[trimmed]) { + trimmed = trimmed + " " + seen_func_name[trimmed]; + seen_func_name[trimmed]++; + } else { + seen_func_name[trimmed] = 1; + } + return trimmed; + } } } diff --git a/tests/wpt/web-platform-tests/scroll-animations/element-based-offset-clamp.html b/tests/wpt/web-platform-tests/scroll-animations/element-based-offset-clamp.html index b1405074938..6467af199f1 100644 --- a/tests/wpt/web-platform-tests/scroll-animations/element-based-offset-clamp.html +++ b/tests/wpt/web-platform-tests/scroll-animations/element-based-offset-clamp.html @@ -7,25 +7,19 @@