mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-13 20:14:57 -10:00
- make them both use .theme-twisty to show an arrow icon. - move some specifics stylings of SourcesTree to the base class. - make SourcesTree use the arrow React component provided by Tree class. - use .theme-twisty instead of .arrow (which already implements rotation and colors on expand). But it uses "open" instead of "expanded" classname. (VirtualizedTree was already using theme-twisty) This impacts the Source Tree, ObjectInspector (console, debugger), Watch Expressions, memory panel (dominator view). Differential Revision: https://phabricator.services.mozilla.com/D215637
71 lines
2.1 KiB
JavaScript
71 lines
2.1 KiB
JavaScript
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
"use strict";
|
|
|
|
// Check clicking on open-in-inspector icon does select the node in the inspector.
|
|
|
|
const HTML = `
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<body>
|
|
<h1>Select node in inspector test</h1>
|
|
</body>
|
|
<script>
|
|
function logNode(selector) {
|
|
console.log(document.querySelector(selector));
|
|
}
|
|
</script>
|
|
</html>
|
|
`;
|
|
const TEST_URI = "data:text/html;charset=utf-8," + encodeURI(HTML);
|
|
|
|
add_task(async function () {
|
|
const hud = await openNewTabAndConsole(TEST_URI);
|
|
const toolbox = hud.toolbox;
|
|
|
|
// Loading the inspector panel at first, to make it possible to listen for
|
|
// new node selections
|
|
await toolbox.loadTool("inspector");
|
|
const inspector = toolbox.getPanel("inspector");
|
|
|
|
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], () => {
|
|
content.wrappedJSObject.logNode("h1");
|
|
});
|
|
|
|
const msg = await waitFor(() => findConsoleAPIMessage(hud, "<h1>"));
|
|
const node = msg.querySelector(".objectBox-node");
|
|
Assert.notStrictEqual(node, null, "Node was logged as expected");
|
|
|
|
const openInInspectorIcon = node.querySelector(".open-inspector");
|
|
Assert.notStrictEqual(
|
|
openInInspectorIcon,
|
|
null,
|
|
"The is an open in inspector icon"
|
|
);
|
|
|
|
info(
|
|
"Clicking on the inspector icon and waiting for the " +
|
|
"inspector to be selected"
|
|
);
|
|
const onInspectorSelected = toolbox.once("inspector-selected");
|
|
const onInspectorUpdated = inspector.once("inspector-updated");
|
|
const onNewNode = toolbox.selection.once("new-node-front");
|
|
|
|
openInInspectorIcon.click();
|
|
|
|
await onInspectorSelected;
|
|
await onInspectorUpdated;
|
|
const nodeFront = await onNewNode;
|
|
|
|
ok(true, "Inspector selected and new node got selected");
|
|
is(nodeFront.displayName, "h1", "The expected node was selected");
|
|
|
|
is(
|
|
msg.querySelector(".theme-twisty").classList.contains("open"),
|
|
false,
|
|
"The object inspector wasn't expanded"
|
|
);
|
|
});
|