summaryrefslogtreecommitdiffstats
path: root/dom/power/test/test_power_basics.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /dom/power/test/test_power_basics.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/power/test/test_power_basics.html')
-rw-r--r--dom/power/test/test_power_basics.html40
1 files changed, 40 insertions, 0 deletions
diff --git a/dom/power/test/test_power_basics.html b/dom/power/test/test_power_basics.html
new file mode 100644
index 000000000..b78c99f48
--- /dev/null
+++ b/dom/power/test/test_power_basics.html
@@ -0,0 +1,40 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>Test for Power API</title>
+ <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"/>
+<script type="application/javascript">
+
+/** Test for Power API **/
+
+SimpleTest.waitForExplicitFinish();
+
+function startTest() {
+ doTest1();
+}
+
+function doTest1() {
+ window.frames[0].frameElement.setAttribute('onload', 'doTest3()');
+ power = window.frames[0].navigator.mozPower;
+ ok(power, "Should be able to access power manager with permission.");
+
+ window.frames[0].location.reload();
+}
+
+function doTest3() {
+ power = window.frames[0].navigator.mozPower;
+ ok(power, "Should be able to access power manager with permission.");
+ SimpleTest.finish();
+}
+</script>
+</head>
+<body>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+<iframe onload="startTest()"></iframe>
+<pre id="test">
+</pre>
+</body>
+</html>