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