Bug 1467256 - Wait until about:debugging UI in browser_application_panel_open-links.js;r=ladybenko
MozReview-Commit-ID: 323WvitlWcy
--- a/devtools/client/application/test/browser_application_panel_open-links.js
+++ b/devtools/client/application/test/browser_application_panel_open-links.js
@@ -30,12 +30,18 @@ add_task(async function() {
doc.querySelector(".js-trusted-link").click();
info("Opening link in a new tab.");
const newTab = await onTabLoaded;
// We only need to check that newTab is truthy since
// BrowserTestUtils.waitForNewTab checks the URL.
ok(newTab, "The expected tab was opened.");
+ info("Wait until the main about debugging container is available");
+ await waitUntil(() => {
+ const aboutDebuggingDoc = newTab.linkedBrowser.contentDocument;
+ return aboutDebuggingDoc.querySelector(".app");
+ });
+
// close the tab
info("Closing the tab.");
await BrowserTestUtils.removeTab(newTab);
});
--- a/devtools/server/actors/stylesheets.js
+++ b/devtools/server/actors/stylesheets.js
@@ -771,18 +771,18 @@ var StyleSheetsActor = protocol.ActorCla
return (async function() {
const doc = win.document;
// We have to set this flag in order to get the
// StyleSheetApplicableStateChanged events. See Document.webidl.
doc.styleSheetChangeEventsEnabled = true;
const isChrome =
Services.scriptSecurityManager.isSystemPrincipal(doc.nodePrincipal);
- const styleSheets =
- isChrome ? InspectorUtils.getAllStyleSheets(doc) : doc.styleSheets;
+ const documentOnly = !isChrome;
+ const styleSheets = InspectorUtils.getAllStyleSheets(doc, documentOnly);
let actors = [];
for (let i = 0; i < styleSheets.length; i++) {
const sheet = styleSheets[i];
if (!this._shouldListSheet(sheet)) {
continue;
}
const actor = this.parentActor.createStyleSheetActor(sheet);