--- 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();