Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / js / script-tests / cross-frame-bad-time.js
blob29c49cd7abb74c443e027f3b25e1fb9868f981dc
1 description(
2 "Tests that having a bad time has correct cross frame behavior."
3 );
5 if (window.testRunner)
6 testRunner.waitUntilDone();
8 var ouches = 0;
10 function foo(array) {
11 for (var i = 0; i < 100; ++i)
12 array[0] = true;
13 if (ouches == 100)
14 testPassed("Got 100 ouches.");
15 else
16 testFailed("Did not get 100 ouches. Got " + ouches + " instead.");
17 if (testRunner)
18 testRunner.notifyDone();
21 var frame = document.getElementById("myframe");
23 frame.contentDocument.open();
24 frame.contentDocument.write(
25 "<!DOCTYPE html>\n<html><body><script type=\"text/javascript\">\n" +
26 "Array.prototype.__defineSetter__(0, function() { window.parent.ouches++; });\n" +
27 "window.parent.foo([]);\n" +
28 "</script></body></html>");
29 frame.contentDocument.close();