Bug 1322593 - Add test for multiple independent text changes under the same accessible. r=yzen, a=jcristau FIREFOX_52_0b3_BUILD1 FIREFOX_52_0b3_RELEASE
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Fri, 20 Jan 2017 16:23:44 -0500
changeset 470197 d171c36d484800b1bb00db1612460a7120dd2fdf
parent 470196 5ec5c9a7719b756bf831b11c76c6467a2b0fd45e
child 470198 1a6c3c479c469f83cfe12e0e12b6f9f296665b4f
push id43956
push usermozilla@noorenberghe.ca
push dateFri, 03 Feb 2017 09:40:43 +0000
reviewersyzen, jcristau
bugs1322593
milestone52.0
Bug 1322593 - Add test for multiple independent text changes under the same accessible. r=yzen, a=jcristau
accessible/tests/mochitest/events/a11y.ini
accessible/tests/mochitest/events/test_bug1322593-2.html
--- a/accessible/tests/mochitest/events/a11y.ini
+++ b/accessible/tests/mochitest/events/a11y.ini
@@ -8,16 +8,17 @@ support-files =
 
 [test_aria_alert.html]
 [test_aria_menu.html]
 [test_aria_objattr.html]
 [test_aria_owns.html]
 [test_aria_statechange.html]
 [test_attrs.html]
 [test_bug1322593.html]
+[test_bug1322593-2.html]
 [test_caretmove.html]
 [test_caretmove.xul]
 [test_coalescence.html]
 [test_contextmenu.html]
 [test_descrchange.html]
 [test_docload.html]
 [test_docload.xul]
 skip-if = buildapp == 'mulet'
new file mode 100644
--- /dev/null
+++ b/accessible/tests/mochitest/events/test_bug1322593-2.html
@@ -0,0 +1,83 @@
+<html>
+
+<head>
+  <title>Accessible mutation events testing</title>
+
+  <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="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
+
+  <script type="application/javascript"
+          src="../common.js"></script>
+  <script type="application/javascript"
+          src="../events.js"></script>
+
+  <script type="application/javascript">
+    function changeMultipleElements()
+    {
+      this.node1 = getNode("span1");
+      this.node2 = getNode("span2");
+
+      this.eventSeq = [
+        new textChangeChecker("container", 0, 5, "hello", false, undefined, true),
+        new textChangeChecker("container", 6, 11, "world", false, undefined, true),
+        new orderChecker(),
+        new textChangeChecker("container", 0, 1, "a", true, undefined, true),
+        new textChangeChecker("container", 7, 8, "b", true, undefined, true)
+      ];
+
+      this.invoke = function changeMultipleElements_invoke()
+      {
+        this.node1.textContent = "a";
+        this.node2.textContent = "b";
+      }
+
+      this.getID = function changeMultipleElements_invoke_getID()
+      {
+        return "Change the text content of multiple sibling divs";
+      }
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Do tests
+//    gA11yEventDumpToConsole = true; // debugging
+
+    var gQueue = null;
+    function doTests()
+    {
+      gQueue = new eventQueue();
+
+      gQueue.push(new changeMultipleElements());
+
+      gQueue.invoke(); // Will call SimpleTest.finish();
+    }
+
+    SimpleTest.waitForExplicitFinish();
+    addA11yLoadEvent(doTests);
+  </script>
+</head>
+
+<body>
+
+  <a target="_blank"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=1322593"
+     title="missing text change events when multiple elements updated at once">
+    Mozilla Bug 1322593
+  </a>
+
+  <p id="display"></p>
+  <div id="content" style="display: none"></div>
+  <pre id="test">
+  </pre>
+
+  <div id="container">
+  <span id="span1">hello</span>
+  <span>your</span>
+  <span id="span2">world</span>
+  </div>
+</body>
+</html>