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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/js/script-tests/cross-frame-bad-time.js

Issue 2295653002: Use window.testRunner in if-clause (Closed)
Patch Set: a Created 4 years, 3 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
OLDNEW
1 description( 1 description(
2 "Tests that having a bad time has correct cross frame behavior." 2 "Tests that having a bad time has correct cross frame behavior."
3 ); 3 );
4 4
5 if (window.testRunner) 5 if (window.testRunner)
6 testRunner.waitUntilDone(); 6 testRunner.waitUntilDone();
7 7
8 var ouches = 0; 8 var ouches = 0;
9 9
10 function foo(array) { 10 function foo(array) {
11 for (var i = 0; i < 100; ++i) 11 for (var i = 0; i < 100; ++i)
12 array[0] = true; 12 array[0] = true;
13 if (ouches == 100) 13 if (ouches == 100)
14 testPassed("Got 100 ouches."); 14 testPassed("Got 100 ouches.");
15 else 15 else
16 testFailed("Did not get 100 ouches. Got " + ouches + " instead."); 16 testFailed("Did not get 100 ouches. Got " + ouches + " instead.");
17 if (testRunner) 17 if (window.testRunner)
18 testRunner.notifyDone(); 18 testRunner.notifyDone();
19 } 19 }
20 20
21 var frame = document.getElementById("myframe"); 21 var frame = document.getElementById("myframe");
22 22
23 frame.contentDocument.open(); 23 frame.contentDocument.open();
24 frame.contentDocument.write( 24 frame.contentDocument.write(
25 "<!DOCTYPE html>\n<html><body><script type=\"text/javascript\">\n" + 25 "<!DOCTYPE html>\n<html><body><script type=\"text/javascript\">\n" +
26 "Array.prototype.__defineSetter__(0, function() { window.parent.ouches++; }) ;\n" + 26 "Array.prototype.__defineSetter__(0, function() { window.parent.ouches++; }) ;\n" +
27 "window.parent.foo([]);\n" + 27 "window.parent.foo([]);\n" +
28 "</script></body></html>"); 28 "</script></body></html>");
29 frame.contentDocument.close(); 29 frame.contentDocument.close();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698