Bug 990509 - Wait a second after tabs opening before finishing the sync operation. r=aeftimie, r=rnewman, a=test-only
authorCosmin Malutan <cosmin.malutan@softvision.ro>
Thu, 31 Jul 2014 00:54:00 -0400
changeset 208219 51f2c08f86ee
parent 208218 0ad2cb256eb8
child 208220 429123ab0700
push id3777
push userryanvm@gmail.com
push date2014-08-01 21:34 +0000
treeherdermozilla-beta@51f2c08f86ee [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaeftimie, rnewman, test-only
bugs990509
milestone32.0
Bug 990509 - Wait a second after tabs opening before finishing the sync operation. r=aeftimie, r=rnewman, a=test-only
services/sync/tps/extensions/tps/resource/tps.jsm
--- a/services/sync/tps/extensions/tps/resource/tps.jsm
+++ b/services/sync/tps/extensions/tps/resource/tps.jsm
@@ -295,17 +295,22 @@ let TPS = {
           // new tabs before continuing
           let that = this;
           let taburi = tab.uri;
           BrowserTabs.Add(tab.uri, function() {
             that._tabsFinished++;
             Logger.logInfo("tab for " + taburi + " finished loading");
             if (that._tabsFinished == that._tabsAdded) {
               Logger.logInfo("all tabs loaded, continuing...");
-              that.FinishAsyncOperation();
+
+              // Wait a second before continuing to be sure tabs can be synced,
+              // otherwise we can get 'error locating tab'
+              Utils.namedTimer(function () {
+                that.FinishAsyncOperation();
+              }, 1000, this, "postTabsOpening");
             }
           });
           break;
         case ACTION_VERIFY:
           Logger.AssertTrue(typeof(tab.profile) != "undefined",
             "profile must be defined when verifying tabs");
           Logger.AssertTrue(
             BrowserTabs.Find(tab.uri, tab.title, tab.profile), "error locating tab");