backout bug 812845 for frequent orange
authorTrevor Saunders <trev.saunders@gmail.com>
Fri, 07 Dec 2012 02:38:41 -0500
changeset 120861 9907e4cc5d91a93ef722edb1915c0022b931cc57
parent 120860 7b0b77c101dfeb6d75b51101eaa4fd925e0feaa1
child 120862 5725e73685e91eb4327bd73b2f1ebc874a154ddf
push idunknown
push userunknown
push dateunknown
bugs812845
milestone20.0a1
backout bug 812845 for frequent orange
accessible/tests/mochitest/events/test_textattrchange.html
--- a/accessible/tests/mochitest/events/test_textattrchange.html
+++ b/accessible/tests/mochitest/events/test_textattrchange.html
@@ -24,121 +24,90 @@
 
   <script type="application/javascript">
 
     const nsIDOMNSEditableElement =
       Components.interfaces.nsIDOMNSEditableElement;
 
     Components.utils.import("resource://gre/modules/InlineSpellChecker.jsm");
 
-    function spelledTextInvoker(aID, aText, aTests)
+    function spelledTextInvoker(aID)
     {
       this.DOMNode = getNode(aID);
 
       this.eventSeq = [
         new invokerChecker(EVENT_TEXT_ATTRIBUTE_CHANGED, this.DOMNode)
       ];
 
       this.invoke = function spelledTextInvoker_invoke()
       {
         var editor = this.DOMNode.QueryInterface(nsIDOMNSEditableElement).editor;
         var spellChecker = new InlineSpellChecker(editor);
         spellChecker.enabled = true;
 
         //var spellchecker = editor.getInlineSpellChecker(true);
         //spellchecker.enableRealTimeSpell = true;
 
-        this.DOMNode.value = aText;
+        this.DOMNode.value = "valid text inalid tixt";
       }
 
       this.finalCheck = function spelledTextInvoker_finalCheck()
       {
         var defAttrs = buildDefaultTextAttrs(this.DOMNode, kInputFontSize,
                                              kNormalFontWeight,
                                              kInputFontFamily);
         testDefaultTextAttrs(aID, defAttrs);
 
         var attrs = { };
         var misspelledAttrs = {
           "invalid": "spelling"
         };
 
-        for (var i = 0; i < aTests.length; i++) {
-          testTextAttrs(aID, aTests[i].start,
-                        aTests[i].misspelled ? misspelledAttrs : attrs,
-                        defAttrs, aTests[i].start, aTests[i].end);
-        }
+        testTextAttrs(aID, 0, attrs, defAttrs, 0, 11);
+        testTextAttrs(aID, 11, misspelledAttrs, defAttrs, 11, 17);
+        testTextAttrs(aID, 17, attrs, defAttrs, 17, 18);
+        testTextAttrs(aID, 18, misspelledAttrs, defAttrs, 18, 22);
       }
 
       this.getID = function spelledTextInvoker_getID()
       {
         return "text attribute change for misspelled text";
       }
     }
 
     /**
      * Do tests.
      */
     //gA11yEventDumpID = "eventdump"; // debug stuff
-    gA11yEventDumpToConsole = true;
+    //gA11yEventDumpToConsole = true;
 
     var gQueue = null;
     function doTests()
     {
       // Synth focus before spellchecking turning on to make sure editor
       // gets a time for initialization.
 
       gQueue = new eventQueue();
       gQueue.push(new synthFocus("input"));
-
-      var tests = [
-        { misspelled: false, start: 0, end: 11},
-        { misspelled: true, start: 11, end: 17},
-        { misspelled: false, start: 17, end: 18},
-        { misspelled: true, start: 18, end: 22}
-      ];
-      gQueue.push(new spelledTextInvoker("input", "valid text inalid tixt",
-                                         tests));
-
-      tests = [
-        { misspelled: false, start: 0, end: 4}
-      ];
-      gQueue.push(new spelledTextInvoker("input", "that", tests));
-
-      tests = [
-        { misspelled: true, start: 0, end: 4}
-      ];
-      gQueue.push(new spelledTextInvoker("input", "taht", tests));
-
-      tests = [
-        { misspelled: true, start: 0, end: 4},
-        { misspelled: false, start: 4, end: 8}
-      ];
-      gQueue.push(new spelledTextInvoker("input", "taht cat", tests));
-
+      gQueue.push(new spelledTextInvoker("input"));
       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=345759"
      title="Implement text attributes">
     Mozilla Bug 345759
   </a>
-  <a target="_blank"
-     href="https://bugzilla.mozilla.org/show_bug.cgi?id=770564"
-     title="improve performance of getting spelling text attribute"
-    Mozilla Bug 770564
-  </a>
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
   <input id="input"/>
 
   <div id="eventdump"></div>