Use shared classes for all toolbox iframes and splitters, and then have specific classes when the iframe/splitter is docked to the left/right/bottom, so they're easier to work with. Use Element#append and Element#remove instead of appendChild/removeChild Differential Revision: https://phabricator.services.mozilla.com/D312252
28 lines
873 B
JavaScript
28 lines
873 B
JavaScript
/* Any copyright is dedicated to the Public Domain.
|
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
const TEST_URL = "data:text/html,test browsertoolbox host";
|
|
|
|
add_task(async function () {
|
|
const {
|
|
Toolbox,
|
|
} = require("resource://devtools/client/framework/toolbox.js");
|
|
|
|
const tab = await addTab(TEST_URL);
|
|
const options = { doc: document };
|
|
const toolbox = await gDevTools.showToolboxForTab(tab, {
|
|
hostType: Toolbox.HostType.BROWSERTOOLBOX,
|
|
hostOptions: options,
|
|
});
|
|
|
|
is(toolbox.topWindow, window, "Toolbox is included in browser.xhtml");
|
|
const iframe = document.querySelector(
|
|
".devtools-toolbox-iframe.browsertoolbox-host"
|
|
);
|
|
ok(iframe, "A toolbox iframe was created in the provided document");
|
|
is(toolbox.doc, iframe.contentDocument, "Toolbox is in the custom iframe");
|
|
|
|
await toolbox.destroy();
|
|
iframe.remove();
|
|
});
|