From af015130d54ea4c0f93f7fc22ece07715e998e84 Mon Sep 17 00:00:00 2001 From: Yura Zenevich Date: Thu, 27 Jun 2013 14:15:36 -0700 Subject: [PATCH] Bug 830748 - [PATCH 2/2] [AccessFu] tests for improved reading of table semantics. r=eeejay, marcoz --- accessible/tests/mochitest/jsat/Makefile.in | 5 +- accessible/tests/mochitest/jsat/output.js | 3 +- .../mochitest/jsat/test_explicit_names.html | 12 +- .../tests/mochitest/jsat/test_tables.html | 251 ++++++++++++++++++ .../mochitest/jsat/test_utterance_order.html | 9 +- 5 files changed, 267 insertions(+), 13 deletions(-) create mode 100644 accessible/tests/mochitest/jsat/test_tables.html diff --git a/accessible/tests/mochitest/jsat/Makefile.in b/accessible/tests/mochitest/jsat/Makefile.in index 27378d47f7e..5b3c15583d2 100644 --- a/accessible/tests/mochitest/jsat/Makefile.in +++ b/accessible/tests/mochitest/jsat/Makefile.in @@ -15,9 +15,10 @@ MOCHITEST_A11Y_FILES =\ jsatcommon.js \ output.js \ test_alive.html \ -test_explicit_names.html \ -test_utterance_order.html \ test_braille.html \ +test_explicit_names.html \ +test_tables.html \ +test_utterance_order.html \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/accessible/tests/mochitest/jsat/output.js b/accessible/tests/mochitest/jsat/output.js index 7c899171459..5ab11dc7164 100644 --- a/accessible/tests/mochitest/jsat/output.js +++ b/accessible/tests/mochitest/jsat/output.js @@ -37,7 +37,8 @@ function testContextOutput(expected, aAccOrElmOrID, aOldAccOrElmOrID, aGenerator */ function testObjectOutput(aAccOrElmOrID, aGenerator) { var accessible = getAccessible(aAccOrElmOrID); - var output = aGenerator.genForObject(accessible); + var context = new PivotContext(accessible); + var output = aGenerator.genForObject(accessible, context); var outputOrder; try { outputOrder = SpecialPowers.getIntPref(PREF_UTTERANCE_ORDER); diff --git a/accessible/tests/mochitest/jsat/test_explicit_names.html b/accessible/tests/mochitest/jsat/test_explicit_names.html index a0a234eef29..c82cd86f702 100644 --- a/accessible/tests/mochitest/jsat/test_explicit_names.html +++ b/accessible/tests/mochitest/jsat/test_explicit_names.html @@ -54,9 +54,10 @@ expected: ["list 2 items", "Test List", "Last item", "2.", "list two"] }, { accOrElmOrID: "cell", - expected: ["table", "Fruits and vegetables", "List of Fruits", - "list 4 items","First item", "link", "Apples", "link", "Bananas", - "link", "Peaches", "Last item", "link", "Plums"] + expected: ["table with 1 column and 1 row", "Fruits and vegetables", + "Column 1 Row 1", "List of Fruits", "list 4 items", "First item", + "link", "Apples", "link", "Bananas", "link", "Peaches", "Last item", + "link", "Plums"] }, { accOrElmOrID: "app.net", expected: ["list 2 items", "First item", "link", "star", "Last item", @@ -71,13 +72,12 @@ // Test pivot to li_one from list. accOrElmOrID: "li_one", oldAccOrElmOrID: "list", - expected: ["list 2 items", "Test List", "First item", "Top of the list"] + expected: ["First item", "Top of the list"] }, { // Test pivot to "apples" link from the table cell. accOrElmOrID: "apples", oldAccOrElmOrID: "cell", - expected: ["List of Fruits", "list 4 items", "First item", "link", - "Apples"] + expected: ["list 4 items", "First item", "link", "Apples"] }, { // Test pivot to the table cell from the "apples" link. accOrElmOrID: "cell", diff --git a/accessible/tests/mochitest/jsat/test_tables.html b/accessible/tests/mochitest/jsat/test_tables.html new file mode 100644 index 00000000000..5a226d50121 --- /dev/null +++ b/accessible/tests/mochitest/jsat/test_tables.html @@ -0,0 +1,251 @@ + + + [AccessFu] Improve reading of table semantics + + + + + + + + +
+ + Mozilla Bug 830748 + +

+ +

+    
+      
+        
+          
+          
+        
+      
+      
+        
+          
+          
+        
+      
+    
col1col2
cell1cell2
+ + + + + + + + + +
cell1 + + + + + + + + + + + +
colheader
bla
+
col1col2
+ + + + + + + + + + + + + + + + + + + + +
col1col2col3
row1cell1cell2
row2cell3cell4
+ + + +
Row1
Row2
+
+ + \ No newline at end of file diff --git a/accessible/tests/mochitest/jsat/test_utterance_order.html b/accessible/tests/mochitest/jsat/test_utterance_order.html index b76bbbc7dd5..14ee1a57cbf 100644 --- a/accessible/tests/mochitest/jsat/test_utterance_order.html +++ b/accessible/tests/mochitest/jsat/test_utterance_order.html @@ -57,13 +57,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=753984 }, { accOrElmOrID: "cell", expected: [[ - "table", "Fruits and vegetables", "list 4 items", "First item", - "link", "Apples", "link", "Bananas", "link", "Peaches", - "Last item", "link", "Plums" + "table with 1 column and 1 row", "Fruits and vegetables", + "Column 1 Row 1", "list 4 items", "First item", "link", "Apples", + "link", "Bananas", "link", "Peaches", "Last item", "link", "Plums" ], [ "Apples", "link", "First item", "Bananas", "link", "Peaches", "link", "Plums", "link", "Last item", "list 4 items", - "Fruits and vegetables", "table" + "Column 1 Row 1", "Fruits and vegetables", + "table with 1 column and 1 row" ]] }, { // Test pivot to list from li_one.