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

Side by Side 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: Properly refactored 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <div id="main"></div>
3 <div id="isolated"></div>
4 <script>
5 testRunner.dumpAsText();
6 console.log("Tests that properties of custom events are cloned when accessed in isolated worlds.");
abarth-chromium 2013/07/17 23:06:44 Why not just put this in a <p> ?
adamk 2013/07/17 23:45:10 Done.
7
8 function addListener(worldType) {
9 document.getElementById(worldType).addEventListener("CustomEvent", function( event) {
10 console.log("CustomEvent received in " + worldType + " world");
11 console.log("detail was " + JSON.stringify(event.detail));
12 });
13 }
14
15 function sendCloneableObject(targetWorldType) {
16 var newEvent = document.createEvent("CustomEvent");
17 newEvent.initCustomEvent("CustomEvent", false, false, { foo: 5, bar: 'hello' , targetWorld: targetWorldType });
18 document.getElementById(targetWorldType).dispatchEvent(newEvent);
19 }
20
21 var sendScript = "(" + sendCloneableObject.toString() + ")('main');";
22 addListener("main");
23 testRunner.evaluateScriptInIsolatedWorld(1, sendScript);
24 var receiveScript = "(" + addListener.toString() + ")('isolated');";
25 testRunner.evaluateScriptInIsolatedWorld(1, receiveScript);
26 sendCloneableObject("isolated");
27 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698