Bug 1466940 - Add logging of tabs in TPS to assist with investigating test failures; r=tcsc
authorDave Hunt <dhunt@mozilla.com>
Tue, 05 Jun 2018 21:49:59 +0100
changeset 421557 c7ee94e1b547524c8fc2453318a8919aca9139d0
parent 421556 0230fba6729437b268b4aa0fd87d413117b4088b
child 421558 223e5900fbbb2140fc274430efd281f5e2a9318a
push id34097
push usernbeleuzu@mozilla.com
push dateWed, 06 Jun 2018 16:59:16 +0000
treeherdermozilla-central@223e5900fbbb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstcsc
bugs1466940
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1466940 - Add logging of tabs in TPS to assist with investigating test failures; r=tcsc MozReview-Commit-ID: AW7RrtglYEN
services/sync/tps/extensions/tps/resource/modules/tabs.jsm
--- a/services/sync/tps/extensions/tps/resource/modules/tabs.jsm
+++ b/services/sync/tps/extensions/tps/resource/modules/tabs.jsm
@@ -7,16 +7,17 @@
    Only the following listed symbols will exposed on import, and only when
    and where imported. */
 
 const EXPORTED_SYMBOLS = ["BrowserTabs"];
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://services-sync/main.js");
 ChromeUtils.import("resource:///modules/sessionstore/TabStateFlusher.jsm");
+ChromeUtils.import("resource://tps/logger.jsm");
 
 // Unfortunately, due to where TPS is run, we can't directly reuse the logic from
 // BrowserTestUtils.jsm. Moreover, we can't resolve the URI it loads the content
 // frame script from ("chrome://mochikit/content/tests/BrowserTestUtils/content-utils.js"),
 // hence the hackiness here and in BrowserTabs.Add.
 Services
 .mm
 .loadFrameScript("data:application/javascript;charset=utf-8," + encodeURIComponent(`
@@ -75,13 +76,14 @@ var BrowserTabs = {
         continue;
       }
       for (let key in client.tabs) {
         let tab = client.tabs[key];
         let weaveTabUrl = tab.urlHistory[0];
         if (uri == weaveTabUrl && profile == client.clientName)
           if (title == undefined || title == tab.title)
             return true;
+        }
+        Logger.logInfo(`Dumping tabs for ${client.clientName}...\n` + JSON.stringify(client.tabs));
       }
-    }
     return false;
   },
 };