Bug 755552 - add getStatus() call to marionette, r=mdas

This commit is contained in:
Alfredos-Panagiotis Damkalis 2012-10-15 16:51:27 -07:00
Родитель 79c420f15b
Коммит a42576f82e
3 изменённых файлов: 46 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,19 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from marionette_test import MarionetteTestCase
class TestGetStatus(MarionetteTestCase):
def test_getStatus(self):
status = self.marionette.status()
self.assertIn("os", status)
status_os = status['os']
self.assertIn("version", status_os)
self.assertIn("name", status_os)
self.assertIn("arch", status_os)
self.assertIn("build", status)
status_build = status['build']
self.assertIn("revision", status_build)
self.assertIn("time", status_build)
self.assertIn("version", status_build)

Просмотреть файл

@ -1,3 +1,4 @@
[test_getstatus.py]
[test_import_script.py]
[test_click.py]
b2g = false

Просмотреть файл

@ -482,6 +482,31 @@ MarionetteDriverActor.prototype = {
this.sendResponse(value);
},
getStatus: function MDA_getStatus(){
let arch;
try {
arch = (Services.appinfo.XPCOMABI || 'unknown').split('-')[0]
}
catch (ignored) {
arch = 'unknown'
};
let value = {
'os': {
'arch': arch,
'name': Services.appinfo.OS,
'version': 'unknown'
},
'build': {
'revision': 'unknown',
'time': Services.appinfo.platformBuildID,
'version': Services.appinfo.version
}
};
this.sendResponse(value);
},
/**
* Log message. Accepts user defined log-level.
*
@ -1620,6 +1645,7 @@ MarionetteDriverActor.prototype = {
MarionetteDriverActor.prototype.requestTypes = {
"newSession": MarionetteDriverActor.prototype.newSession,
"getSessionCapabilities": MarionetteDriverActor.prototype.getSessionCapabilities,
"getStatus": MarionetteDriverActor.prototype.getStatus,
"log": MarionetteDriverActor.prototype.log,
"getLogs": MarionetteDriverActor.prototype.getLogs,
"addPerfData": MarionetteDriverActor.prototype.addPerfData,