Bug 1317174 - Fix browser_bug719271.js to run multiple times in a single session r=jmaher
authormalayaleecoder <malayaleecoder@gmail.com>
Mon, 14 Nov 2016 23:45:14 +0530
changeset 438647 91db8a985f7fadecde63e3a4e20a4529fcdcc456
parent 438646 c0d0caa11f5a56edbede98532513861c61f7de34
child 438648 c6e0621b81552eb3c20275b3ae5c25e2f15db1eb
push id35794
push usersledru@mozilla.com
push dateMon, 14 Nov 2016 22:18:09 +0000
reviewersjmaher
bugs1317174, 719271
milestone52.0a1
Bug 1317174 - Fix browser_bug719271.js to run multiple times in a single session r=jmaher MozReview-Commit-ID: 6ekLWUV11pt
browser/base/content/test/general/browser_bug719271.js
--- a/browser/base/content/test/general/browser_bug719271.js
+++ b/browser/base/content/test/general/browser_bug719271.js
@@ -19,16 +19,22 @@ function test() {
     yield FullZoomHelper.load(gTab1, TEST_PAGE);
     yield FullZoomHelper.load(gTab2, TEST_VIDEO);
   }).then(zoomTab1, FullZoomHelper.failAndContinue(finish));
 }
 
 function zoomTab1() {
   Task.spawn(function* () {
     is(gBrowser.selectedTab, gTab1, "Tab 1 is selected");
+
+    //Reset zoom level if we run this test > 1 time in same browser session.
+    var level1 = ZoomManager.getZoomForBrowser(gBrowser.getBrowserForTab(gTab1));
+    if(level1 > 1)
+      FullZoom.reduce();
+
     FullZoomHelper.zoomTest(gTab1, 1, "Initial zoom of tab 1 should be 1");
     FullZoomHelper.zoomTest(gTab2, 1, "Initial zoom of tab 2 should be 1");
 
     FullZoom.enlarge();
     gLevel1 = ZoomManager.getZoomForBrowser(gBrowser.getBrowserForTab(gTab1));
 
     ok(gLevel1 > 1, "New zoom for tab 1 should be greater than 1");
     FullZoomHelper.zoomTest(gTab2, 1, "Zooming tab 1 should not affect tab 2");