Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / Window / post-message-crash.html
blob9f9a9f90bcd78dbe679dd6fda3e19a10deb28837
1 <!DOCTYPE html>
2 <html>
3 <body>
5 <p>This ensures that postMessage called in a callback does not crash.
7 <pre>FAIL</pre>
9 <script src="../../../resources/run-after-layout-and-paint.js"></script>
10 <script>
11 if (window.testRunner) {
12 testRunner.dumpAsText();
13 testRunner.waitUntilDone();
16 var n = 0;
18 window.onerror = function() {
19 if (++n === 2) {
20 document.querySelector('pre').textContent = 'PASS';
21 if (window.testRunner)
22 testRunner.notifyDone();
24 return true;
27 requestAnimationFrame(function() {
28 postMessage();
29 runAfterLayoutAndPaint(function() {
30 setTimeout(function() {
31 if (window.testRunner)
32 testRunner.notifyDone();
33 }, 50);
34 });
35 });
36 setTimeout(postMessage);
38 </script>
39 </body>
40 </html>