Backed out changesets e0632c6aca0b, b183597c0190, 0af4a28621f7, and 86321b26161d (bug 963366) for B2G desktop mochitest failures.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 11 Feb 2014 08:05:39 -0500
changeset 168125 59af72902abf147e4e8456e27e067a3253f34bfe
parent 168124 fadd94106932132a2021e1a19ed36a112058615f
child 168126 0e761732f86a0344ee1ef585f8945011b75c62fb
push id26197
push userryanvm@gmail.com
push dateTue, 11 Feb 2014 19:57:30 +0000
treeherdermozilla-central@802d87c77e76 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs963366
milestone30.0a1
backs oute0632c6aca0bbd0a38a17bb5c415981317f1f767
b183597c0190a289043be7309bc3f85cdf764d96
0af4a28621f7769d9f3f3017771edc20dc9a8aeb
86321b26161d74ab6328dd75db631c13ad86cb45
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
Backed out changesets e0632c6aca0b, b183597c0190, 0af4a28621f7, and 86321b26161d (bug 963366) for B2G desktop mochitest failures. CLOSED TREE
b2g/app/b2g.js
dom/browser-element/mochitest/priority/test_HighPriority.html
dom/power/moz.build
dom/power/test/browser_wakelocks.js
dom/power/test/mochitest.ini
dom/power/test/test_bug957893.html
dom/power/test/test_bug957899.html
dom/power/test/test_power_basics.html
dom/power/test/test_wakelock_not_exposed.html
dom/tests/mochitest/general/test_interfaces.html
dom/webidl/MozWakeLock.webidl
dom/webidl/Navigator.webidl
modules/libpref/src/init/all.js
testing/specialpowers/content/specialpowersAPI.js
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -880,11 +880,8 @@ pref("apz.pan_repaint_interval", 40);
 //
 // Using a software canvas can save memory when JS calls getImageData()
 // on the canvas frequently. See bug 884226.
 pref("gfx.canvas.willReadFrequently.enable", true);
 
 // Disable autofocus until we can have it not bring up the keyboard.
 // https://bugzilla.mozilla.org/show_bug.cgi?id=965763
 pref("browser.autofocus", false);
-
-// Enable wakelock
-pref("dom.wakelock.enabled", true);
--- a/dom/browser-element/mochitest/priority/test_HighPriority.html
+++ b/dom/browser-element/mochitest/priority/test_HighPriority.html
@@ -114,16 +114,15 @@ function runTest() {
 
   document.body.appendChild(iframe);
 }
 
 const priorityChangeGracePeriod = 100;
 addEventListener('testready', function() {
   SpecialPowers.pushPrefEnv(
     {set: [['dom.ipc.processPriorityManager.backgroundGracePeriodMS',
-            priorityChangeGracePeriod],
-           ['dom.wakelock.enabled', true]]},
+            priorityChangeGracePeriod]]},
     runTest);
 });
 
 </script>
 </body>
 </html>
--- a/dom/power/moz.build
+++ b/dom/power/moz.build
@@ -1,15 +1,16 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-TEST_DIRS += ['test']
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
+    TEST_DIRS += ['test']
 
 XPIDL_SOURCES += [
     'nsIDOMWakeLockListener.idl',
     'nsIPowerManagerService.idl',
 ]
 
 XPIDL_MODULE = 'dom_power'
 
--- a/dom/power/test/browser_wakelocks.js
+++ b/dom/power/test/browser_wakelocks.js
@@ -217,20 +217,17 @@ let gSteps = [
   },
 ];
 
 function runNextStep() {
   gCurStepIndex++;
   if (gCurStepIndex < gSteps.length) {
     gSteps[gCurStepIndex]();
   } else {
+    SpecialPowers.removePermission("power", kUrlSource);
     finish();
   }
 }
 
 function test() {
-  SpecialPowers.pushPermissions([
-    {type: "power", allow: true, context: kUrlSource}
-  ], function () {
-    SpecialPowers.pushPrefEnv({"set": [["dom.wakelock.enabled", true]]},
-                              runNextStep);
-  });
+  SpecialPowers.addPermission("power", true, kUrlSource);
+  runNextStep();
 }
--- a/dom/power/test/mochitest.ini
+++ b/dom/power/test/mochitest.ini
@@ -1,13 +1,8 @@
 [DEFAULT]
 
 [test_bug957893.html]
 [test_bug957899.html]
-[test_wakelock_not_exposed.html]
-skip-if = toolkit == "gonk"
 [test_power_basics.html]
 [test_power_set_cpusleepallowed.html]
-skip-if = toolkit != "gonk"
 [test_power_set_screen_brightness.html]
-skip-if = toolkit != "gonk"
 [test_power_set_screen_enabled.html]
-skip-if = toolkit != "gonk"
--- a/dom/power/test/test_bug957893.html
+++ b/dom/power/test/test_bug957893.html
@@ -2,23 +2,20 @@
 <html>
 <head>
   <title>Test bug 957893 - Crash in WakeLock</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
  <script type="application/javascript">
-  SimpleTest.waitForExplicitFinish();
-  function test() {
-    try {
-      var wl = navigator.requestWakeLock('');
-      ok(false, "RequestWakeLock throws an exception!");
-    } catch(e) {
-      ok(true, "RequestWakeLock throws an exception!");
-    }
-    info("Still alive!");
-    SimpleTest.finish();
-  }
-  SpecialPowers.pushPrefEnv({"set": [["dom.wakelock.enabled", true]]}, test);
+ try {
+   var wl = navigator.requestWakeLock('');
+   ok(false, "RequestWakeLock throws an exception!");
+ } catch(e) {
+   ok(true, "RequestWakeLock throws an exception!");
+ }
+
+ info("Still alive!");
+
  </script>
 </body>
 </html>
--- a/dom/power/test/test_bug957899.html
+++ b/dom/power/test/test_bug957899.html
@@ -2,19 +2,14 @@
 <html>
 <head>
   <title>Test bug 957899 - Crash in WakeLock</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
  <script type="application/javascript">
-  SimpleTest.waitForExplicitFinish();
-  function test() {
-    var wl = navigator.requestWakeLock('a');
-    ok(wl, "WakeLock created!");
-    ok(!(wl instanceof XPathEvaluator), "Crashing?");
-    SimpleTest.finish();
-  }
-  SpecialPowers.pushPrefEnv({"set": [["dom.wakelock.enabled", true]]}, test);
+ var wl = navigator.requestWakeLock('a');
+ ok(wl, "WakeLock created!");
+ ok(!(wl instanceof XPathEvaluator), "Crashing?");
  </script>
 </body>
 </html>
--- a/dom/power/test/test_power_basics.html
+++ b/dom/power/test/test_power_basics.html
@@ -3,29 +3,25 @@
 <head>
   <title>Test for Power API</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 <script type="application/javascript">
 
 /** Test for Power API **/
 
+ok('mozPower' in navigator, "navigator.mozPower should exist");
+
 /** Test permission **/
 // In b2g, addPermission 'power' is only working after a document reload
 // See bug 802312
 
 SimpleTest.waitForExplicitFinish();
 
 function startTest() {
-  SpecialPowers.pushPermissions([
-    {type: "power", allow: true, context: window.frames[0].document}
-  ], doTest1);
-}
-
-function doTest1() {
   window.frames[0].frameElement.setAttribute('onload', 'doTest2()');
   power = window.frames[0].navigator.mozPower;
   ok(power, "Should be able to access power manager with permission.");
 
   SpecialPowers.removePermission("power", window.frames[0].document);
   window.frames[0].location.reload();
 }
 
deleted file mode 100644
--- a/dom/power/test/test_wakelock_not_exposed.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!--
-    https://bugzilla.mozilla.org/show_bug.cgi?id=963366
--->
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test navigator.requestWakeLock is not exposed to non-B2G platform</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
- <script type="application/javascript">
-   ok(navigator.requestWakeLock === undefined,
-      "navigator.requestWakeLock is not exposed to non-B2G platform");
- </script>
-</body>
-</html>
--- a/dom/tests/mochitest/general/test_interfaces.html
+++ b/dom/tests/mochitest/general/test_interfaces.html
@@ -672,17 +672,17 @@ var interfaceNamesInGlobalScope =
     {name: "MozStkCommandEvent", b2g: true, pref: "dom.icc.enabled"},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "MozTimeManager", b2g: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "MozVoicemail", b2g: true, pref: "dom.voicemail.enabled"},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "MozVoicemailEvent", b2g: true, pref: "dom.voicemail.enabled"},
 // IMPORTANT: Do not change this list without review from a DOM peer!
-    {name: "MozWakeLock", b2g: true, pref: "dom.wakelock.enabled"},
+    "MozWakeLock",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "MozWifiConnectionInfoEvent", b2g: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "MozWifiStatusChangeEvent", b2g: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "MozWifiP2pGroupOwner", b2g: true, permission: "wifi-manage"},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "MozWifiP2pManager", b2g: true, permission: "wifi-manage"},
--- a/dom/webidl/MozWakeLock.webidl
+++ b/dom/webidl/MozWakeLock.webidl
@@ -1,15 +1,15 @@
 /* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-[Pref="dom.wakelock.enabled", Func="Navigator::HasWakeLockSupport"]
+[Func="Navigator::HasWakeLockSupport"]
 interface MozWakeLock
 {
     readonly attribute DOMString topic;
 
     /**
      * Release the wake lock.
      * @throw NS_ERROR_DOM_INVALID_STATE_ERR if already unlocked.
      */
--- a/dom/webidl/Navigator.webidl
+++ b/dom/webidl/Navigator.webidl
@@ -198,17 +198,17 @@ partial interface Navigator {
    * all locks on the topic have been released.
    *
    * The returned MozWakeLock object is a token of the lock.  You can
    * unlock the lock via the object's |unlock| method.  The lock is released
    * automatically when its associated window is unloaded.
    *
    * @param aTopic resource name
    */
-  [Throws, Pref="dom.wakelock.enabled", Func="Navigator::HasWakeLockSupport"]
+  [Throws, Func="Navigator::HasWakeLockSupport"]
   MozWakeLock requestWakeLock(DOMString aTopic);
 };
 
 // nsIDOMNavigatorDeviceStorage
 partial interface Navigator {
   [Throws, Pref="device.storage.enabled"]
   DeviceStorage? getDeviceStorage(DOMString type);
   [Throws, Pref="device.storage.enabled"]
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -4500,11 +4500,8 @@ pref("dom.inter-app-communication-api.en
 // The tables used for Safebrowsing phishing and malware checks.
 pref("urlclassifier.malware_table", "goog-malware-shavar");
 pref("urlclassifier.phish_table", "goog-phish-shavar");
 pref("urlclassifier.download_block_table", "");
 pref("urlclassifier.download_allow_table", "");
 
 // Turn off Spatial navigation by default.
 pref("snav.enabled", false);
-
-// Wakelock is disabled by default.
-pref("dom.wakelock.enabled", false);
--- a/testing/specialpowers/content/specialpowersAPI.js
+++ b/testing/specialpowers/content/specialpowersAPI.js
@@ -773,17 +773,17 @@ SpecialPowersAPI.prototype = {
       return;
     }
 
     /* Set lock and get prefs from the _pendingPrefs queue */
     this._applyingPermissions = true;
     var transaction = this._pendingPermissions.shift();
     var pendingActions = transaction[0];
     var callback = transaction[1];
-    var lastPermission = pendingActions[pendingActions.length-1];
+    lastPermission = pendingActions[pendingActions.length-1];
 
     var self = this;
     var os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
     this._permissionObserver._lastPermission = lastPermission;
     this._permissionObserver._callback = callback;
     this._permissionObserver._nextCallback = function () {
         self._applyingPermissions = false;
         // Now apply any permissions that may have been queued while we were applying