OLD | NEW |
---|---|
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>Crash issue 338542</title> | 4 <title>Crash issue 338542</title> |
5 <script src="../../resources/js-test.js"></script> | 5 <script src="../../resources/js-test.js"></script> |
6 </head> | 6 </head> |
7 <body> | 7 <body> |
8 <script> | 8 <script> |
9 description('Should not crash if we load a test case from crbug.com/338542.'); | 9 description('Should not crash if we load a test case from crbug.com/338542.'); |
10 | 10 |
11 window.jsTestIsAsync = true; | 11 window.jsTestIsAsync = true; |
12 | 12 |
13 window.addEventListener('message', didReceiveMessage, false); | 13 window.addEventListener('message', didReceiveMessage, false); |
14 | 14 |
15 var iframe = document.createElement('iframe'); | 15 var iframe = document.createElement('iframe'); |
16 iframe.src = 'resources/window-open-insert-list-crash-iframe.html'; | 16 iframe.src = 'resources/window-open-insert-list-crash-iframe.html'; |
17 document.body.appendChild(iframe); | 17 document.body.appendChild(iframe); |
18 | 18 |
19 function didReceiveMessage(event) | 19 function didReceiveMessage(event) |
20 { | 20 { |
21 if (iframe === null) | |
22 return; | |
21 shouldBeEqualToString('event.data', 'FINISH'); | 23 shouldBeEqualToString('event.data', 'FINISH'); |
22 document.body.removeChild(iframe); | 24 document.body.removeChild(iframe); |
25 iframe = null; | |
dcheng
2014/10/20 18:35:14
Why is it important that this code only runs once
| |
23 testPassed('Did not crash.'); | 26 testPassed('Did not crash.'); |
24 window.finishJSTest(); | 27 window.finishJSTest(); |
25 } | 28 } |
26 </script> | 29 </script> |
27 </body> | 30 </body> |
28 </html> | 31 </html> |
OLD | NEW |