Bug 1053247 - Fix content integration tests. r=yzen
authorEitan Isaacson <eitan@monotonous.org>
Thu, 14 Aug 2014 09:24:08 -0400
changeset 221160 b4c055c3cf1f79506810c883e525b99fb12adff9
parent 221159 85f0e75d76671a57e457582cecbcc7182c2dc622
child 221161 ee2ce6de36701dd7b961489723c75ba46ea138d4
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersyzen
bugs1053247
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1053247 - Fix content integration tests. r=yzen
accessible/tests/mochitest/jsat/jsatcommon.js
accessible/tests/mochitest/jsat/test_content_integration.html
--- a/accessible/tests/mochitest/jsat/jsatcommon.js
+++ b/accessible/tests/mochitest/jsat/jsatcommon.js
@@ -250,17 +250,17 @@ AccessFuContentTest.prototype = {
     aMessageManager.loadFrameScript(
       'data:,(' + contentScript.toString() + ')();', false);
   },
 
   pump: function() {
     this.currentPair = this.queue.shift();
 
     if (this.currentPair) {
-      if (this.currentPair[0] instanceof Function) {
+      if (typeof this.currentPair[0] === 'function') {
         this.currentPair[0](this.mms[0]);
       } else if (this.currentPair[0]) {
         this.mms[0].sendAsyncMessage(this.currentPair[0].name,
          this.currentPair[0].json);
       }
 
       if (!this.currentPair[1]) {
        this.pump();
@@ -285,17 +285,21 @@ AccessFuContentTest.prototype = {
     }
 
     var speech = this.extractUtterance(aMessage.json);
     var android = this.extractAndroid(aMessage.json, expected.android);
     if ((speech && expected.speak) || (android && expected.android)) {
       if (expected.speak) {
         var checkFunc = SimpleTest[expected.speak_checkFunc] || isDeeply;
         checkFunc.apply(SimpleTest, [speech, expected.speak,
-          '"' + JSON.stringify(speech) + '" spoken']);
+          'spoken: ' + JSON.stringify(speech) +
+          ' expected: ' + JSON.stringify(expected.speak) +
+          ' after: ' + (typeof this.currentPair[0] === 'function' ?
+            this.currentPair[0].toString() :
+            JSON.stringify(this.currentPair[0]))]);
       }
 
       if (expected.android) {
         var checkFunc = SimpleTest[expected.android_checkFunc] || ok;
         checkFunc.apply(SimpleTest,
           this.lazyCompare(android, expected.android));
       }
 
--- a/accessible/tests/mochitest/jsat/test_content_integration.html
+++ b/accessible/tests/mochitest/jsat/test_content_integration.html
@@ -131,67 +131,72 @@
           // cursor is in frame
           [ContentMessages.simpleMoveNext, {
             speak: ['Phone status bar', 'Traversal Rule test document']
           }],
           [ContentMessages.simpleMoveNext, {
             speak: ['wow', {'string': 'headingLevel', 'args': [1]}, 'such app']
           }],
           [ContentMessages.focusSelector('button#home', false), {
-            speak: ['Home button']
-          }]
+            speak: ['Home', {'string': 'pushbutton'}]
+          }],
 
           // Blur button and reset cursor
           [ContentMessages.focusSelector('button#home', true), null],
           [ContentMessages.clearCursor, 'AccessFu:CursorCleared'],
 
           // XXX: Set focus on iframe itself.
           // XXX: Set focus on element in iframe when cursor is outside of it.
           // XXX: Set focus on element in iframe when cursor is in iframe.
 
           // Open dialog in outer doc, while cursor is also in outer doc
           [ContentMessages.simpleMoveNext, {
             speak: ['Phone status bar', 'Traversal Rule test document']
           }],
           [doc.defaultView.showAlert, {
-            speak: ['This is an alert! heading level 1 dialog']
+            speak: ['This is an alert!',
+                    {'string': 'headingLevel', 'args': [1]},
+                    {'string': 'dialog'}]
           }],
 
-          [function() {
-            doc.defaultView.hideAlert()
-          }, {
-            speak: ['wow', {'string': 'headingLevel', 'args': [1]}, 'such app']
+          [doc.defaultView.hideAlert, {
+            speak: ["wow", {"string": "headingLevel","args": [1]}, "such app"],
           }],
 
           [ContentMessages.clearCursor, 'AccessFu:CursorCleared'],
 
           // Open dialog in outer doc, while cursor is in inner frame
           [ContentMessages.simpleMoveNext, {
             speak: ['Phone status bar', 'Traversal Rule test document']
           }],
           [ContentMessages.simpleMoveNext, {
             speak: ['wow', {'string': 'headingLevel', 'args': [1]}, 'such app']
           }],
           [doc.defaultView.showAlert, {
-            speak: ['This is an alert! heading level 1 dialog']
+            speak: ['This is an alert!',
+                    {'string': 'headingLevel', 'args': [1]},
+                    {'string': 'dialog'}]
           }],
 
           // XXX: Place cursor back where it was.
           [doc.defaultView.hideAlert, {
-            speak: ['many option not checked check button such app']
+            speak: ['wow', {'string': 'headingLevel', 'args': [1]}, 'such app'],
+            speak_checkFunc: 'todo_is'
           }],
 
           [ContentMessages.clearCursor, 'AccessFu:CursorCleared'],
 
           // Open dialog, then focus on something when closing
           [ContentMessages.simpleMoveNext, {
             speak: ['Phone status bar', 'Traversal Rule test document']
           }],
           [doc.defaultView.showAlert, {
-            speak: ['This is an alert! heading level 1 dialog']
+            speak: ['This is an alert!',
+                    {'string': 'headingLevel', 'args': [1]},
+                    {'string': 'dialog'}]
           }],
 
           [function() {
             doc.defaultView.hideAlert();
             doc.querySelector('button#home').focus();
           }, {
             speak: ['Home', {'string': 'pushbutton'},
               'Traversal Rule test document']