|
1 <html> |
|
2 |
|
3 <head> |
|
4 <title>Accessible name 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-label", "hi", |
|
52 new invokerChecker(EVENT_NAME_CHANGE, "tst1"))); |
|
53 gQueue.push(new setAttr("tst1", "aria-labelledby", "display", |
|
54 new unexpectedInvokerChecker(EVENT_NAME_CHANGE, "tst1"))); |
|
55 gQueue.push(new setAttr("tst1", "alt", "alt", |
|
56 new unexpectedInvokerChecker(EVENT_NAME_CHANGE, "tst1"))); |
|
57 gQueue.push(new setAttr("tst1", "title", "title", |
|
58 new unexpectedInvokerChecker(EVENT_NAME_CHANGE, "tst1"))); |
|
59 |
|
60 gQueue.push(new setAttr("tst2", "aria-labelledby", "display", |
|
61 new invokerChecker(EVENT_NAME_CHANGE, "tst2"))); |
|
62 gQueue.push(new setAttr("tst2", "alt", "alt", |
|
63 new unexpectedInvokerChecker(EVENT_NAME_CHANGE, "tst2"))); |
|
64 gQueue.push(new setAttr("tst2", "title", "title", |
|
65 new unexpectedInvokerChecker(EVENT_NAME_CHANGE, "tst2"))); |
|
66 |
|
67 gQueue.push(new setAttr("tst3", "alt", "alt", |
|
68 new invokerChecker(EVENT_NAME_CHANGE, "tst3"))); |
|
69 gQueue.push(new setAttr("tst3", "title", "title", |
|
70 new unexpectedInvokerChecker(EVENT_NAME_CHANGE, "tst3"))); |
|
71 |
|
72 gQueue.push(new setAttr("tst4", "title", "title", |
|
73 new invokerChecker(EVENT_NAME_CHANGE, "tst4"))); |
|
74 |
|
75 gQueue.invoke(); // Will call SimpleTest.finish(); |
|
76 } |
|
77 |
|
78 SimpleTest.waitForExplicitFinish(); |
|
79 addA11yLoadEvent(doTests); |
|
80 </script> |
|
81 </head> |
|
82 |
|
83 <body> |
|
84 |
|
85 <a target="_blank" |
|
86 href="https://bugzilla.mozilla.org/show_bug.cgi?id=991969" |
|
87 title="Event not fired when description changes"> |
|
88 Bug 991969 |
|
89 </a> |
|
90 |
|
91 <p id="display"></p> |
|
92 <div id="content" style="display: none"></div> |
|
93 <pre id="test"> |
|
94 </pre> |
|
95 |
|
96 <img id="tst1"> |
|
97 <img id="tst2"> |
|
98 <img id="tst3"> |
|
99 <img id="tst4"> |
|
100 |
|
101 <div id="eventdump"></div> |
|
102 </body> |
|
103 </html> |