diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /devtools/client/framework/test/browser_about-devtools-toolbox_load.js | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/framework/test/browser_about-devtools-toolbox_load.js')
-rw-r--r-- | devtools/client/framework/test/browser_about-devtools-toolbox_load.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/devtools/client/framework/test/browser_about-devtools-toolbox_load.js b/devtools/client/framework/test/browser_about-devtools-toolbox_load.js new file mode 100644 index 0000000000..f29a5b095b --- /dev/null +++ b/devtools/client/framework/test/browser_about-devtools-toolbox_load.js @@ -0,0 +1,31 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/** + * Test that about:devtools-toolbox shows error an page when opened with invalid + * paramters + */ +add_task(async function() { + // test that error is shown when missing `type` param + let { document, tab } = await openAboutToolbox({ invalid: "invalid" }); + await assertErrorIsShown(document); + await removeTab(tab); + // test that error is shown if `id` is not provided + ({ document, tab } = await openAboutToolbox({ type: "tab" })); + await assertErrorIsShown(document); + await removeTab(tab); + // test that error is shown if `remoteId` refers to an unexisting target + ({ document, tab } = await openAboutToolbox({ + type: "tab", + remoteId: "13371337", + })); + await assertErrorIsShown(document); + await removeTab(tab); + + async function assertErrorIsShown(doc) { + await waitUntil(() => doc.querySelector(".qa-error-page")); + ok(doc.querySelector(".qa-error-page"), "Error page is rendered"); + } +}); |