Bug 1467256 - Wait until about:debugging UI in browser_application_panel_open-links.js;r=ladybenko draft
authorJulian Descottes <jdescottes@mozilla.com>
Thu, 05 Jul 2018 09:34:48 +0200
changeset 814794 cef5ccdcc3742cb1a26c2ec6fc0cedb69f4e8f15
parent 814212 69e1935d4562a0978ae5b2228b07399d809a8826
push id115348
push userjdescottes@mozilla.com
push dateFri, 06 Jul 2018 08:28:37 +0000
reviewersladybenko
bugs1467256
milestone63.0a1
Bug 1467256 - Wait until about:debugging UI in browser_application_panel_open-links.js;r=ladybenko MozReview-Commit-ID: 323WvitlWcy
devtools/client/application/test/browser_application_panel_open-links.js
devtools/server/actors/stylesheets.js
--- 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);