Home | History | Annotate | Download | only in beforeload
      1 <html>
      2 <head>
      3     <script src="resources/print.js"></script>
      4     <script>
      5         if (window.layoutTestController)
      6             layoutTestController.dumpAsText();
      7 
      8         document.addEventListener("beforeload", function(event) {
      9             print("PASS", "green");
     10             event.preventDefault();
     11         }, true);
     12         
     13         document.addEventListener("load", function(event) {
     14             print("FAIL", "red");
     15         }, true);
     16     </script>
     17 </head>
     18 <body>
     19     <div id="target"></div>
     20     <div id="console"></div>
     21     <script>
     22         document.getElementById("target").innerHTML = "<img src='../../images/resources/test-load.jpg'>";
     23     </script>
     24 </body>
     25 </html>
     26