summaryrefslogtreecommitdiffstats
path: root/accessible/tests/mochitest/jsat/test_output.html
blob: 525642607036cae233877df3e6cc0bf0de585007 (plain)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=753984
-->
  <head>
    <title>[AccessFu] utterance order test</title>
    <meta charset="utf-8">
    <link rel="stylesheet" type="text/css"
          href="chrome://mochikit/content/tests/SimpleTest/test.css" />
    <script type="application/javascript"
            src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    <script type="application/javascript"
            src="../common.js"></script>
    <script type="application/javascript"
            src="./output.js"></script>
    <script type="application/javascript"
            src="./jsatcommon.js"></script>
    <script type="application/javascript">

      function doTest() {
        // Test the following accOrElmOrID (with optional old accOrElmOrID).
        // Note: each accOrElmOrID entry maps to a unique object utterance
        // generator function within the UtteranceGenerator.
        var tests = [{
          accOrElmOrID: "anchor",
          expectedUtterance: [[{"string": "link"}, "title"],
            ["title", {"string": "link"}]],
          expectedBraille: [[{"string": "linkAbbr"}, "title"],
            ["title", {"string": "linkAbbr"}]]
        }, {
          accOrElmOrID: "anchor_titleandtext",
          expectedUtterance: [[{"string": "link"}, "goes to the tests -",
            "Tests"], ["Tests", "- goes to the tests", {"string": "link"}]],
          expectedBraille:   [[{"string": "linkAbbr"}, "goes to the tests -",
            "Tests"], ["Tests", "- goes to the tests", {"string": "linkAbbr"}]],
        }, {
          accOrElmOrID: "anchor_duplicatedtitleandtext",
          expectedUtterance: [[{"string": "link"}, "Tests"],
            ["Tests", {"string": "link"}]],
          expectedBraille: [[{"string": "linkAbbr"}, "Tests"],
            ["Tests", {"string": "linkAbbr"}]]
        }, {
          accOrElmOrID: "anchor_arialabelandtext",
          expectedUtterance: [[{"string": "link"}, "goes to the tests - Tests"],
            ["Tests - goes to the tests", {"string": "link"}]],
          expectedBraille: [[{"string": "linkAbbr"},
            "goes to the tests - Tests"], ["Tests - goes to the tests",
            {"string": "linkAbbr"}]],
        }, {
          accOrElmOrID: "textarea",
          expectedUtterance: [[{"string": "textarea"},
            "This is the text area text."], ["This is the text area text.",
            {"string": "textarea"}]],
          expectedBraille: [[{"string": "textareaAbbr"},
            "This is the text area text."], ["This is the text area text.",
            {"string": "textareaAbbr"}]],
        }, {
          accOrElmOrID: "heading",
          expectedUtterance: [[{"string": "headingLevel", "args": [1]},
            "Test heading"], ["Test heading",
            {"string": "headingLevel", "args": [1]}]],
          expectedBraille: [[{"string": "headingAbbr"}, "Test heading"],
                            ["Test heading", {"string": "headingAbbr"}]]
        }, {
          accOrElmOrID: "list",
          expectedUtterance: [[{"string": "list"},
            {"string": "listItemsCount", "count":1}, {"string": "listStart"},
            "1.", "list one"], ["1.", "list one", {"string": "listStart"},
            {"string": "list"}, {"string": "listItemsCount", "count":1}]
          ],
          expectedBraille: [[{"string": "listAbbr"}, "list one"],
            ["list one", {"string": "listAbbr"}]]
        }, {
          accOrElmOrID: "dlist",
          expectedUtterance: [[{"string": "definitionlist"},
            {"string": "listItemsCount", "count": 0.5}, "dd one"], ["dd one",
            {"string": "definitionlist"},
            {"string": "listItemsCount", "count": 0.5}]
          ],
          expectedBraille: [[{"string": "definitionlistAbbr"}, "dd one"],
                            ["dd one", {"string": "definitionlistAbbr"}]]
        }, {
          accOrElmOrID: "li_one",
          expectedUtterance: [[{"string": "list"},
            {"string": "listItemsCount", "count": 1}, {"string": "listStart"},
            "1.", "list one"], ["1.", "list one", {"string": "listStart"},
            {"string": "list"}, {"string": "listItemsCount", "count": 1}]
          ],
          expectedBraille: [["1.", "list one"], ["1.", "list one"]]
        },
        {
          accOrElmOrID: "li_two",
          expectedUtterance: [[{"string": "list"},
            {"string": "listItemsCount", "count": 1}, {"string": "listStart"},
            "list two"], ["list two", {"string": "listStart"},
            {"string": "list"}, {"string": "listItemsCount", "count": 1}]
          ],
          expectedBraille: [["*", "list two"], ["*", "list two"]]
        }, {
          accOrElmOrID: "cell",
          expectedUtterance: [[{"string":"table"},
            {"string": "tblColumnInfo", "count": 1},
            {"string": "tblRowInfo", "count": 1}, "Fruits and vegetables",
            {"string": "columnInfo", "args": [1]},
            {"string": "rowInfo", "args": [1]}, {"string": "list"},
            {"string": "listItemsCount", "count": 4}, {"string": "listStart"},
            {"string": "link"}, "Apples", {"string": "link"}, "Bananas",
            {"string": "link"}, "Peaches", {"string": "listEnd"},
            {"string": "link"}, "Plums"], ["Apples", {"string": "link"},
            {"string": "listStart"}, "Bananas", {"string": "link"}, "Peaches",
            {"string": "link"}, "Plums", {"string": "link"},
            {"string": "listEnd"}, {"string": "list"},
            {"string": "listItemsCount", "count": 4},
            {"string": "columnInfo", "args": [1]},
            {"string": "rowInfo", "args": [1]}, "Fruits and vegetables",
            {"string":"table"}, {"string": "tblColumnInfo", "count": 1},
            {"string": "tblRowInfo", "count": 1}]],
          expectedBraille: [[{"string": "cellInfoAbbr", "args": [ 1, 1]},
            {"string": "listAbbr"}, {"string": "linkAbbr"}, "Apples",
            {"string": "linkAbbr"}, "Bananas", {"string": "linkAbbr"},
            "Peaches", {"string": "linkAbbr"}, "Plums"], ["Apples",
            {"string": "linkAbbr"}, "Bananas", {"string": "linkAbbr"},
            "Peaches", {"string": "linkAbbr"}, "Plums", {"string": "linkAbbr"},
            {"string": "listAbbr"},
            {"string": "cellInfoAbbr", "args": [ 1, 1]}]]
        }, {
          accOrElmOrID: "email",
          expectedUtterance: [[{"string": "textInputType_email"},
            {"string": "entry"}, "test@example.com"], ["test@example.com",
            {"string": "textInputType_email"}, {"string": "entry"}]],
          expectedBraille: [[{"string": "textInputType_email"},
            {"string": "entryAbbr"}, "test@example.com"], ["test@example.com",
            {"string": "textInputType_email"}, {"string": "entryAbbr"}]]
        }, {
          accOrElmOrID: "search",
          expectedUtterance: [[{"string": "textInputType_search"},
            {"string": "entry"}, "This is a search"], ["This is a search",
            {"string": "textInputType_search"}, {"string": "entry"}]],
          expectedBraille: [[{"string": "textInputType_search"},
            {"string": "entryAbbr"}, "This is a search"], ["This is a search",
            {"string": "textInputType_search"}, {"string": "entryAbbr"}]]
        }, {
          accOrElmOrID: "tel",
          expectedUtterance: [[{"string": "textInputType_tel"},
            {"string": "entry"}, "555-5555"], ["555-5555",
            {"string": "textInputType_tel"}, {"string": "entry"}]],
          expectedBraille: [[{"string": "textInputType_tel"},
            {"string": "entryAbbr"}, "555-5555"], ["555-5555",
            {"string": "textInputType_tel"}, {"string": "entryAbbr"}]]
        }, {
          accOrElmOrID: "url",
          expectedUtterance: [[{"string": "textInputType_url"},
            {"string": "entry"}, "http://example.com"], ["http://example.com",
            {"string": "textInputType_url"}, {"string": "entry"}]],
          expectedBraille: [[{"string": "textInputType_url"},
            {"string": "entryAbbr"}, "http://example.com"],
            ["http://example.com", {"string": "textInputType_url"},
            {"string": "entryAbbr"}]]
        }, {
          accOrElmOrID: "textInput",
          expectedUtterance: [[{"string": "entry"}, "This is text."],
                              ["This is text.", {"string": "entry"}]],
          expectedBraille: [[{"string": "entryAbbr"}, "This is text."],
                            ["This is text.", {"string": "entryAbbr"}]]
        }, {
          // Test pivot to list from li_one.
          accOrElmOrID: "list",
          oldAccOrElmOrID: "li_one",
          expectedUtterance: [[{"string": "list"},
            {"string": "listItemsCount", "count": 1}, {"string": "listStart"},
            "1.", "list one"], ["1.", "list one", {"string": "listStart"},
            {"string": "list"}, {"string": "listItemsCount", "count": 1}]
          ],
          expectedBraille: [[{"string": "listAbbr"}, "list one"],
                            ["list one", {"string": "listAbbr"}]]
        }, {
          // Test pivot to "apples" link from the table cell.
          accOrElmOrID: "apples",
          oldAccOrElmOrID: "cell",
          expectedUtterance: [[{"string": "list"},
            {"string": "listItemsCount", "count": 4}, {"string": "listStart"},
            {"string": "link"}, "Apples"], ["Apples", {"string": "link"},
            {"string": "listStart"}, {"string": "list"},
            {"string": "listItemsCount", "count": 4}]
          ],
          expectedBraille: [["*", {"string": "linkAbbr"}, "Apples"],
                            ["*", "Apples", {"string": "linkAbbr"}]]
        }, {
          // Test pivot to "bananas" link from "apples" link.
          accOrElmOrID: "bananas",
          oldAccOrElmOrID: "apples",
          expectedUtterance: [[{"string": "link"}, "Bananas"],
                              ["Bananas", {"string": "link"}]],
          expectedBraille: [["*", {"string": "linkAbbr"}, "Bananas"],
                            ["*", "Bananas", {"string": "linkAbbr"}]]
        }, {
          // test unavailable state utterance
          accOrElmOrID: "unavailableButton",
          expectedUtterance: [[{"string": "stateUnavailable"},
            {"string": "pushbutton"}, "I am unavailable"], ["I am unavailable",
            {"string": "stateUnavailable"}, {"string": "pushbutton"}]],
          expectedBraille: [[{"string": "pushbuttonAbbr"}, "I am unavailable"],
                            ["I am unavailable", {"string": "pushbuttonAbbr"}]]
        }, {
          // test expanded state utterance
          accOrElmOrID: "expandedButton",
          expectedUtterance: [[{"string": "stateExpanded"},
            {"string": "pushbutton"}, "I am expanded"], ["I am expanded",
            {"string": "stateExpanded"}, {"string": "pushbutton"}]],
          expectedBraille: [[{"string": "pushbuttonAbbr"}, "I am expanded"],
                            ["I am expanded", {"string": "pushbuttonAbbr"}]]
        }, {
          // test collapsed state utterance
          accOrElmOrID: "collapsedButton",
          expectedUtterance: [[{"string": "stateCollapsed"},
            {"string": "pushbutton"}, "I am collapsed"], ["I am collapsed",
            {"string": "stateCollapsed"}, {"string": "pushbutton"}]],
          expectedBraille: [[{"string": "pushbuttonAbbr"}, "I am collapsed"],
                            ["I am collapsed", {"string": "pushbuttonAbbr"}]]
        }, {
          // test required state utterance
          accOrElmOrID: "requiredInput",
          expectedUtterance: [[{"string": "stateRequired"}, {"string": "entry"},
            "I am required"], ["I am required", {"string": "stateRequired"},
            {"string": "entry"}]],
          expectedBraille: [[{"string": "entryAbbr"}, "I am required"],
                            ["I am required", {"string": "entryAbbr"}]]
        }, {
          // test unavailable state utterance on inputs
          accOrElmOrID: "readonlyInput",
          expectedUtterance: [[{"string": "stateReadonly"}, {"string": "entry"},
            "No edits"], ["No edits", {"string": "stateReadonly"},
            {"string": "entry"}]],
          expectedBraille: [[{"string": "entryAbbr"}, "No edits"],
                            ["No edits", {"string": "entryAbbr"}]]
        }, {
          // test unavailable state utterance on textareas
          accOrElmOrID: "readonlyTextarea",
          expectedUtterance: [[{"string": "stateReadonly"}, {"string": "textarea"},
            "No editing"], ["No editing", {"string": "stateReadonly"},
            {"string": "textarea"}]],
          expectedBraille: [[{"string": "textareaAbbr"}, "No editing"],
                            ["No editing", {"string": "textareaAbbr"}]]
        }, {
          // test has popup state utterance
          accOrElmOrID: "hasPopupButton",
          expectedUtterance: [[{"string": "stateHasPopup"},
            {"string": "buttonmenu"}, "I have a popup"], ["I have a popup",
            {"string": "stateHasPopup"}, {"string": "buttonmenu"}]],
          expectedBraille: [[{"string": "buttonmenuAbbr"}, "I have a popup"],
                            ["I have a popup", {"string": "buttonmenuAbbr"}]]
        }, {
          // Test selected tab
          accOrElmOrID: "tab1",
          expectedUtterance: [[{"string": "pagetablist"},
            {"string": "stateSelected"}, {"string": "pagetab"},
            {"string": "objItemOfN", "args": [1, 2]}, "Account"], ["Account",
            {"string": "stateSelected"}, {"string": "pagetab"},
            {"string": "objItemOfN", "args": [1, 2]}, {"string": "pagetablist"}]
          ],
          expectedBraille: [[{"string": "pagetabAbbr"},
            {"string": "objItemOfN", "args": [1, 2]}, "Account"], ["Account",
            {"string": "pagetabAbbr"},
            {"string": "objItemOfN", "args": [1, 2]}]]
        }, {
          // Test unselected tab
          accOrElmOrID: "tab2",
          expectedUtterance: [[{"string": "pagetablist"}, {"string": "pagetab"},
            {"string": "objItemOfN", "args": [2, 2]}, "Advanced"], ["Advanced",
            {"string": "pagetab"}, {"string": "objItemOfN", "args": [2, 2]},
            {"string": "pagetablist"}]],
          expectedBraille: [[{"string": "pagetabAbbr"},
            {"string": "objItemOfN", "args": [2, 2]}, "Advanced"], ["Advanced",
            {"string": "pagetabAbbr"},
            {"string": "objItemOfN", "args": [2, 2]}]]
        }, {
          // Landing on this label should mimic landing on the checkbox.
          accOrElmOrID: "label1",
          expectedUtterance: [[{"string": "stateNotChecked"},
            {"string": "checkbutton"}, "Orange"], ["Orange",
            {"string": "stateNotChecked"}, {"string": "checkbutton"}]],
          expectedBraille: [[{"string": "stateUncheckedAbbr"}, "Orange"],
                            ["Orange", {"string": "stateUncheckedAbbr"}]]
        }, {
          // Here we get a top-level view of the form.
          accOrElmOrID: "form1",
          expectedUtterance: [[{"string": "label"},
            {"string": "stateNotChecked"}, {"string": "checkbutton"}, "Orange",
            "Orange", {"string": "stateNotChecked"}, {"string": "checkbutton"},
            "Blue", {"string": "label"}, "Blue"], ["Orange",
            {"string": "stateNotChecked"}, {"string": "checkbutton"}, "Orange",
            {"string": "label"}, "Blue", {"string": "stateNotChecked"},
            {"string": "checkbutton"}, "Blue", {"string": "label"}]],
          expectedBraille: [[{"string": "labelAbbr"},
            {"string": "stateUncheckedAbbr"}, "Orange", "Orange",
            {"string": "stateUncheckedAbbr"}, "Blue", {"string": "labelAbbr"},
            "Blue"], ["Orange", {"string": "stateUncheckedAbbr"}, "Orange",
            {"string": "labelAbbr"}, "Blue", {"string": "stateUncheckedAbbr"},
            "Blue", {"string": "labelAbbr"}]]
        }, {
          // This is a non-nesting label.
          accOrElmOrID: "label2",
          expectedUtterance: [[{"string": "label"}, "Blue"],
                              ["Blue", {"string": "label"}]],
          expectedBraille: [[{"string": "labelAbbr"}, "Blue"],
                            ["Blue", {"string": "labelAbbr"}]]
        }, {
          // This is a distinct control.
          accOrElmOrID: "input2",
          expectedUtterance: [[{"string": "stateNotChecked"},
            {"string": "checkbutton"}, "Blue"], ["Blue",
            {"string": "stateNotChecked"}, {"string": "checkbutton"}]],
          expectedBraille: [[{"string": "stateUncheckedAbbr"}, "Blue"], ["Blue",
            {"string": "stateUncheckedAbbr"}]]
        }, {
          // This is a nested control.
          accOrElmOrID: "input1",
          expectedUtterance: [[{"string": "stateNotChecked"},
            {"string": "checkbutton"}, "Orange"], ["Orange",
            {"string": "stateNotChecked"}, {"string": "checkbutton"}]],
          expectedBraille: [[{"string": "stateUncheckedAbbr"}, "Orange"],
            ["Orange", {"string": "stateUncheckedAbbr"}]]
        }, {
          // Landing on this label should mimic landing on the entry.
          accOrElmOrID: "label3",
          expectedUtterance: [[{"string": "entry"}, "Joe", "First name:"],
                             ["First name:", "Joe", {"string": "entry"}]],
          expectedBraille: [[{"string": "entryAbbr"}, "Joe", "First name:"],
                            ["First name:", "Joe", {"string": "entryAbbr"}]]
        }, {
          // This is a nested control with a value.
          accOrElmOrID: "input3",
          expectedUtterance: [[{"string": "entry"}, "Joe", "First name:"],
                              ["First name:", "Joe", {"string": "entry"}]],
          expectedBraille: [[{"string": "entryAbbr"}, "Joe", "First name:"],
                            ["First name:", "Joe", {"string": "entryAbbr"}]]
        }, {
          // This is a nested control with a value.
          accOrElmOrID: "input4",
          expectedUtterance: [[{"string": "slider"}, "3", "Points:"],
                              ["Points:", "3", {"string": "slider"}]],
          expectedBraille: [[{"string": "sliderAbbr"}, "3", "Points:"],
                            ["Points:", "3", {"string": "sliderAbbr"}]]
        }, {
          accOrElmOrID: "password",
          expectedUtterance: [[{"string": "passwordtext"}, "Secret Password"],
                              ["Secret Password", {"string": "passwordtext"}]],
          expectedBraille: [[{"string": "passwordtextAbbr"}, "Secret Password"],
                            ["Secret Password", {"string": "passwordtextAbbr"}]]
        }, {
          accOrElmOrID: "input5",
          expectedUtterance: [[{"string": "stateChecked"},
            {"string": "checkbutton"}, "Boring label"], ["Boring label",
            {"string": "stateChecked"}, {"string": "checkbutton"}]],
          expectedBraille: [[{"string": "stateCheckedAbbr"}, "Boring label"],
            ["Boring label", {"string": "stateCheckedAbbr"}]]
        }, {
          accOrElmOrID: "radio_unselected",
          expectedUtterance: [[{"string": "stateNotChecked"},
            {"string": "radiobutton"}, "any old radio button"],
            ["any old radio button", {"string": "stateNotChecked"},
            {"string": "radiobutton"}]
          ],
          expectedBraille: [
            [{"string": "stateUncheckedAbbr"}, "any old radio button"],
            ["any old radio button", {"string": "stateUncheckedAbbr"}]]
        }, {
          accOrElmOrID: "radio_selected",
          expectedUtterance: [[{"string": "stateChecked"},
            {"string": "radiobutton"}, "a unique radio button"],
            ["a unique radio button", {"string": "stateChecked"},
            {"string": "radiobutton"}]],
          expectedBraille: [
            [{"string": "stateCheckedAbbr"}, "a unique radio button"],
            ["a unique radio button", {"string": "stateCheckedAbbr"}]]
        }, {
          accOrElmOrID: "togglebutton_notpressed",
          expectedUtterance: [[{"string": "togglebutton"}, "I am not pressed"],
                              ["I am not pressed", {"string": "togglebutton"}]],
          expectedBraille: [
            [{"string": "stateUnpressedAbbr"}, "I am not pressed"],
            ["I am not pressed", {"string": "stateUnpressedAbbr"}]]
        }, {
          accOrElmOrID: "togglebutton_pressed",
          expectedUtterance: [[{"string": "statePressed"},
            {"string": "togglebutton"}, "I am pressed!"], ["I am pressed!",
            {"string": "statePressed"}, {"string": "togglebutton"}]],
          expectedBraille: [[{"string": "statePressedAbbr"}, "I am pressed!"],
                            ["I am pressed!", {"string": "statePressedAbbr"}]]
        }, {
          accOrElmOrID: "listbox-option",
          expectedUtterance: [[{"string": "listbox"},
            {"string": "listboxoption"}, "Search suggestion"],
            ["Search suggestion", {"string": "listboxoption"},
            {"string": "listbox"}]
          ],
          expectedBraille: [
            [{"string": "listboxoptionAbbr"}, "Search suggestion"],
            ["Search suggestion", {"string": "listboxoptionAbbr"}]]
        }, {
          accOrElmOrID: "listbox-option2",
          oldAccOrElmOrID: "listbox-option",
          expectedUtterance: [[{"string": "listboxoption"}, "555-12345"],
                              ["555-12345", {"string": "listboxoption"}]],
          expectedBraille: [[{"string": "listboxoptionAbbr"}, "555-12345"],
                            ["555-12345", {"string": "listboxoptionAbbr"}]]
        }, {
          accOrElmOrID: "columnheader",
          oldAccOrElmOrID: "grid",
          expectedUtterance: [[{"string": "columnInfo", "args": [1]},
            {"string": "rowInfo", "args" :[1]}, "Sunday"], ["Sunday",
            {"string": "columnInfo", "args": [1]},
            {"string": "rowInfo", "args" :[1]}]],
          expectedBraille: [[{"string": "cellInfoAbbr", "args": [1, 1]},
            "Sunday"], ["Sunday", {"string": "cellInfoAbbr", "args": [1, 1]}]]
        }, {
          accOrElmOrID: "rowheader",
          oldAccOrElmOrID: "grid",
          expectedUtterance: [[{"string": "columnInfo", "args": [1]},
            {"string": "rowInfo", "args": [2]}, "Sunday", "Week 1"], ["Week 1",
            {"string": "columnInfo", "args": [1]},
            {"string": "rowInfo", "args": [2]}, "Sunday"]],
          expectedBraille: [[{"string": "cellInfoAbbr", "args": [1, 2]},
            "Sunday", "Week 1"], ["Week 1",
            {"string": "cellInfoAbbr", "args": [1, 2]}, "Sunday"]]
        }, {
          accOrElmOrID: "gridcell1",
          oldAccOrElmOrID: "grid",
          expectedUtterance: [["3"], ["3"]],
          expectedBraille: [["3"], ["3"]]
        }, {
          accOrElmOrID: "gridcell2",
          oldAccOrElmOrID: "grid",
          expectedUtterance: [["4", "7"], ["4", "7"]],
          expectedBraille: [["4", "7"], ["4", "7"]]
        }, {
          accOrElmOrID: "gridcell3",
          oldAccOrElmOrID: "grid",
          expectedUtterance: [[{"string": "stateSelected"}, "5"],
                              ["5", {"string": "stateSelected"}]],
          expectedBraille: [["5"], ["5"]],
        }, {
          accOrElmOrID: "frequency",
          expectedUtterance: [[{"string": "stateCollapsed"},
            {"string": "stateHasPopup"}, {"string": "combobox"}, "15 min"], [
            "15 min", {"string": "stateCollapsed"}, {"string": "stateHasPopup"},
            {"string": "combobox"}]],
          expectedBraille: [[{"string": "comboboxAbbr"}, "15 min"], ["15 min",
            {"string": "comboboxAbbr"}]]
        }, {
          accOrElmOrID: "selected-combobox-option",
          oldAccOrElmOrID: "frequency",
          expectedUtterance: [[{"string": "stateSelected"},
            {"string": "comboboxoption"}, "15 min"], ["15 min",
            {"string": "stateSelected"}, {"string": "comboboxoption"}]],
          expectedBraille: [[{"string": "comboboxoptionAbbr"}, "15 min"], [
            "15 min", {"string": "comboboxoptionAbbr"}]]
        }, {
          accOrElmOrID: "combobox-option",
          oldAccOrElmOrID: "frequency",
          expectedUtterance: [[{"string": "comboboxoption"}, "30 min"], [
            "30 min", {"string": "comboboxoption"}]],
          expectedBraille: [[{"string": "comboboxoptionAbbr"}, "30 min"], [
            "30 min", {"string": "comboboxoptionAbbr"}]]
        }, {
          accOrElmOrID: "labelled-combobox",
          expectedUtterance: [[{"string": "stateCollapsed"},
            {"string": "stateHasPopup"}, {"string": "combobox"}, "Never",
            "Intervals"], ["Intervals", "Never", {"string": "stateCollapsed"},
            {"string": "stateHasPopup"}, {"string": "combobox"}]],
          expectedBraille: [[{"string": "comboboxAbbr"}, "Never", "Intervals"],
            ["Intervals", "Never", {"string": "comboboxAbbr"}]]
        }, {
          accOrElmOrID: "statusbar-1",
          expectedUtterance: [["Last sync:", "2 days ago"],
                              ["Last sync:", "2 days ago"]],
          expectedBraille: [["Last sync:", "2 days ago"],
                            ["Last sync:", "2 days ago"]]
        }, {
          accOrElmOrID: "statusbar-2",
          expectedUtterance: [["Last sync: 30min ago"],
                              ["Last sync: 30min ago"]],
          expectedBraille: [["Last sync: 30min ago"], ["Last sync: 30min ago"]]
        }, {
          accOrElmOrID: "switch-1",
          expectedUtterance: [[{"string": "stateOn"}, {"string": "switch"},
            "Simple switch"], ["Simple switch", {"string": "stateOn"},
            {"string": "switch"}]],
          expectedBraille: [[{"string": "stateCheckedAbbr"}, "Simple switch"],
            ["Simple switch", {"string": "stateCheckedAbbr"}]]
        }, {
          accOrElmOrID: "switch-2",
          expectedUtterance: [[{"string": "stateOff"},
            {"string": "switch"}, "Another switch"], ["Another switch",
            {"string": "stateOff"}, {"string": "switch"}]],
          expectedBraille: [
            [{"string": "stateUncheckedAbbr"}, "Another switch"],
            ["Another switch", {"string": "stateUncheckedAbbr"}]]
        }];

        // Test all possible utterance order preference values.
        function testOutputOrder(aOutputOrder) {
          return function() {
            SpecialPowers.pushPrefEnv({
              "set": [[PREF_UTTERANCE_ORDER, aOutputOrder]]
            }, function() {
              tests.forEach(function run(test) {
                testOutput(test.expectedUtterance[aOutputOrder], test.accOrElmOrID,
                  test.oldAccOrElmOrID, 1);
                testOutput(test.expectedBraille[aOutputOrder], test.accOrElmOrID,
                  test.oldAccOrElmOrID, 0);
              });
              AccessFuTest.nextTest();
            });
          };
        }

        AccessFuTest.addFunc(testOutputOrder(0));
        AccessFuTest.addFunc(testOutputOrder(1));
        AccessFuTest.waitForExplicitFinish();
        AccessFuTest.runTests();
      }

      SimpleTest.waitForExplicitFinish();
      addA11yLoadEvent(doTest);

    </script>
  </head>
  <body>
    <div id="root">
      <a target="_blank"
         href="https://bugzilla.mozilla.org/show_bug.cgi?id=753984"
         title="[AccessFu] utterance order test">
         Mozilla Bug 753984</a>
      <a target="_blank"
         href="https://bugzilla.mozilla.org/show_bug.cgi?id=758675"
         title="[AccessFu] Add support for accDescription">
         Mozilla Bug 758675</a>
      <a target="_blank"
         href="https://bugzilla.mozilla.org/show_bug.cgi?id=876475"
         title="[AccessFu] Make braille output less verbose">
         Mozilla Bug 876475</a>
      <a target="_blank"
         href="https://bugzilla.mozilla.org/show_bug.cgi?id=924284"
         title="[AccessFu] Output accessible values">
         Mozilla Bug 924284</a>
      <a target="_blank"
         href="https://bugzilla.mozilla.org/show_bug.cgi?id=925845"
         title="[AccessFu] Unify output tests">
         Mozilla Bug 925845</a>
      <p id="display"></p>
      <div id="content" style="display: none"></div>
      <pre id="test"></pre>
      <a id="anchor" href="#test" title="title"></a>
      <a id="anchor_titleandtext" href="#test" title="goes to the tests">Tests</a>
      <a id="anchor_duplicatedtitleandtext" href="#test" title="Tests">Tests</a>
      <a id="anchor_arialabelandtext" href="#test" aria-label="Tests" title="goes to the tests">Tests</a>
      <textarea id="textarea" cols="80" rows="5">
        This is the text area text.
      </textarea>
      <h1 id="heading" title="Test heading"></h1>
      <ol id="list">
        <li id="li_one">list one</li>
      </ol>
      <ul id="unorderd_list">
        <li id="li_two">list two</li>
      </ul>
      <dl id="dlist">
        <dd id="dd_one">
          dd one
        </dd>
      </dl>
      <table>
        <caption>Fruits and vegetables</caption>
        <tr>
          <td id="cell">
            <ul style="list-style-type: none;">
              <li><a id="apples" href="#">Apples</a></li>
              <li><a id="bananas" href="#">Bananas</a></li>
              <li><a href="#">Peaches</a></li>
              <li>
                <a href="#">
                  Plums
                </a>
              </li>
            </ul>
          </td>
        </tr>
      </table>
      <button id="unavailableButton" disabled>I am unavailable</button>
      <button id="expandedButton" aria-expanded="true">I am expanded</button>
      <button id="collapsedButton" aria-expanded="false">I am collapsed</button>
      <input id="requiredInput" required placeholder="I am required" />
      <input id="readonlyInput" readonly value="No edits" />
      <textarea id="readonlyTextarea" readonly>No editing</textarea>
      <button id="hasPopupButton" aria-haspopup="true">I have a popup</button>
      <div role="tablist">
        <a id="tab1" href="#" role="tab" aria-selected="true">Account</a>
        <a id="tab2" href="#" role="tab" aria-selected="false">Advanced</a>
      </div>
      <form id="form1">
        <label id="label1"><input id="input1" type="checkbox">Orange</label>
        <input id="input2" type="checkbox"><label id="label2" for="input2">Blue</label>
      </form>
      <label id="label3">First name: <input id="input3" value="Joe"></label>
      <label id="label4">Points:
        <input id="input4" type="range" name="points" min="1" max="10" value="3">
      </label>
      <label for="input5">Boring label</label><input id="input5" type="checkbox" checked></input>
      <label for="password">Secret Password</label><input id="password" type="password"></input>
      <label for="radio_unselected">any old radio button</label><input id="radio_unselected" type="radio"></input>
      <label for="radio_selected">a unique radio button</label><input id="radio_selected" type="radio" checked></input>
      <input id="email" type="email" value="test@example.com" />
      <input id="search" type="search" value="This is a search" />
      <input id="tel" type="tel" value="555-5555" />
      <input id="url" type="url" value="http://example.com" />
      <input id="textInput" type="text" value="This is text." />
      <label>Points: <input id="range" type="range" name="points" min="1" max="10" value="3"></label>
      <div id="togglebutton_notpressed" aria-pressed="false" role="button" tabindex="-1">I am not pressed</div>
      <div id="togglebutton_pressed" aria-pressed="true" role="button" tabindex="-1">I am pressed!</div>
      <ul role="listbox" style="list-style-type: none;">
        <li role="option" id="listbox-option">Search suggestion</li>
        <li role="option" id="listbox-option2">
          <label aria-hidden="true">
            <input type="checkbox" />
          </label>
          555-12345
        </li>
      </ul>
      <section id="grid" role="grid">
        <ol role="row">
          <li role="presentation"></li>
          <li id="columnheader" role="columnheader" aria-label="Sunday">S</li>
          <li role="columnheader">M</li>
        </ol>
        <ol role="row">
          <li id="rowheader" role="rowheader" aria-label="Week 1">1</li>
          <li id="gridcell1" role="gridcell"><span>3</span><div></div></li>
          <li id="gridcell2" role="gridcell"><span>4</span><div>7</div></li>
        </ol>
        <ol role="row">
          <li role="rowheader">2</li>
          <li id="gridcell3" aria-selected="true" role="gridcell">5</li>
          <li role="gridcell">6</li>
        </ol>
      </section>
      <select id="frequency">
        <option id="selected-combobox-option" value="15">15 min</option>
        <option id="combobox-option" value="30">30 min</option>
        <option value="null">Manual</option>
      </select>
      <select id="labelled-combobox" aria-label="Intervals">
        <option value="15">Every 15 min</option>
        <option value="30">Every 30 min</option>
        <option value="null" selected>Never</option>
      </select>
      <div id="statusbar-1" role="status">Last sync:<span>2 days ago</span></div>
      <div aria-label="Last sync: 30min ago" id="statusbar-2" role="status">I should be ignored</div>
      <span id="switch-1" role="switch" aria-label="Simple switch" aria-checked="true"></span>
      <span id="switch-2" role="switch" aria-label="Another switch" aria-checked="false"></span>
    </div>
  </body>
</html>