mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-13 20:14:57 -10:00
Automatic update from web-platform-tests [Multi Apps] Make list call forward compatible Changed the list call to return a dictionary with app-ids as keys which currently contains the app name in the values but can be updated to contain more information in the future without breaking backward compatibility. Bug: 1171317 Change-Id: I36dbc0af78dd4a01d5a76d0c312274770c6aee5e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3899114 Reviewed-by: Ivan Šandrk <[email protected]> Reviewed-by: Mike West <[email protected]> Commit-Queue: Sam Thiesen <[email protected]> Cr-Commit-Position: refs/heads/main@{#1060001} -- wpt-commits: 4c65973bb11b4ab053bc6f85e0d69bc58622e39a wpt-pr: 36373
47 lines
1.5 KiB
HTML
47 lines
1.5 KiB
HTML
<!DOCTYPE html>
|
|
<title>Sub Apps: Error cases for list()</title>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="resources/subapps-helpers.js"></script>
|
|
|
|
<body></body>
|
|
|
|
<script>
|
|
|
|
promise_test(async t => {
|
|
const iframe = document.createElement('iframe');
|
|
document.body.appendChild(iframe);
|
|
|
|
const iframeNavigator = iframe.contentWindow.navigator;
|
|
const iframeDOMException = iframe.contentWindow.DOMException;
|
|
|
|
// Detach the frame.
|
|
iframe.remove();
|
|
|
|
// At this point the iframe is detached and unloaded, and its execution
|
|
// context is gone.
|
|
await promise_rejects_dom(t, 'NotFoundError', iframeDOMException, iframeNavigator.subApps.list());
|
|
}, "The object is no longer associated to a document.");
|
|
|
|
promise_test(async t => {
|
|
const iframe = document.createElement('iframe');
|
|
document.body.appendChild(iframe);
|
|
|
|
const iframeNavigator = iframe.contentWindow.navigator;
|
|
const iframeDOMException = iframe.contentWindow.DOMException;
|
|
t.add_cleanup(() => iframe.remove());
|
|
|
|
await promise_rejects_dom(t, 'InvalidStateError', iframeDOMException, iframeNavigator.subApps.list());
|
|
}, "API is only supported in top-level browsing contexts.");
|
|
|
|
promise_test(async t => {
|
|
t.add_cleanup(async () => {
|
|
await mockSubAppsService.reset();
|
|
mockSubAppsService = null;
|
|
});
|
|
await createMockSubAppsService(Status.FAILURE, [], []);
|
|
return promise_rejects_dom(t, 'OperationError', navigator.subApps.list());
|
|
}, 'List call failed.');
|
|
|
|
</script>
|