battery-promise-window.https.html (930B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>Battery Test: window.open() makes a different Navigator object</title> 4 <link rel="author" title="Intel" href="http://www.intel.com"> 5 <link rel="help" href="https://www.w3.org/TR/battery-status/"> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 <style> 9 #note { 10 background-color: #fef1b5; 11 border: solid 1px #cdab2d; 12 padding: 5px; 13 margin: 15px; 14 display: block; 15 } 16 </style> 17 <div id="note"> 18 Allow pop-up windows before running the tests. 19 </div> 20 <div id="log"></div> 21 <script> 22 async_test(function (t) { 23 var win = window.open('resources/support-window-open.html'); 24 window.onmessage = t.step_func(function(e) { 25 assert_array_equals(e.data, [false, false, true]); 26 win.close(); 27 t.done(); 28 }); 29 }, 'window.open() makes a different Navigator object thus getting another battery promise'); 30 </script>