Bug 1286530 - Switch IdleObserver mochitests to chrome
MozReview-Commit-ID: 2P5IDiJn2Ci
--- 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();