Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(426)

Side by Side Diff: LayoutTests/battery-status/no-leak-on-detached-use.html

Issue 619583004: BatteryManager: release promise resolver once resolved. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Clear fresh resolved-resolver also Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/battery-status/no-leak-on-detached-use-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body onload="test()"> 6 <body onload="test()">
7 <div id="description"></div>
8 <div id="console"></div>
9 <script> 7 <script>
10 description("Check if calling detached navigator's APIs is safe."); 8 description("Check if calling navigator.getBattery() on a detached frame doesn't leak.");
11 9
12 window.jsTestIsAsync = true; 10 window.jsTestIsAsync = true;
13 11
14 function test() { 12 function test() {
15 old_nav = window.frames[0].navigator; 13 old_nav = window.frames[0].navigator;
16 var p = document.getElementById('subframe'); 14 var p = document.getElementById('subframe');
17 p.parentNode.removeChild(p); 15 p.parentNode.removeChild(p);
18 check_navigator(); 16 old_nav.getBattery();
19 17
20 testPassed('DONE'); 18 testPassed('DONE');
21 finishJSTest(); 19 finishJSTest();
22 } 20 }
23
24 function check_navigator() {
25 for (p in old_nav) {
26 if (typeof old_nav[p] === 'function') {
27 try {
28 var v = old_nav[p]();
29 } catch(err) {
30 }
31 }
32 }
33 }
34 </script> 21 </script>
35 <!-- iframe with some contents --> 22 <!-- iframe with some contents -->
36 <iframe src="data:text/html,<html></html>" id="subframe"></iframe> 23 <iframe src="data:text/html,<html></html>" id="subframe"></iframe>
37 </body> 24 </body>
38 </html> 25 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/battery-status/no-leak-on-detached-use-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698