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

Unified Diff: LayoutTests/fast/events/init-custom-event-isolated-world.html

Issue 19457002: Make 'any'-typed attributes of events available in isolated worlds (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 7 years, 5 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
Index: LayoutTests/fast/events/init-custom-event-isolated-world.html
diff --git a/LayoutTests/fast/events/init-custom-event-isolated-world.html b/LayoutTests/fast/events/init-custom-event-isolated-world.html
new file mode 100644
index 0000000000000000000000000000000000000000..ccf3cb623ec7d8ceca01eb2cca7f27e47d1b344f
--- /dev/null
+++ b/LayoutTests/fast/events/init-custom-event-isolated-world.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<p>Tests that properties of CustomEvent initialized with initCustomEvent() are cloned when accessed in isolated worlds.</p>
+<div id="main"></div>
+<div id="isolated"></div>
+<script>
+testRunner.dumpAsText();
+
+function addListener(worldType) {
+ document.getElementById(worldType).addEventListener("CustomEvent", function(event) {
+ console.log("CustomEvent received in " + worldType + " world");
+ console.log("detail was " + JSON.stringify(event.detail));
+ });
+}
+
+function sendCloneableObject(targetWorldType) {
+ var newEvent = document.createEvent("CustomEvent");
+ newEvent.initCustomEvent("CustomEvent", false, false, { foo: 5, bar: 'hello', targetWorld: targetWorldType });
+ document.getElementById(targetWorldType).dispatchEvent(newEvent);
+}
+
+var sendScript = "(" + sendCloneableObject.toString() + ")('main');";
+addListener("main");
+testRunner.evaluateScriptInIsolatedWorld(1, sendScript);
+var receiveScript = "(" + addListener.toString() + ")('isolated');";
+testRunner.evaluateScriptInIsolatedWorld(1, receiveScript);
+sendCloneableObject("isolated");
+</script>

Powered by Google App Engine
This is Rietveld 408576698