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

Unified 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, 3 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/battery-status/no-leak-on-detached-use.html
diff --git a/LayoutTests/fast/dom/navigator-with-content-detached-no-crash.html b/LayoutTests/battery-status/no-leak-on-detached-use.html
similarity index 52%
copy from LayoutTests/fast/dom/navigator-with-content-detached-no-crash.html
copy to LayoutTests/battery-status/no-leak-on-detached-use.html
index e9342bc7feeaa00ada8f97c0a81715cfcfc0c29d..62e4e47995c404b3f49bd79672c8e7875643daed 100644
--- a/LayoutTests/fast/dom/navigator-with-content-detached-no-crash.html
+++ b/LayoutTests/battery-status/no-leak-on-detached-use.html
@@ -1,13 +1,11 @@
<!DOCTYPE html>
<html>
<head>
-<script src="../../resources/js-test.js"></script>
+<script src="../resources/js-test.js"></script>
</head>
<body onload="test()">
-<div id="description"></div>
-<div id="console"></div>
<script>
-description("Check if calling detached navigator's APIs is safe.");
+description("Check if calling navigator.getBattery() on a detached frame doesn't leak.");
window.jsTestIsAsync = true;
@@ -15,22 +13,11 @@ function test() {
old_nav = window.frames[0].navigator;
var p = document.getElementById('subframe');
p.parentNode.removeChild(p);
- check_navigator();
+ old_nav.getBattery();
testPassed('DONE');
finishJSTest();
}
-
-function check_navigator() {
- for (p in old_nav) {
- if (typeof old_nav[p] === 'function') {
- try {
- var v = old_nav[p]();
- } catch(err) {
- }
- }
- }
-}
</script>
<!-- iframe with some contents -->
<iframe src="data:text/html,<html></html>" id="subframe"></iframe>
« 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