mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1238133 - Part 7: Update test methods for opening the inspector sidebar panels r=bgrins
This commit is contained in:
parent
9b96d312be
commit
2e8a757385
@ -19,11 +19,11 @@ registerCleanupFunction(() => {
|
||||
* view is visible and ready
|
||||
*/
|
||||
function openComputedView() {
|
||||
return openInspectorSidebarTab("computedview").then(objects => {
|
||||
return openInspectorSidebarTab("computedview").then(({toolbox, inspector}) => {
|
||||
return {
|
||||
toolbox: objects.toolbox,
|
||||
inspector: objects.inspector,
|
||||
view: objects.view.view
|
||||
toolbox,
|
||||
inspector,
|
||||
view: inspector.computedview.view
|
||||
};
|
||||
});
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ var openFontInspectorForURL = Task.async(function*(url) {
|
||||
return {
|
||||
toolbox,
|
||||
inspector,
|
||||
view: inspector.sidebar.getWindowForTab("fontinspector").fontInspector
|
||||
view: inspector.fontInspector
|
||||
};
|
||||
});
|
||||
|
||||
|
@ -52,7 +52,7 @@ function selectAndHighlightNode(nodeOrSelector, inspector) {
|
||||
* view is visible and ready
|
||||
*/
|
||||
function openLayoutView() {
|
||||
return openInspectorSidebarTab("layoutview").then(objects => {
|
||||
return openInspectorSidebarTab("layoutview").then(({toolbox, inspector}) => {
|
||||
// The actual highligher show/hide methods are mocked in layoutview tests.
|
||||
// The highlighter is tested in devtools/inspector/test.
|
||||
function mockHighlighter({highlighter}) {
|
||||
@ -63,9 +63,13 @@ function openLayoutView() {
|
||||
return promise.resolve();
|
||||
};
|
||||
}
|
||||
mockHighlighter(objects.toolbox);
|
||||
mockHighlighter(toolbox);
|
||||
|
||||
return objects;
|
||||
return {
|
||||
toolbox,
|
||||
inspector,
|
||||
view: inspector.layoutview
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -48,11 +48,11 @@ addTab = function(url) {
|
||||
* view is visible and ready
|
||||
*/
|
||||
function openRuleView() {
|
||||
return openInspectorSidebarTab("ruleview").then(objects => {
|
||||
return openInspectorSidebarTab("ruleview").then(({toolbox, inspector}) => {
|
||||
return {
|
||||
toolbox: objects.toolbox,
|
||||
inspector: objects.inspector,
|
||||
view: objects.view.view
|
||||
toolbox,
|
||||
inspector,
|
||||
view: inspector.ruleview.view
|
||||
};
|
||||
});
|
||||
}
|
||||
|
@ -170,32 +170,15 @@ function getActiveInspector() {
|
||||
var openInspectorSidebarTab = Task.async(function*(id, hostType) {
|
||||
let {toolbox, inspector} = yield openInspector();
|
||||
|
||||
if (!hasSideBarTab(inspector, id)) {
|
||||
info("Waiting for the " + id + " sidebar to be ready");
|
||||
yield inspector.sidebar.once(id + "-ready");
|
||||
}
|
||||
|
||||
info("Selecting the " + id + " sidebar");
|
||||
inspector.sidebar.select(id);
|
||||
|
||||
return {
|
||||
toolbox: toolbox,
|
||||
inspector: inspector,
|
||||
view: inspector.sidebar.getWindowForTab(id)[id]
|
||||
toolbox,
|
||||
inspector
|
||||
};
|
||||
});
|
||||
|
||||
/**
|
||||
* Checks whether the inspector's sidebar corresponding to the given id already
|
||||
* exists
|
||||
* @param {InspectorPanel}
|
||||
* @param {String}
|
||||
* @return {Boolean}
|
||||
*/
|
||||
function hasSideBarTab(inspector, id) {
|
||||
return !!inspector.sidebar.getWindowForTab(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the NodeFront for a node that matches a given css selector, via the
|
||||
* protocol.
|
||||
|
Loading…
Reference in New Issue
Block a user