Home | History | Annotate | Download | only in assets
      1 <p>This test checks for a NULL document crash that can happen when setting
      2 location. If the test passes, you'll see a PASS message below.</p>
      3 <hr>
      4 <pre id="pre"></pre>
      5 <iframe style="visibility:hidden" src="does-not-exist.bogus"></iframe> <!-- forces asynchronous load -->
      6 <script>
      7 <!--
      8 function log(s)
      9 {
     10     document.getElementById("pre").appendChild(document.createTextNode(s));
     11 }
     12 
     13 function test()
     14 {
     15     frames[0].location = "javascript:'<script>parent.pass()</script>'";
     16 }
     17 
     18 function pass()
     19 {
     20     log("PASS: You didn't crash.");
     21 
     22     if (window.layoutTestController)
     23         layoutTestController.notifyDone();
     24 }
     25 
     26 function main()
     27 {
     28     if (window.layoutTestController) {
     29         layoutTestController.dumpAsText();
     30         layoutTestController.waitUntilDone();
     31     }    
     32     
     33     // setTimeout forces execution in the context of the frame
     34     frames[0].setTimeout(test, 0);
     35 }
     36 
     37 main();
     38 -->
     39 </script>
     40