Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / parser / document-open-in-unload.html
blobbe6aa514de70d1883dd4754d00a7399319e1d487
1 <!DOCTYPE html>
2 <body>
3 <script src='../../resources/js-test.js'></script>
4 <script>
5 description('document.write inside onunload handler should not cause crash.');
6 jsTestIsAsync = true;
8 window.onload = function() {
9 var iframe = document.createElement('iframe');
10 var loadCount = 0;
11 iframe.addEventListener('load', function() {
12 ++ loadCount;
13 if (loadCount == 1) {
14 debug('iframe loaded successfully');
15 iframe.src = 'about:blank';
17 });
18 window.addEventListener('message', function() {
19 shouldBe('"Done"', 'event.data');
20 debug('iframe unloaded successfully');
21 document.body.removeChild(iframe);
22 finishJSTest();
23 });
25 iframe.src = 'resources/document-open-in-unload-inner.html';
26 document.body.appendChild(iframe);
28 </script>
29 <p>Test passes if it doesn't crash</p>
30 </body>