Bug 607821 - intermittent timeout toolkit/mozapps/extensions/test/browser/browser_bug557956.js | Test timed out. r=dtownsend, a=b7
authorRobert Strong <robert.bugzilla@gmail.com>
Fri, 29 Oct 2010 12:05:26 -0700
changeset 56692 0842ddc213a53ead56253c9c2f6ff20cb775eb2c
parent 56691 87e6cf44d4066ab1a0e581314448a4c40da70355
child 56693 4a093a3d6299662b1775e11e567122902f285e7f
push idunknown
push userunknown
push dateunknown
reviewersdtownsend, b7
bugs607821, 557956
milestone2.0b8pre
Bug 607821 - intermittent timeout toolkit/mozapps/extensions/test/browser/browser_bug557956.js | Test timed out. r=dtownsend, a=b7
toolkit/mozapps/extensions/content/update.xul
toolkit/mozapps/extensions/test/browser/browser_bug557956.js
toolkit/mozapps/extensions/test/browser/head.js
toolkit/mozapps/extensions/test/xpinstall/browser_multipackage.js
toolkit/mozapps/extensions/test/xpinstall/browser_relative.js
toolkit/mozapps/extensions/test/xpinstall/browser_signed_multiple.js
toolkit/mozapps/xpinstall/content/xpinstallConfirm.xul
--- a/toolkit/mozapps/extensions/content/update.xul
+++ b/toolkit/mozapps/extensions/content/update.xul
@@ -46,17 +46,17 @@
 <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
 %updateDTD;
 %brandDTD;
 ]>
 
 <wizard id="updateWizard"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         title="&updateWizard.title;"
-        windowtype="Update:Wizard"
+        windowtype="Addons:Compatibility"
         branded="true"
         onload="gUpdateWizard.init();"
         onwizardfinish="gUpdateWizard.onWizardFinish();"
         onclose="return gUpdateWizard.onWizardClose(event);"
         buttons="accept,cancel">
 
   <script type="application/javascript" src="chrome://mozapps/content/extensions/update.js"/>
   
--- a/toolkit/mozapps/extensions/test/browser/browser_bug557956.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_bug557956.js
@@ -97,16 +97,21 @@ function uninstall_test_addons(aCallback
       if (aAddon)
         aAddon.uninstall();
     });
     aCallback();
   });
 }
 
 function open_compatibility_window(aInactiveAddonIds, aCallback) {
+  // This will reset the longer timeout multiplier to 2 which will give each
+  // test that calls open_compatibility_window a minimum of 60 seconds to
+  // complete.
+  requestLongerTimeout(2);
+
   var variant = Cc["@mozilla.org/variant;1"].
                 createInstance(Ci.nsIWritableVariant);
   variant.setFromVariant(aInactiveAddonIds);
 
   // Cannot be modal as we want to interract with it, shouldn't cause problems
   // with testing though.
   var features = "chrome,centerscreen,dialog,titlebar";
   var ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].
--- a/toolkit/mozapps/extensions/test/browser/head.js
+++ b/toolkit/mozapps/extensions/test/browser/head.js
@@ -47,16 +47,29 @@ registerCleanupFunction(function() {
 
   // Throw an error if the add-ons manager window is open anywhere
   var windows = Services.wm.getEnumerator("Addons:Manager");
   if (windows.hasMoreElements())
     ok(false, "Found unexpected add-ons manager window still open");
   while (windows.hasMoreElements())
     windows.getNext().QueryInterface(Ci.nsIDOMWindow).close();
 
+  windows = Services.wm.getEnumerator("Addons:Compatibility");
+  if (windows.hasMoreElements())
+    ok(false, "Found unexpected add-ons compatibility window still open");
+  while (windows.hasMoreElements())
+    windows.getNext().QueryInterface(Ci.nsIDOMWindow).close();
+
+  windows = Services.wm.getEnumerator("Addons:Install");
+  if (windows.hasMoreElements())
+    ok(false, "Found unexpected add-ons installation window still open");
+  while (windows.hasMoreElements())
+    windows.getNext().QueryInterface(Ci.nsIDOMWindow).close();
+
+
   // We can for now know that getAllInstalls actually calls its callback before
   // it returns so this will complete before the next test start.
   AddonManager.getAllInstalls(function(aInstalls) {
     aInstalls.forEach(function(aInstall) {
       if (aInstall instanceof MockInstall)
         return;
 
       ok(false, "Should not have seen an install of " + aInstall.sourceURI.spec + " in state " + aInstall.state);
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_multipackage.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_multipackage.js
@@ -15,17 +15,17 @@ function get_item(items, name) {
     if (items[i].name == name)
       return items[i];
   }
   ok(false, "Item for " + name + " was not listed");
   return null;
 }
 
 function confirm_install(window) {
-  items = window.document.getElementById("itemList").childNodes;
+  let items = window.document.getElementById("itemList").childNodes;
   is(items.length, 2, "Should be 2 items listed in the confirmation dialog");
 
   let item = get_item(items, "XPI Test");
   if (item) {
     is(item.signed, "false", "Should not have listed the item as signed");
     is(item.icon, "", "Should have listed no icon for the item");
   }
 
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_relative.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_relative.js
@@ -16,17 +16,17 @@ function test() {
       toString: function() { return this.URL; }
     }
   }));
   gBrowser.selectedTab = gBrowser.addTab();
   gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
 }
 
 function confirm_install(window) {
-  items = window.document.getElementById("itemList").childNodes;
+  var items = window.document.getElementById("itemList").childNodes;
   is(items.length, 1, "Should only be 1 item listed in the confirmation dialog");
   is(items[0].name, "XPI Test", "Should have seen the name");
   is(items[0].url, TESTROOT + "unsigned.xpi", "Should have listed the correct url for the item");
   is(items[0].icon, TESTROOT + "icon.png", "Should have listed the correct icon for the item");
   is(items[0].signed, "false", "Should have listed the item as unsigned");
   return true;
 }
 
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_signed_multiple.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_signed_multiple.js
@@ -36,17 +36,17 @@ function confirm_install(window) {
                        getService(Components.interfaces.nsIStringBundleService);
   var bundle = sbs.createBundle("chrome://mozapps/locale/xpinstall/xpinstallConfirm.properties");
 
   var expectedIntroString = bundle.formatStringFromName("itemWarnIntroMultiple", ["5"], 1);
   
   var introStringNode = window.document.getElementById("itemWarningIntro");
   is(introStringNode.textContent, expectedIntroString, "Should have the correct intro string");
 
-  items = window.document.getElementById("itemList").childNodes;
+  var items = window.document.getElementById("itemList").childNodes;
   is(items.length, 5, "Should be 5 items listed in the confirmation dialog");
   let item = get_item(items, TESTROOT + "signed.xpi");
   if (item) {
     is(item.name, "Signed XPI Test", "Should have seen the name from the trigger list");
     is(item.cert, "(Object Signer)", "Should have seen the signer");
     is(item.signed, "true", "Should have listed the item as signed");
   }
   item = get_item(items, TESTROOT + "signed2.xpi");
--- a/toolkit/mozapps/xpinstall/content/xpinstallConfirm.xul
+++ b/toolkit/mozapps/xpinstall/content/xpinstallConfirm.xul
@@ -42,16 +42,17 @@
 <?xml-stylesheet href="chrome://mozapps/content/xpinstall/xpinstallConfirm.css" type="text/css"?>
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <?xml-stylesheet href="chrome://mozapps/skin/xpinstall/xpinstallConfirm.css" type="text/css"?>
 
 <!DOCTYPE dialog SYSTEM "chrome://mozapps/locale/xpinstall/xpinstallConfirm.dtd">
 
 <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         id="xpinstallConfirm" title="&dialog.title;" style="&dialog.style;" 
+        windowtype="Addons:Install"
         onload="XPInstallConfirm.init()" 
         ondialogaccept="return XPInstallConfirm.onOK();"
         ondialogcancel="return XPInstallConfirm.onCancel();">
 
   <script src="chrome://mozapps/content/xpinstall/xpinstallConfirm.js"/>
 
   <stringbundle id="xpinstallConfirmStrings" 
                 src="chrome://mozapps/locale/xpinstall/xpinstallConfirm.properties"/>