|
1 <html> |
|
2 |
|
3 <head> |
|
4 <title>Accessible description change event testing</title> |
|
5 |
|
6 <link rel="stylesheet" type="text/css" |
|
7 href="chrome://mochikit/content/tests/SimpleTest/test.css" /> |
|
8 |
|
9 <script type="application/javascript" |
|
10 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
|
11 <script type="application/javascript" |
|
12 src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> |
|
13 |
|
14 <script type="application/javascript" |
|
15 src="../common.js"></script> |
|
16 <script type="application/javascript" |
|
17 src="../events.js"></script> |
|
18 <script type="application/javascript" |
|
19 src="../role.js"></script> |
|
20 <script type="application/javascript" |
|
21 src="../states.js"></script> |
|
22 |
|
23 <script type="application/javascript"> |
|
24 //////////////////////////////////////////////////////////////////////////// |
|
25 // Invokers |
|
26 |
|
27 function setAttr(aID, aAttr, aValue, aChecker) |
|
28 { |
|
29 this.eventSeq = [ aChecker ]; |
|
30 this.invoke = function setAttr_invoke() |
|
31 { |
|
32 getNode(aID).setAttribute(aAttr, aValue); |
|
33 } |
|
34 |
|
35 this.getID = function setAttr_getID() |
|
36 { |
|
37 return "set attr '" + aAttr + "', value '" + aValue + "'"; |
|
38 } |
|
39 } |
|
40 |
|
41 //////////////////////////////////////////////////////////////////////////// |
|
42 // Do tests |
|
43 |
|
44 //gA11yEventDumpToConsole = true; // debuggin |
|
45 |
|
46 var gQueue = null; |
|
47 function doTests() |
|
48 { |
|
49 gQueue = new eventQueue(); |
|
50 |
|
51 gQueue.push(new setAttr("tst1", "aria-describedby", "display", |
|
52 new invokerChecker(EVENT_DESCRIPTION_CHANGE, "tst1"))); |
|
53 gQueue.push(new setAttr("tst1", "title", "title", |
|
54 new unexpectedInvokerChecker(EVENT_DESCRIPTION_CHANGE, "tst1"))); |
|
55 |
|
56 gQueue.push(new setAttr("tst2", "title", "title", |
|
57 new invokerChecker(EVENT_NAME_CHANGE, "tst2"))); |
|
58 |
|
59 gQueue.invoke(); // Will call SimpleTest.finish(); |
|
60 } |
|
61 |
|
62 SimpleTest.waitForExplicitFinish(); |
|
63 addA11yLoadEvent(doTests); |
|
64 </script> |
|
65 </head> |
|
66 |
|
67 <body> |
|
68 |
|
69 <a target="_blank" |
|
70 href="https://bugzilla.mozilla.org/show_bug.cgi?id=991969" |
|
71 title="Event not fired when description changes"> |
|
72 Bug 991969 |
|
73 </a> |
|
74 |
|
75 <p id="display"></p> |
|
76 <div id="content" style="display: none"></div> |
|
77 <pre id="test"> |
|
78 </pre> |
|
79 |
|
80 <button id="tst1">btn1</button> |
|
81 <button id="tst2">btn2</button> |
|
82 |
|
83 <div id="eventdump"></div> |
|
84 </body> |
|
85 </html> |