Bug 1114713 - Fix intermittent test failures by removing a event-cycling setTimeout call. r=mikedeboer, a=test-only
authorMark Banner <standard8@mozilla.com>
Tue, 24 Feb 2015 13:17:29 +0000
changeset 250075 153da3594a3e
parent 250074 82ef773ccb71
child 250076 b5f695706683
push id4497
push userryanvm@gmail.com
push date2015-02-25 20:26 +0000
treeherdermozilla-beta@b23a690fa325 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer, test-only
bugs1114713
milestone37.0
Bug 1114713 - Fix intermittent test failures by removing a event-cycling setTimeout call. r=mikedeboer, a=test-only
browser/components/loop/test/desktop-local/contacts_test.js
browser/components/loop/test/desktop-local/panel_test.js
--- a/browser/components/loop/test/desktop-local/contacts_test.js
+++ b/browser/components/loop/test/desktop-local/contacts_test.js
@@ -12,17 +12,17 @@ describe("loop.contacts", function() {
   "use strict";
 
   var fakeAddContactButtonText = "Fake Add Contact";
   var fakeEditContactButtonText = "Fake Edit Contact";
   var fakeDoneButtonText = "Fake Done";
   var sandbox;
   var fakeWindow;
 
-  beforeEach(function(done) {
+  beforeEach(function() {
     sandbox = sinon.sandbox.create();
     navigator.mozLoop = {
       getStrings: function(entityName) {
         var textContentValue = "fakeText";
         if (entityName == "add_contact_button") {
           textContentValue = fakeAddContactButtonText;
         } else if (entityName == "edit_contact_title") {
           textContentValue = fakeEditContactButtonText;
@@ -34,18 +34,16 @@ describe("loop.contacts", function() {
     };
 
     fakeWindow = {
       close: sandbox.stub(),
     };
     loop.shared.mixins.setRootObject(fakeWindow);
 
     document.mozL10n.initialize(navigator.mozLoop);
-    // XXX prevent a race whenever mozL10n hasn't been initialized yet
-    setTimeout(done, 0);
   });
 
   afterEach(function() {
     loop.shared.mixins.setRootObject(window);
     sandbox.restore();
   });
 
 
--- a/browser/components/loop/test/desktop-local/panel_test.js
+++ b/browser/components/loop/test/desktop-local/panel_test.js
@@ -12,17 +12,17 @@ var sharedUtils = loop.shared.utils;
 
 describe("loop.panel", function() {
   "use strict";
 
   var sandbox, notifications;
   var fakeXHR, fakeWindow, fakeMozLoop;
   var requests = [];
 
-  beforeEach(function(done) {
+  beforeEach(function() {
     sandbox = sinon.sandbox.create();
     fakeXHR = sandbox.useFakeXMLHttpRequest();
     requests = [];
     // https://github.com/cjohansen/Sinon.JS/issues/393
     fakeXHR.xhr.onCreate = function (xhr) {
       requests.push(xhr);
     };
 
@@ -64,18 +64,16 @@ describe("loop.panel", function() {
         },
         on: sandbox.stub()
       },
       confirm: sandbox.stub(),
       notifyUITour: sandbox.stub()
     };
 
     document.mozL10n.initialize(navigator.mozLoop);
-    // XXX prevent a race whenever mozL10n hasn't been initialized yet
-    setTimeout(done, 0);
   });
 
   afterEach(function() {
     delete navigator.mozLoop;
     loop.shared.mixins.setRootObject(window);
     sandbox.restore();
   });