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

Unified Diff: LayoutTests/fast/dom/event-attrs-isolated-world.html

Issue 16904002: Avoid leaking objects between isolated worlds via attribute event listeners (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 7 years, 6 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/event-attrs-isolated-world-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/event-attrs-isolated-world.html
diff --git a/LayoutTests/fast/dom/event-attrs-isolated-world.html b/LayoutTests/fast/dom/event-attrs-isolated-world.html
new file mode 100644
index 0000000000000000000000000000000000000000..5271c5acaa400b39e325063bcbe133c479940d3b
--- /dev/null
+++ b/LayoutTests/fast/dom/event-attrs-isolated-world.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<body>
+<div onclick="console.log('clicked')">DOM wrappers should not leak across world boundaries via onevent attributes</div>
+<script>
+testRunner.dumpAsText();
+document.onload = document;
+testRunner.evaluateScriptInIsolatedWorld(1,
+ 'if (document.onload === null) {' +
+ ' console.log("PASS: Main world object not visible in isolated world");' +
+ '} else {' +
+ ' console.log("FAIL: Main world object visible in isolated world!");' +
+ '}' +
+ 'document.onload = document;' +
+ 'if (document.onload === document) {' +
+ ' console.log("PASS: Got back isolated world wrapper");' +
+ '} else {' +
+ ' console.log("FAIL! Got back:");' +
+ ' console.log(document.onload);' +
+ '}' +
+ 'if (document.querySelector("div").onclick === null) {' +
+ ' console.log("PASS: Declarative onclick handler did not leak to the isolated world");' +
+ '} else {' +
+ ' console.log("FAIL: onclick handler leaked to isolated world");' +
+ '}'
+);
+if (document.onload === document) {
+ console.log("PASS: Got back main world wrapper");
+} else {
+ console.log("FAIL! Got back:");
+ console.log(document.onload);
+}
+</script>
+</body>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/event-attrs-isolated-world-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698