<!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>