Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 2 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /compute-pressure/compute_pressure_observe_unobserve_failure.https.any.html - WPT Dashboard Interop Dashboard
- /compute-pressure/compute_pressure_observe_unobserve_failure.https.any.sharedworker.html - WPT Dashboard Interop Dashboard
- /compute-pressure/compute_pressure_observe_unobserve_failure.https.any.worker.html - WPT Dashboard Interop Dashboard
// META: global=window,dedicatedworker,sharedworker
'use strict';
promise_test(async t => {
const observer =
new PressureObserver(t.unreached_func('oops should not end up here'));
t.add_cleanup(() => observer.disconnect());
await promise_rejects_js(t, TypeError, observer.observe('random'));
}, 'PressureObserver.observe() requires a valid source');
test(t => {
const observer =
new PressureObserver(t.unreached_func('oops should not end up here'));
t.add_cleanup(() => observer.disconnect());
assert_throws_js(TypeError, () => {
observer.unobserve('random');
});
}, 'PressureObserver.unobserve() requires a valid source');