Bug 1286530 - Switch IdleObserver mochitests to chrome draft
authorAlexandre Lissy <lissyx@lissyx.dyndns.org>
Mon, 09 May 2016 13:05:40 +0200
changeset 387276 cf7faaf8e16f9eecb905e7b93ed90a667859ec87
parent 387275 cff75ebcca092a0622e2ebcff4039579bb7fc724
child 387277 ba0038200a56b51a914e7579ac345502a1fdb1dc
push id22914
push userbmo:lissyx+mozillians@lissyx.dyndns.org
push dateWed, 13 Jul 2016 15:39:24 +0000
bugs1286530
milestone50.0a1
Bug 1286530 - Switch IdleObserver mochitests to chrome MozReview-Commit-ID: 2P5IDiJn2Ci
dom/tests/mochitest/general/chrome.ini
dom/tests/mochitest/general/mochitest.ini
dom/tests/mochitest/general/test_idleapi_permissions.html
--- a/dom/tests/mochitest/general/chrome.ini
+++ b/dom/tests/mochitest/general/chrome.ini
@@ -1,9 +1,11 @@
 [DEFAULT]
 skip-if = buildapp == 'b2g' || os == 'android'
 
 [test_innerScreen.xul]
 [test_offsets.css]
 [test_offsets.js]
 [test_offsets.xul]
 skip-if = buildapp == 'mulet'
+[test_idleapi_permissions.html]
+skip-if = buildapp == 'b2g' || buildapp == 'mulet'
 [test_spacetopagedown.html]
--- a/dom/tests/mochitest/general/mochitest.ini
+++ b/dom/tests/mochitest/general/mochitest.ini
@@ -78,18 +78,16 @@ skip-if = buildapp == 'mulet'
 [test_focus_legend_noparent.html]
 [test_focusrings.xul]
 skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT
 [test_for_of.html]
 [test_frameElementWrapping.html]
 [test_pointerPreserves3D.html]
 [test_pointerPreserves3DClip.html]
 [test_framedhistoryframes.html]
-[test_idleapi_permissions.html]
-skip-if = buildapp == 'b2g' || buildapp == 'mulet'
 [test_img_mutations.html]
 [test_interfaces.html]
 skip-if = ((buildapp == 'mulet' || buildapp == 'b2g') && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
 # [test_network_events.html]
 # Disable this test until bug 795711 is fixed.
 [test_offsets.html]
 support-files = test_offsets.js
 [test_outerHTML.html]
--- a/dom/tests/mochitest/general/test_idleapi_permissions.html
+++ b/dom/tests/mochitest/general/test_idleapi_permissions.html
@@ -1,14 +1,14 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>Test for idle api permissions</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" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
 </head>
 <body>
 <p id="display"></p>
 <div id="content" style="display: none">
 </div>
 <pre id="test">
 <script type="application/javascript">
 
@@ -28,19 +28,16 @@ function doAddIdleObserver(obs) {
   i.remove();
   return added;
 }
 
 function run_test() {
   // addIdleObserver checks whether time is > 0.
   this.idleObserver.time = 100;
 
-  var added = doAddIdleObserver(this.idleObserver, false);
-  ok(!added, "Should not be able to add idle observer without permission");
-
   SpecialPowers.pushPermissions([{type: "idle", allow: true, context: document}], () => {
     added = doAddIdleObserver(this.idleObserver, true);
     ok(added, "Should be able to add idle observer with permission.");
     SimpleTest.finish();
   });
 }
 
 SimpleTest.waitForExplicitFinish();