File: test_bug372098.html

package info (click to toggle)
firefox 147.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,683,484 kB
  • sloc: cpp: 7,607,246; javascript: 6,533,185; ansic: 3,775,227; python: 1,415,393; xml: 634,561; asm: 438,951; java: 186,241; sh: 62,752; makefile: 18,079; objc: 13,092; perl: 12,808; yacc: 4,583; cs: 3,846; pascal: 3,448; lex: 1,720; ruby: 1,003; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10; exp: 6
file content (68 lines) | stat: -rw-r--r-- 1,657 bytes parent folder | download | duplicates (21)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<html xmlns="http://www.w3.org/1999/xhtml">
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=372098
-->
<head>
  <title>Test for Bug 372098</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>        
  <script src="/tests/SimpleTest/EventUtils.js"></script>        
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
  <base target="bug372098"></base>
</head>
<body>
  <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=372098">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>
    <map>
      <area id="area" shape="default" href="bug372098-link-target.html?area" target=""/>
    </map>
  </div>
  <pre id="test">
    <script class="testbody" type="text/javascript">

var a_passed = false;
var area_passed = false;

/* Start the test */

SimpleTest.waitForExplicitFinish();
addLoadEvent(handle_load);

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

/* Finish the test */

function finish_test()
{
  ok(a_passed, "The 'a' element used the correct target.");
  ok(area_passed, "The 'area' element used the correct target.");
  SimpleTest.finish();
}

/* Callback function used by the linked document */

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

    </script>
  </pre>

</body>
</html>