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

Side by Side Diff: LayoutTests/http/tests/security/isolatedWorld/world-reuse.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 <script> 4 <script>
5 if (window.testRunner) { 5 if (window.testRunner) {
6 testRunner.dumpAsText(); 6 testRunner.dumpAsText();
7 testRunner.waitUntilDone(); 7 testRunner.waitUntilDone();
8 8
9 // World id 0 is never saved, so this should print 'undefined'.
10 testRunner.evaluateScriptInIsolatedWorld(0, "var foo = 'foo';");
11 testRunner.evaluateScriptInIsolatedWorld(0,
12 "document.body.appendChild(document.createTextNode('Expecting undefined: ' + window.foo));" +
13 "document.body.appendChild(document.createElement('br'));");
14
15 // Since these two run in the same world, this should print 'bar'. 9 // Since these two run in the same world, this should print 'bar'.
16 testRunner.evaluateScriptInIsolatedWorld(1, "var bar = 'bar';"); 10 testRunner.evaluateScriptInIsolatedWorld(1, "var bar = 'bar';");
17 testRunner.evaluateScriptInIsolatedWorld(1, 11 testRunner.evaluateScriptInIsolatedWorld(1,
18 "document.body.appendChild(document.createTextNode('Expecting bar: ' + windo w.bar));" + 12 "document.body.appendChild(document.createTextNode('Expecting bar: ' + windo w.bar));" +
19 "document.body.appendChild(document.createElement('br'));"); 13 "document.body.appendChild(document.createElement('br'));");
20 14
21 // Since these two are in different worlds, this should print 'undefined'. 15 // Since these two are in different worlds, this should print 'undefined'.
22 testRunner.evaluateScriptInIsolatedWorld(2, "var baz = 'baz';"); 16 testRunner.evaluateScriptInIsolatedWorld(2, "var baz = 'baz';");
23 testRunner.evaluateScriptInIsolatedWorld(3, 17 testRunner.evaluateScriptInIsolatedWorld(3,
24 "document.body.appendChild(document.createTextNode('Expecting undefined: ' + window.baz));" + 18 "document.body.appendChild(document.createTextNode('Expecting undefined: ' + window.baz));" +
(...skipping 29 matching lines...) Expand all
54 document.body.appendChild(document.createTextNode('Expecting undefined,und efined: ' + result)); 48 document.body.appendChild(document.createTextNode('Expecting undefined,und efined: ' + result));
55 document.body.appendChild(document.createElement('br')); 49 document.body.appendChild(document.createElement('br'));
56 testRunner.notifyDone(); 50 testRunner.notifyDone();
57 } 51 }
58 iframe.contentWindow.location.reload(true); 52 iframe.contentWindow.location.reload(true);
59 } 53 }
60 } 54 }
61 </script> 55 </script>
62 </body> 56 </body>
63 </html> 57 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698