Bug 806046 - Try to fix intermittent failure browser_bug719271.js. r=test
authorDrew Willcoxon <adw@mozilla.com>
Tue, 16 Apr 2013 14:46:48 -0700
changeset 129004 927fcd500c9b478715fbf0aca15b23a6f3d1f4ff
parent 129003 807f827f43e6491ec3c889cbe090b56669be8cac
child 129005 14810c6f3dde10bfa40317e66d3fc8d450254b2b
push id24553
push userryanvm@gmail.com
push dateWed, 17 Apr 2013 16:44:13 +0000
treeherdermozilla-central@3607139bd503 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstest
bugs806046, 719271
milestone23.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 806046 - Try to fix intermittent failure browser_bug719271.js. r=test
browser/base/content/test/browser_bug719271.js
--- a/browser/base/content/test/browser_bug719271.js
+++ b/browser/base/content/test/browser_bug719271.js
@@ -53,23 +53,31 @@ function zoomTab2() {
     FullZoomHelper.zoomTest(gTab1, gLevel1, "Tab 1 should have the same zoom after it's selected");
   }).then(testNavigation, FullZoomHelper.failAndContinue(finish));
 }
 
 function testNavigation() {
   Task.spawn(function () {
     yield FullZoomHelper.load(gTab1, TEST_VIDEO);
     FullZoomHelper.zoomTest(gTab1, 1, "Zoom should be 1 when a video was loaded");
+    yield waitForNextTurn(); // trying to fix orange bug 806046
     yield FullZoomHelper.navigate(FullZoomHelper.BACK);
     FullZoomHelper.zoomTest(gTab1, gLevel1, "Zoom should be restored when a page is loaded");
+    yield waitForNextTurn(); // trying to fix orange bug 806046
     yield FullZoomHelper.navigate(FullZoomHelper.FORWARD);
     FullZoomHelper.zoomTest(gTab1, 1, "Zoom should be 1 again when navigating back to a video");
   }).then(finishTest, FullZoomHelper.failAndContinue(finish));
 }
 
+function waitForNextTurn() {
+  let deferred = Promise.defer();
+  setTimeout(function () deferred.resolve(), 0);
+  return deferred.promise;
+}
+
 var finishTestStarted  = false;
 function finishTest() {
   Task.spawn(function () {
     ok(!finishTestStarted, "finishTest called more than once");
     finishTestStarted = true;
 
     yield FullZoomHelper.selectTabAndWaitForLocationChange(gTab1);
     yield FullZoomHelper.reset();