author L. David Baron <>
Wed, 06 May 2009 13:46:04 -0700
changeset 28048 8f7b73d88f6bbedec99c6c8ef48b243ab922d05c
parent 100 59882c5c8b3a87d29e5888d406b9ad525f02dcf3
child 68428 1ebe64a0f85f20112c304864e811cbc82a0902a5
permissions -rw-r--r--
Switch HTML mochitests from using MochiKit.js to packed.js. (Bug 490955) r=sayrer

<html xmlns="">
  <title>Test for Bug 372098</title>
  <script type="text/javascript" src="/MochiKit/packed.js"></script>
  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>        
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
  <base target="bug372098"></base>
<body onload="handle_load();">
  <a target="_blank" href="">Mozilla Bug 372098</a>
  <p id="display"></p>
  <div id="content" style="display:none;">
    <iframe name="bug372098"></iframe>
    <a id="a" href="bug372098-link-target.html?a" target="">link</a>
    <link id="link" href="bug372098-link-target.html?link" target=""/>
      <area id="area" shape="default" href="bug372098-link-target.html?area" target=""/>
  <pre id="test">
    <script class="testbody" type="text/javascript">

var a_passed = false;
var link_passed = false;
var area_passed = false;

/* Start the test */

function handle_load()
  sendMouseEvent({type:'click'}, 'a');

/* Finish the test */

function finish_test()
  ok(a_passed, "The 'a' element used the correct target.");
  ok(link_passed, "The 'link' element used the correct target.");
  ok(area_passed, "The 'area' element used the correct target.");

/* Callback function used by the linked document */

function callback(tag)
  switch (tag) {
  case 'a':
    a_passed = true;
    sendMouseEvent({type:'click'}, 'link');
  case 'link':
    link_passed = true;
    sendMouseEvent({type:'click'}, 'area');
  case 'area':
    area_passed = true;
  throw new Error("Eh??? We only test the 'a', 'link' and 'area' elements.");