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

Side by Side Diff: LayoutTests/http/tests/security/isolatedWorld/dispatchEvent.html

Issue 13954010: Eliminate "temporary" and "uninitialized" isolated worlds (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <body> 3 <body>
4 <div id="console">Tests that event handler is called in correct world.<br></div> 4 <div id="console">Tests that event handler is called in correct world.<br></div>
5 5
6 <script id="isolatedScript0" type="isolated/world"> 6 <script id="isolatedScript0" type="isolated/world">
7 HTMLElement.prototype.world = "Isolated World 0"; 7 HTMLElement.prototype.world = "Isolated World 0";
8 function listener() 8 function listener()
9 { 9 {
10 log("in isoloated world 0: " + document.body.world); 10 log("in isoloated world 0: " + document.body.world);
(...skipping 28 matching lines...) Expand all
39 log("In main world: " + document.body.world); 39 log("In main world: " + document.body.world);
40 } 40 }
41 41
42 document.body.addEventListener("MessageEvent", listener, false); 42 document.body.addEventListener("MessageEvent", listener, false);
43 43
44 if (window.testRunner) { 44 if (window.testRunner) {
45 testRunner.dumpAsText(); 45 testRunner.dumpAsText();
46 // setup common functions in worlds 46 // setup common functions in worlds
47 for (var world = 0; world < 2; ++world) { 47 for (var world = 0; world < 2; ++world) {
48 var script = log.toString() + sendMessage.toString() + document.getEleme ntById("isolatedScript" + world).innerHTML; 48 var script = log.toString() + sendMessage.toString() + document.getEleme ntById("isolatedScript" + world).innerHTML;
49 testRunner.evaluateScriptInIsolatedWorld(world, script); 49 testRunner.evaluateScriptInIsolatedWorld(world + 1, script);
50 } 50 }
51 log("Sending from main world..."); 51 log("Sending from main world...");
52 sendMessage(); 52 sendMessage();
53 } 53 }
54 </script> 54 </script>
55 </body> 55 </body>
56 </html> 56 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698