bug985207 updated getTitle following getCurrentUrl example draft
authorJosh Grant <joshua.m.grant@gmail.com>
Wed, 18 Feb 2015 21:57:31 -0500
changeset 248292 73c469df71ce6172fecf91580f1bb53719b0d3c4
parent 248291 c161c30deb55e6e17fc488c9524250b9bea1c67c
child 248293 b47ef6c515de654fe29c6deeff91497e60dafff5
push id913
push userjoshua.m.grant@gmail.com
push dateThu, 05 Mar 2015 03:46:34 +0000
bugs985207
milestone39.0a1
bug985207 updated getTitle following getCurrentUrl example
testing/marionette/marionette-server.js
--- a/testing/marionette/marionette-server.js
+++ b/testing/marionette/marionette-server.js
@@ -1342,24 +1342,33 @@ MarionetteServerConnection.prototype = {
       }
     }
   },
 
   /**
    * Gets the current title of the window
    */
   getTitle: function MDA_getTitle() {
+    let isB2G = appName == "B2G";
     this.command_id = this.getCommandId();
-    if (this.context == "chrome"){
+    if (this.context === "chrome"){
       var curWindow = this.getCurrentWindow();
       var title = curWindow.document.documentElement.getAttribute('title');
       this.sendResponse(title, this.command_id);
     }
     else {
-      this.sendAsync("getTitle", {}, this.command_id);
+      if (isB2G){
+        this.sendAsync("getTitle", {}, this.command_id);
+      }
+      else {
+        this.sendResponse(this.curBrowser
+                              .document
+                              .documentElement
+                              .getAttribute('title'));	  
+      }
     }
   },
 
   /**
    * Gets the current type of the window
    */
   getWindowType: function MDA_getWindowType() {
     this.command_id = this.getCommandId();