diff --git a/audio-output/setSinkId.https.html b/audio-output/setSinkId.https.html index fa4f48e2bcb60d..b1f703a9350bf5 100644 --- a/audio-output/setSinkId.https.html +++ b/audio-output/setSinkId.https.html @@ -13,7 +13,7 @@ promise_test(t => audio.setSinkId(""), "setSinkId on default audio output should always work"); -promise_test(t => promise_rejects(t, "NotFoundError", audio.setSinkId("nonexistent_device_id")), +promise_test(t => promise_rejects_dom(t, "NotFoundError", audio.setSinkId("nonexistent_device_id")), "setSinkId fails with NotFoundError on made up deviceid"); promise_test(async t => { diff --git a/background-fetch/fetch.https.window.js b/background-fetch/fetch.https.window.js index 1d28487dfe1324..1756a0e6e3fc32 100644 --- a/background-fetch/fetch.https.window.js +++ b/background-fetch/fetch.https.window.js @@ -170,7 +170,7 @@ backgroundFetchTest(async (test, backgroundFetch) => { // Very large download total that will definitely exceed the quota. const options = {downloadTotal: Number.MAX_SAFE_INTEGER}; - await promise_rejects( + await promise_rejects_dom( test, 'QUOTA_EXCEEDED_ERR', backgroundFetch.fetch(registrationId, 'resources/feature-name.txt', options), 'This fetch should have thrown a quota exceeded error'); diff --git a/battery-status/battery-disabled-by-feature-policy.https.sub.html b/battery-status/battery-disabled-by-feature-policy.https.sub.html index 515c64fe490fbf..9e6d685ff4288a 100644 --- a/battery-status/battery-disabled-by-feature-policy.https.sub.html +++ b/battery-status/battery-disabled-by-feature-policy.https.sub.html @@ -12,7 +12,7 @@ const header = 'Feature-Policy header {"battery" : []}'; promise_test(async t => { - await promise_rejects(t, 'NotAllowedError', navigator.getBattery()); + await promise_rejects_dom(t, 'NotAllowedError', navigator.getBattery()); }, `${header} disallows the top-level document.`); async_test(t => { diff --git a/battery-status/battery-disallowed-in-cross-origin-iframe.https.sub.html b/battery-status/battery-disallowed-in-cross-origin-iframe.https.sub.html index 8b48626b551141..097db219cf7947 100644 --- a/battery-status/battery-disallowed-in-cross-origin-iframe.https.sub.html +++ b/battery-status/battery-disallowed-in-cross-origin-iframe.https.sub.html @@ -21,7 +21,7 @@ const path = location.pathname.substring(0, location.pathname.lastIndexOf('/') + 1); const src = 'https://{{domains[www1]}}:{{ports[https][0]}}' + path + 'support-iframe.html'; iframe = await load_iframe(iframe, src); - await promise_rejects(t, 'NotAllowedError', iframe.contentWindow.navigator.getBattery()); + await promise_rejects_dom(t, 'NotAllowedError', iframe.contentWindow.navigator.getBattery()); }, "throw a 'NotAllowedError' when invoking navigator.getBattery() within cross-origin iframe"); diff --git a/battery-status/battery-insecure-context.html b/battery-status/battery-insecure-context.html index 9d2c9fd1d41dc2..336a094d6b90e0 100644 --- a/battery-status/battery-insecure-context.html +++ b/battery-status/battery-insecure-context.html @@ -21,7 +21,7 @@ diff --git a/bluetooth/characteristic/writeValue/buffer-is-detached.https.window.js b/bluetooth/characteristic/writeValue/buffer-is-detached.https.window.js index cefbb6ee8c349d..d900632c4b5090 100644 --- a/bluetooth/characteristic/writeValue/buffer-is-detached.https.window.js +++ b/bluetooth/characteristic/writeValue/buffer-is-detached.https.window.js @@ -13,11 +13,11 @@ bluetooth_test(async (t) => { const typed_array = Uint8Array.of(1, 2); detachBuffer(typed_array.buffer); - await promise_rejects( + await promise_rejects_dom( t, 'InvalidStateError', characteristic.writeValue(typed_array)); const array_buffer = Uint8Array.of(3, 4).buffer; detachBuffer(array_buffer); - await promise_rejects( + await promise_rejects_dom( t, 'InvalidStateError', characteristic.writeValue(array_buffer)); }, test_desc); diff --git a/bluetooth/descriptor/writeValue/buffer-is-detached.https.window.js b/bluetooth/descriptor/writeValue/buffer-is-detached.https.window.js index 2ff277ec9496e7..4fd3d661f7d9ac 100644 --- a/bluetooth/descriptor/writeValue/buffer-is-detached.https.window.js +++ b/bluetooth/descriptor/writeValue/buffer-is-detached.https.window.js @@ -13,11 +13,11 @@ bluetooth_test(async (t) => { const typed_array = Uint8Array.of(1, 2); detachBuffer(typed_array.buffer); - await promise_rejects( + await promise_rejects_dom( t, 'InvalidStateError', descriptor.writeValue(typed_array)); const array_buffer = Uint8Array.of(3, 4).buffer; detachBuffer(array_buffer); - await promise_rejects( + await promise_rejects_dom( t, 'InvalidStateError', descriptor.writeValue(array_buffer)); }, test_desc); diff --git a/clipboard-apis/async-write-image-read-image-manual.https.html b/clipboard-apis/async-write-image-read-image-manual.https.html index ad1dc4f83b047f..6381b453abfeb1 100644 --- a/clipboard-apis/async-write-image-read-image-manual.https.html +++ b/clipboard-apis/async-write-image-read-image-manual.https.html @@ -66,7 +66,7 @@ const invalidPngBlob = new Blob(['this text is not a valid png image'], {type: "image/png"}); const clipboardItemInput = new ClipboardItem({'image/png' : invalidPngBlob}); - await promise_rejects(t, "DataError", + await promise_rejects_dom(t, "DataError", navigator.clipboard.write([clipboardItemInput])); }, 'Verify write error on malformed data [image/png ClipboardItem]'); diff --git a/clipboard-apis/clipboard-item.https.html b/clipboard-apis/clipboard-item.https.html index 3a2ade564c785f..d9dcee76419cdb 100644 --- a/clipboard-apis/clipboard-item.https.html +++ b/clipboard-apis/clipboard-item.https.html @@ -86,7 +86,7 @@ promise_test(async t => { const item = new ClipboardItem({'text/plain': blob, 'not a/real type': blob2}); - promise_rejects(t, "NotFoundError", item.getType('type not in item')); - promise_rejects(t, "NotFoundError", item.getType('text/plain:subtype')); + promise_rejects_dom(t, "NotFoundError", item.getType('type not in item')); + promise_rejects_dom(t, "NotFoundError", item.getType('text/plain:subtype')); }, "getType(DOMString type) rejects correctly when querying for missing type"); diff --git a/content-security-policy/support/testharness-helper.js b/content-security-policy/support/testharness-helper.js index 0e68c7267a4ba4..291af74037aa25 100644 --- a/content-security-policy/support/testharness-helper.js +++ b/content-security-policy/support/testharness-helper.js @@ -136,7 +136,7 @@ function assert_service_worker_is_blocked(url, description) { assert_equals(e.violatedDirective, "worker-src"); assert_equals(e.effectiveDirective, "worker-src"); })), - promise_rejects(t, "SecurityError", navigator.serviceWorker.register(url, { scope: url })) + promise_rejects_dom(t, "SecurityError", navigator.serviceWorker.register(url, { scope: url })) ]); }, description); } diff --git a/credential-management/credentialscontainer-create-basics.https.html b/credential-management/credentialscontainer-create-basics.https.html index 93cbd2a5b8d891..ea2326c4ae48d9 100644 --- a/credential-management/credentialscontainer-create-basics.https.html +++ b/credential-management/credentialscontainer-create-basics.https.html @@ -4,12 +4,12 @@ diff --git a/css/css-animations/CSSAnimation-finished.tentative.html b/css/css-animations/CSSAnimation-finished.tentative.html index 57dd0d5020c9d6..da087b93e0efa5 100644 --- a/css/css-animations/CSSAnimation-finished.tentative.html +++ b/css/css-animations/CSSAnimation-finished.tentative.html @@ -31,7 +31,7 @@ div.style.animation = ''; getComputedStyle(div).animation; - await promise_rejects(t, 'AbortError', originalFinishedPromise, + await promise_rejects_dom(t, 'AbortError', originalFinishedPromise, 'finished promise is rejected with AbortError'); assert_not_equals(animation.finished, originalFinishedPromise, @@ -55,7 +55,7 @@ div.style.animation = 'def 100s'; getComputedStyle(div).animation; - await promise_rejects(t, 'AbortError', originalFinishedPromise, + await promise_rejects_dom(t, 'AbortError', originalFinishedPromise, 'finished promise is rejected with AbortError'); assert_not_equals(animation.finished, originalFinishedPromise, diff --git a/css/css-animations/CSSAnimation-ready.tentative.html b/css/css-animations/CSSAnimation-ready.tentative.html index f70ebd17003988..2a22760693de49 100644 --- a/css/css-animations/CSSAnimation-ready.tentative.html +++ b/css/css-animations/CSSAnimation-ready.tentative.html @@ -42,7 +42,7 @@ div.style.animation = ''; getComputedStyle(div).animation; - await promise_rejects(t, 'AbortError', readyPromise, + await promise_rejects_dom(t, 'AbortError', readyPromise, 'ready promise is rejected with AbortError'); }, 'ready promise is rejected when an animation is canceled by resetting' + ' the animation property'); @@ -64,7 +64,7 @@ div.style.animation = 'def 100s'; getComputedStyle(div).animation; - await promise_rejects(t, 'AbortError', readyPromise, + await promise_rejects_dom(t, 'AbortError', readyPromise, 'ready promise is rejected with AbortError'); }, 'ready promise is rejected when an animation is canceled by updating' + ' the animation property'); diff --git a/css/css-font-loading/font-face-reject.html b/css/css-font-loading/font-face-reject.html index 7b87a8121325f2..47456de443b3b4 100644 --- a/css/css-font-loading/font-face-reject.html +++ b/css/css-font-loading/font-face-reject.html @@ -10,7 +10,7 @@ promise_test(function(t) { var testFontFace = new FontFace('TestFontFace', 'local("nonexistentfont-9a1a9f78-c8d4-11e9-af16-448a5b2c326f")'); document.fonts.add(testFontFace); - return promise_rejects(t, 'NetworkError', testFontFace.loaded); + return promise_rejects_dom(t, 'NetworkError', testFontFace.loaded); })
diff --git a/css/css-fonts/format-specifiers-variations.html b/css/css-fonts/format-specifiers-variations.html index 8caf2f3d6000a2..480396ea16f81e 100644 --- a/css/css-fonts/format-specifiers-variations.html +++ b/css/css-fonts/format-specifiers-variations.html @@ -36,7 +36,7 @@ if (!expectFail) { return fontFace.load(); } else { - return promise_rejects(testDetails, "NetworkError", fontFace.load()); + return promise_rejects_dom(testDetails, "NetworkError", fontFace.load()); } }, (expectFail ? "Do not load" : "Load") + " Ahem with format " + formats[i], { "format": formats[i] diff --git a/css/geometry/structured-serialization.html b/css/geometry/structured-serialization.html index dcf4cdd0c5fd93..5c3e5dd93b3f26 100644 --- a/css/geometry/structured-serialization.html +++ b/css/geometry/structured-serialization.html @@ -160,6 +160,6 @@ promise_test((t) => { const object = document.getElementById('log').getClientRects(); - return promise_rejects(t, "DataCloneError", clone(object)); + return promise_rejects_dom(t, "DataCloneError", clone(object)); }, 'DOMRectList clone');0 diff --git a/feature-policy/reporting/encrypted-media-reporting.https.html b/feature-policy/reporting/encrypted-media-reporting.https.html index 6575a68ebd8eb0..1f891a57801d2e 100644 --- a/feature-policy/reporting/encrypted-media-reporting.https.html +++ b/feature-policy/reporting/encrypted-media-reporting.https.html @@ -22,7 +22,7 @@ new ReportingObserver((reports, observer) => resolve([reports, observer]), {types: ['feature-policy-violation']}).observe(); }); - await promise_rejects(t, "SecurityError", + await promise_rejects_dom(t, "SecurityError", navigator.requestMediaKeySystemAccess("org.w3.clearkey", [{ initDataTypes: ["webm"], diff --git a/feature-policy/reporting/midi-reporting.https.html b/feature-policy/reporting/midi-reporting.https.html index 94674a37a8106c..9e8a6ebf8e8f8d 100644 --- a/feature-policy/reporting/midi-reporting.https.html +++ b/feature-policy/reporting/midi-reporting.https.html @@ -22,7 +22,7 @@ new ReportingObserver((reports, observer) => resolve([reports, observer]), {types: ['feature-policy-violation']}).observe(); }); - await promise_rejects(t, 'SecurityError', navigator.requestMIDIAccess(), + await promise_rejects_dom(t, 'SecurityError', navigator.requestMIDIAccess(), "MIDI device access should not be allowed in this document."); const [reports, observer] = await report; check_report_format(reports, observer); diff --git a/feature-policy/reporting/picture-in-picture-reporting.html b/feature-policy/reporting/picture-in-picture-reporting.html index 567d68c3ea8bc4..d1c641d81d7cb2 100644 --- a/feature-policy/reporting/picture-in-picture-reporting.html +++ b/feature-policy/reporting/picture-in-picture-reporting.html @@ -36,7 +36,7 @@ }); const videoElement = await loadVideo(); await test_driver.bless('picture-in-picture'); - await promise_rejects(t, 'SecurityError', videoElement.requestPictureInPicture(), + await promise_rejects_dom(t, 'SecurityError', videoElement.requestPictureInPicture(), "Picture-in-Picture should not be allowed in this document."); const [reports, observer] = await report; check_report_format(reports, observer); diff --git a/feature-policy/reporting/vr-reporting.https.html b/feature-policy/reporting/vr-reporting.https.html index 42a2e7371ecf9c..b47f7e187eba0f 100644 --- a/feature-policy/reporting/vr-reporting.https.html +++ b/feature-policy/reporting/vr-reporting.https.html @@ -22,7 +22,7 @@ new ReportingObserver((reports, observer) => resolve([reports, observer]), {types: ['feature-policy-violation']}).observe(); }); - await promise_rejects(t, 'SecurityError', navigator.getVRDisplays(), + await promise_rejects_dom(t, 'SecurityError', navigator.getVRDisplays(), "VR device access should not be allowed in this document."); const [reports, observer] = await report; check_report_format(reports, observer); diff --git a/feature-policy/reporting/xr-reporting.https.html b/feature-policy/reporting/xr-reporting.https.html index edc75e824003c5..3d629235d73212 100644 --- a/feature-policy/reporting/xr-reporting.https.html +++ b/feature-policy/reporting/xr-reporting.https.html @@ -22,7 +22,7 @@ new ReportingObserver((reports, observer) => resolve([reports, observer]), {types: ['feature-policy-violation']}).observe(); }); - await promise_rejects(t, 'SecurityError', + await promise_rejects_dom(t, 'SecurityError', navigator.xr.isSessionSupported('immersive-vr'), "XR spatial tracking should not be allowed in this document."); const [reports, observer] = await report; diff --git a/fetch/api/abort/general.any.js b/fetch/api/abort/general.any.js index e6c8b66d4b1453..7c8d1b51cd4b07 100644 --- a/fetch/api/abort/general.any.js +++ b/fetch/api/abort/general.any.js @@ -28,7 +28,7 @@ promise_test(async t => { const fetchPromise = fetch('../resources/data.json', { signal }); - await promise_rejects(t, "AbortError", fetchPromise); + await promise_rejects_dom(t, "AbortError", fetchPromise); }, "Aborting rejects with AbortError"); promise_test(async t => { @@ -44,7 +44,7 @@ promise_test(async t => { mode: 'no-cors' }); - await promise_rejects(t, "AbortError", fetchPromise); + await promise_rejects_dom(t, "AbortError", fetchPromise); }, "Aborting rejects with AbortError - no-cors"); // Test that errors thrown from the request constructor take priority over abort errors. @@ -88,7 +88,7 @@ promise_test(async t => { const fetchPromise = fetch(request); - await promise_rejects(t, "AbortError", fetchPromise); + await promise_rejects_dom(t, "AbortError", fetchPromise); }, "Signal on request object"); promise_test(async t => { @@ -101,7 +101,7 @@ promise_test(async t => { const fetchPromise = fetch(requestFromRequest); - await promise_rejects(t, "AbortError", fetchPromise); + await promise_rejects_dom(t, "AbortError", fetchPromise); }, "Signal on request object created from request object"); promise_test(async t => { @@ -114,7 +114,7 @@ promise_test(async t => { const fetchPromise = fetch(requestFromRequest); - await promise_rejects(t, "AbortError", fetchPromise); + await promise_rejects_dom(t, "AbortError", fetchPromise); }, "Signal on request object created from request object, with signal on second request"); promise_test(async t => { @@ -127,7 +127,7 @@ promise_test(async t => { const fetchPromise = fetch(requestFromRequest); - await promise_rejects(t, "AbortError", fetchPromise); + await promise_rejects_dom(t, "AbortError", fetchPromise); }, "Signal on request object created from request object, with signal on second request overriding another"); promise_test(async t => { @@ -139,7 +139,7 @@ promise_test(async t => { const fetchPromise = fetch(request, {method: 'POST'}); - await promise_rejects(t, "AbortError", fetchPromise); + await promise_rejects_dom(t, "AbortError", fetchPromise); }, "Signal retained after unrelated properties are overridden by fetch"); promise_test(async t => { @@ -205,7 +205,7 @@ for (const bodyMethod of BODY_METHODS) { Promise.resolve().then(() => log.push('next-microtask')) ]); - await promise_rejects(t, "AbortError", bodyPromise); + await promise_rejects_dom(t, "AbortError", bodyPromise); assert_array_equals(log, [`${bodyMethod}-reject`, 'next-microtask']); }, `response.${bodyMethod}() rejects if already aborted`); @@ -252,7 +252,7 @@ promise_test(async t => { } for (const fetchPromise of fetches) { - await promise_rejects(t, "AbortError", fetchPromise); + await promise_rejects_dom(t, "AbortError", fetchPromise); } }, "Already aborted signal can be used for many fetches"); @@ -278,7 +278,7 @@ promise_test(async t => { } for (const fetchPromise of fetches) { - await promise_rejects(t, "AbortError", fetchPromise); + await promise_rejects_dom(t, "AbortError", fetchPromise); } }, "Signal can be used to abort other fetches, even if another fetch succeeded before aborting"); @@ -366,7 +366,7 @@ for (const bodyMethod of BODY_METHODS) { controller.abort(); - await promise_rejects(t, "AbortError", bodyPromise); + await promise_rejects_dom(t, "AbortError", bodyPromise); const start = Date.now(); @@ -394,8 +394,8 @@ promise_test(async t => { controller.abort(); - await promise_rejects(t, "AbortError", reader.read()); - await promise_rejects(t, "AbortError", reader.closed); + await promise_rejects_dom(t, "AbortError", reader.read()); + await promise_rejects_dom(t, "AbortError", reader.closed); // The connection won't close immediately, but it should close at some point: const start = Date.now(); @@ -425,8 +425,8 @@ promise_test(async t => { controller.abort(); - await promise_rejects(t, "AbortError", reader.read()); - await promise_rejects(t, "AbortError", reader.closed); + await promise_rejects_dom(t, "AbortError", reader.read()); + await promise_rejects_dom(t, "AbortError", reader.closed); // The connection won't close immediately, but it should close at some point: const start = Date.now(); @@ -488,7 +488,7 @@ promise_test(async t => { assert_equals(cancelReason.constructor, DOMException); assert_equals(cancelReason.name, 'AbortError'); - await promise_rejects(t, "AbortError", fetchPromise); + await promise_rejects_dom(t, "AbortError", fetchPromise); const fetchErr = await fetchPromise.catch(e => e); diff --git a/fetch/api/abort/serviceworker-intercepted.https.html b/fetch/api/abort/serviceworker-intercepted.https.html index a88aa896c90bd3..05eadefa4c8227 100644 --- a/fetch/api/abort/serviceworker-intercepted.https.html +++ b/fetch/api/abort/serviceworker-intercepted.https.html @@ -46,7 +46,7 @@ const fetchPromise = w.fetch('data.json', { signal }); - await promise_rejects(t, "AbortError", fetchPromise); + await promise_rejects_dom(t, "AbortError", fetchPromise); await w.fetch('data.json?no-abort'); @@ -76,7 +76,7 @@ Promise.resolve().then(() => log.push('next-microtask')) ]); - await promise_rejects(t, "AbortError", bodyPromise); + await promise_rejects_dom(t, "AbortError", bodyPromise); assert_array_equals(log, [`${bodyMethod}-reject`, 'next-microtask']); }, `response.${bodyMethod}() rejects if already aborted`); @@ -97,8 +97,8 @@ controller.abort(); - await promise_rejects(t, "AbortError", reader.read()); - await promise_rejects(t, "AbortError", reader.closed); + await promise_rejects_dom(t, "AbortError", reader.read()); + await promise_rejects_dom(t, "AbortError", reader.closed); }, "Stream errors once aborted."); diff --git a/geolocation-sensor/GeolocationSensor-disabled-by-feature-policy.https.html b/geolocation-sensor/GeolocationSensor-disabled-by-feature-policy.https.html index 688fc8c2237739..8fb9ea81b5eec4 100644 --- a/geolocation-sensor/GeolocationSensor-disabled-by-feature-policy.https.html +++ b/geolocation-sensor/GeolocationSensor-disabled-by-feature-policy.https.html @@ -11,7 +11,7 @@ run_fp_tests_disabled('GeolocationSensor'); promise_test(async t => { - await promise_rejects(t, 'SecurityError', GeolocationSensor.read()); + await promise_rejects_dom(t, 'SecurityError', GeolocationSensor.read()); }, "GeolocationSensor.read(): 'SecurityError' is thrown when disabled by Feature Policy"); promise_test(async t => { @@ -19,7 +19,7 @@ const signal = controller.signal; controller.abort(); - await promise_rejects(t, 'AbortError', GeolocationSensor.read({ signal })); + await promise_rejects_dom(t, 'AbortError', GeolocationSensor.read({ signal })); }, "GeolocationSensor.read(): 'AbortError' takes priority");