diff --git a/layout/tools/reftest/runreftestb2g.py b/layout/tools/reftest/runreftestb2g.py index 3f7be4beaccd..7afd72ad699b 100644 --- a/layout/tools/reftest/runreftestb2g.py +++ b/layout/tools/reftest/runreftestb2g.py @@ -505,14 +505,16 @@ def run_remote_reftests(parser, options, args): marionette = Marionette.getMarionetteOrExit(**kwargs) auto.marionette = marionette - # create the DeviceManager - kwargs = {'adbPath': options.adbPath, - 'deviceRoot': options.remoteTestRoot} - if options.deviceIP: - kwargs.update({'host': options.deviceIP, - 'port': options.devicePort}) - - dm = DeviceManagerADB(**kwargs) + if options.emulator: + dm = marionette.emulator.dm + else: + # create the DeviceManager + kwargs = {'adbPath': options.adbPath, + 'deviceRoot': options.remoteTestRoot} + if options.deviceIP: + kwargs.update({'host': options.deviceIP, + 'port': options.devicePort}) + dm = DeviagerADB(**kwargs) auto.setDeviceManager(dm) options = parser.verifyRemoteOptions(options) diff --git a/testing/mochitest/runtestsb2g.py b/testing/mochitest/runtestsb2g.py index 10b63a324df8..1cde4e6f1c40 100644 --- a/testing/mochitest/runtestsb2g.py +++ b/testing/mochitest/runtestsb2g.py @@ -310,13 +310,17 @@ def run_remote_mochitests(parser, options): marionette = Marionette.getMarionetteOrExit(**kwargs) - # create the DeviceManager - kwargs = {'adbPath': options.adbPath, - 'deviceRoot': options.remoteTestRoot} - if options.deviceIP: - kwargs.update({'host': options.deviceIP, - 'port': options.devicePort}) - dm = DeviceManagerADB(**kwargs) + if options.emulator: + dm = marionette.emulator.dm + else: + # create the DeviceManager + kwargs = {'adbPath': options.adbPath, + 'deviceRoot': options.remoteTestRoot} + if options.deviceIP: + kwargs.update({'host': options.deviceIP, + 'port': options.devicePort}) + dm = DeviceManagerADB(**kwargs) + options = parser.verifyRemoteOptions(options) if (options == None): print "ERROR: Invalid options specified, use --help for a list of valid options" diff --git a/testing/xpcshell/runtestsb2g.py b/testing/xpcshell/runtestsb2g.py index e2b7a447d00c..55e417b70b02 100644 --- a/testing/xpcshell/runtestsb2g.py +++ b/testing/xpcshell/runtestsb2g.py @@ -183,13 +183,16 @@ def main(): kwargs['connectToRunningEmulator'] = True marionette = Marionette(**kwargs) - # Create the DeviceManager instance - kwargs = {'adbPath': options.adb_path} - if options.deviceIP: - kwargs['host'] = options.deviceIP - kwargs['port'] = options.devicePort - kwargs['deviceRoot'] = options.remoteTestRoot - dm = devicemanagerADB.DeviceManagerADB(**kwargs) + if options.emulator: + dm = marionette.emulator.dm + else: + # Create the DeviceManager instance + kwargs = {'adbPath': options.adb_path} + if options.deviceIP: + kwargs['host'] = options.deviceIP + kwargs['port'] = options.devicePort + kwargs['deviceRoot'] = options.remoteTestRoot + dm = devicemanagerADB.DeviceManagerADB(**kwargs) if not options.remoteTestRoot: options.remoteTestRoot = dm.getDeviceRoot()