mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
35 lines
835 B
HTML
35 lines
835 B
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<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"/>
|
|
</head>
|
|
<body>
|
|
<p id="display"></p>
|
|
<div id="content" style="display: none">
|
|
</div>
|
|
<pre id="test">
|
|
<script type="application/javascript">
|
|
|
|
/** Test for Power API **/
|
|
|
|
ok('mozPower' in navigator, "navigator.mozPower should exist");
|
|
|
|
/** Test permission **/
|
|
|
|
SpecialPowers.removePermission("power", document);
|
|
|
|
power = navigator.mozPower;
|
|
ok(!power, "Shouldn't be able to access power manager without permission.");
|
|
|
|
SpecialPowers.addPermission("power", true, document);
|
|
|
|
power = navigator.mozPower;
|
|
ok(power, "Shouldn be able to access power manager with permission.");
|
|
|
|
</script>
|
|
</pre>
|
|
</body>
|
|
</html>
|