test_bug372098.html (1657B)
1 <html xmlns="http://www.w3.org/1999/xhtml"> 2 <!-- 3 https://bugzilla.mozilla.org/show_bug.cgi?id=372098 4 --> 5 <head> 6 <title>Test for Bug 372098</title> 7 <script src="/tests/SimpleTest/SimpleTest.js"></script> 8 <script src="/tests/SimpleTest/EventUtils.js"></script> 9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 10 <base target="bug372098"></base> 11 </head> 12 <body> 13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=372098">Mozilla Bug 372098</a> 14 <p id="display"></p> 15 <div id="content" style="display:none;"> 16 <iframe name="bug372098"></iframe> 17 <a id="a" href="bug372098-link-target.html?a" target="">link</a> 18 <map> 19 <area id="area" shape="default" href="bug372098-link-target.html?area" target=""/> 20 </map> 21 </div> 22 <pre id="test"> 23 <script class="testbody" type="text/javascript"> 24 25 var a_passed = false; 26 var area_passed = false; 27 28 /* Start the test */ 29 30 SimpleTest.waitForExplicitFinish(); 31 addLoadEvent(handle_load); 32 33 function handle_load() 34 { 35 sendMouseEvent({type:'click'}, 'a'); 36 } 37 38 /* Finish the test */ 39 40 function finish_test() 41 { 42 ok(a_passed, "The 'a' element used the correct target."); 43 ok(area_passed, "The 'area' element used the correct target."); 44 SimpleTest.finish(); 45 } 46 47 /* Callback function used by the linked document */ 48 49 function callback(tag) 50 { 51 switch (tag) { 52 case 'a': 53 a_passed = true; 54 sendMouseEvent({type:'click'}, 'area'); 55 return; 56 case 'area': 57 area_passed = true; 58 finish_test(); 59 return; 60 } 61 throw new Error("Eh??? We only test the 'a', 'link' and 'area' elements."); 62 } 63 64 </script> 65 </pre> 66 67 </body> 68 </html>