Bug 594002 - Make the window wide enough in session restore test browser_480148.js. r=zpao, a=test-only
authorMarkus Stange <mstange@themasta.com>
Wed, 24 Nov 2010 10:50:53 +0100
changeset 58137 c32ed22725099c6b24835780164a4afb73f8f522
parent 58136 a6b991eee6835067f20e7828f7c75793f808e3f6
child 58138 fad69d390b23731a2f05124bf5117e22ee10d18f
push id17174
push usermstange@themasta.com
push dateWed, 24 Nov 2010 09:57:48 +0000
treeherderautoland@fad69d390b23 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerszpao, test-only
bugs594002
milestone2.0b8pre
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 594002 - Make the window wide enough in session restore test browser_480148.js. r=zpao, a=test-only
browser/components/sessionstore/test/browser/browser_480148.js
--- a/browser/components/sessionstore/test/browser/browser_480148.js
+++ b/browser/components/sessionstore/test/browser/browser_480148.js
@@ -127,17 +127,19 @@ function test() {
           is(browserWindowsCount(), 1, "Only one browser window should be open eventually");
           finish();
         }
       },
 
       handleLoad: function (aEvent) {
         let _this = this;
         executeSoon(function () {
-          _this.window.resizeTo(_this.windowWidth, _this.window.outerHeight);
+          let extent = _this.window.outerWidth - _this.window.gBrowser.tabContainer.mTabstrip.scrollClientSize;
+          let windowWidth = _this.tabbarWidth + extent;
+          _this.window.resizeTo(windowWidth, _this.window.outerHeight);
           ss.setWindowState(_this.window, JSON.stringify(_this.state), true);
         });
       },
 
       // Implement nsIDOMEventListener for handling various window and tab events
       handleEvent: function (aEvent) {
         switch (aEvent.type) {
           case "load":
@@ -146,17 +148,17 @@ function test() {
           case "SSTabRestoring":
             this.handleSSTabRestoring(aEvent);
             break;
         }
       },
 
       // setup and actually run the test
       run: function () {
-        this.windowWidth = Math.floor((this.numTabsToShow - 0.5) * tabMinWidth);
+        this.tabbarWidth = Math.floor((this.numTabsToShow - 0.5) * tabMinWidth);
         this.window = openDialog(location, "_blank", "chrome,all,dialog=no");
         this.window.addEventListener("SSTabRestoring", this, false);
         this.window.addEventListener("load", this, false);
       }
     };
     test.run();
   }