Bug 984274 - Remove WebappsUpdateTimers in B2G mochitests. r=fabrice, a=test-only
authorAlfredo Yang <ayang@mozilla.com>
Mon, 30 Jun 2014 23:59:00 -0400
changeset 208994 d538f9245a44be74e20c1fb6d6295c29fd2f2272
parent 208993 4a5f3c7d07642d112bd44bb38270ca03793a03b0
child 208995 cb0c8492ff29639834d8f72f6b07f9bd33cf7a83
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfabrice, test-only
bugs984274
milestone32.0a2
Bug 984274 - Remove WebappsUpdateTimers in B2G mochitests. r=fabrice, a=test-only
b2g/components/test/mochitest/mochitest.ini
testing/mochitest/b2g_start_script.js
--- a/b2g/components/test/mochitest/mochitest.ini
+++ b/b2g/components/test/mochitest/mochitest.ini
@@ -2,13 +2,12 @@
 run-if = toolkit == "gonk"
 support-files =
   permission_handler_chrome.js
   SandboxPromptTest.html
   filepicker_path_handler_chrome.js
   systemapp_helper.js
 
 [test_sandbox_permission.html]
-skip-if = true # bug 984274 - frequent timeouts
 [test_filepicker_path.html]
 [test_permission_deny.html]
 [test_permission_gum_remember.html]
 [test_systemapp.html]
--- a/testing/mochitest/b2g_start_script.js
+++ b/testing/mochitest/b2g_start_script.js
@@ -4,27 +4,35 @@
 
 let outOfProcess = __marionetteParams[0]
 let mochitestUrl = __marionetteParams[1]
 let onDevice = __marionetteParams[2]
 let wifiSettings = __marionetteParams[3]
 let prefs = Components.classes["@mozilla.org/preferences-service;1"].
                             getService(Components.interfaces.nsIPrefBranch)
 let settings = window.navigator.mozSettings;
+let cm = Components.classes["@mozilla.org/categorymanager;1"].
+                    getService(Components.interfaces.nsICategoryManager);
 
 if (wifiSettings)
   wifiSettings = JSON.parse(wifiSettings);
 
 const CHILD_SCRIPT = "chrome://specialpowers/content/specialpowers.js";
 const CHILD_SCRIPT_API = "chrome://specialpowers/content/specialpowersAPI.js";
 const CHILD_LOGGER_SCRIPT = "chrome://specialpowers/content/MozillaLogger.js";
 
 let homescreen = document.getElementById('systemapp');
 let container = homescreen.contentWindow.document.getElementById('test-container');
 
+// Disable udpate timers which cause failure in b2g permisson prompt tests.
+if (cm) {
+  cm.deleteCategoryEntry("update-timer", "WebappsUpdateTimer", false);
+  cm.deleteCategoryEntry("update-timer", "nsUpdateService", false);
+}
+
 function openWindow(aEvent) {
   var popupIframe = aEvent.detail.frameElement;
   popupIframe.style = 'position: absolute; left: 0; top: 0px; background: white;';
 
   // This is to size the iframe to what is requested in the window.open call,
   // e.g. window.open("", "", "width=600,height=600");
   if (aEvent.detail.features.indexOf('width') != -1) {
     let width = aEvent.detail.features.substr(aEvent.detail.features.indexOf('width')+6);