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

Unified Diff: LayoutTests/fast/dom/navigator-with-content-detached-no-crash.html

Issue 234583004: Fix a crash caused by calling detached navigator APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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/fast/dom/navigator-with-content-detached-no-crash-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/navigator-with-content-detached-no-crash.html
diff --git a/LayoutTests/fast/dom/navigator-with-content-detached-no-crash.html b/LayoutTests/fast/dom/navigator-with-content-detached-no-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..e9342bc7feeaa00ada8f97c0a81715cfcfc0c29d
--- /dev/null
+++ b/LayoutTests/fast/dom/navigator-with-content-detached-no-crash.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+<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.");
+
+window.jsTestIsAsync = true;
+
+function test() {
+ old_nav = window.frames[0].navigator;
+ var p = document.getElementById('subframe');
+ p.parentNode.removeChild(p);
+ check_navigator();
+
+ 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>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/navigator-with-content-detached-no-crash-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698