OLD | NEW |
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 Loading... |
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> |
OLD | NEW |