Bug 719140 - native android reftests fail due to missing window.innerWidth/innerHeight. r=mfinkle
authorJoel Maher <jmaher@mozilla.com>
Wed, 18 Jan 2012 13:44:49 -0500
changeset 86028 e30e16f95cb08c0a28ff7731de249f882a250f27
parent 86027 6553d699ca34e64dbec22d26c8ae0e7e655d6893
child 86029 7736d47f8fab770803b227527364363a59ab2135
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs719140
milestone12.0a1
Bug 719140 - native android reftests fail due to missing window.innerWidth/innerHeight. r=mfinkle
layout/tools/reftest/bootstrap.js
--- a/layout/tools/reftest/bootstrap.js
+++ b/layout/tools/reftest/bootstrap.js
@@ -31,20 +31,23 @@ var windowListener = {
             let wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);
 
             // Load into any existing windows
             let enumerator = wm.getEnumerator("navigator:browser");
             while (enumerator.hasMoreElements()) {
                 let win = enumerator.getNext().QueryInterface(Components.interfaces.nsIDOMWindow);
                 setDefaultPrefs();
                 Components.utils.import("chrome://reftest/content/reftest.jsm");
-                win.addEventListener("UIReady", function() {OnRefTestLoad(win);});
+                win.addEventListener("pageshow", function() {
+                    win.removeEventListener("pageshow", arguments.callee); 
+                    // We add a setTimeout here because windows.innerWidth/Height are not set yet;
+                    win.setTimeout(function () {OnRefTestLoad(win);}, 0);
+                });
                 break;
             }
-
         }, false);
    },
    onCloseWindow: function(aWindow){ },
    onWindowTitleChange: function(){ },
 };
 
 function startup(aData, aReason) {
     let wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].