mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Bug 853558 - Don't use copied over devicemanager files in b2g unittests, r=jgriffin
This commit is contained in:
parent
9063db9bf5
commit
5a7a40cf8b
@ -4,11 +4,8 @@
|
||||
|
||||
import ConfigParser
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import tempfile
|
||||
import time
|
||||
import urllib
|
||||
import traceback
|
||||
|
||||
# We need to know our current directory so that we can serve our test files from it.
|
||||
@ -21,13 +18,7 @@ from runreftest import RefTest
|
||||
from runreftest import ReftestOptions
|
||||
from remotereftest import ReftestServer
|
||||
|
||||
from mozprofile import Profile
|
||||
from mozrunner import Runner
|
||||
|
||||
import devicemanager
|
||||
import devicemanagerADB
|
||||
import manifestparser
|
||||
|
||||
from mozdevice import DeviceManagerADB, DMError
|
||||
from marionette import Marionette
|
||||
|
||||
|
||||
@ -245,7 +236,7 @@ class B2GReftest(RefTest):
|
||||
try:
|
||||
self._devicemanager._checkCmdAs(['shell', 'rm', '-rf',
|
||||
os.path.join(self.bundlesDir, filename)])
|
||||
except devicemanager.DMError:
|
||||
except DMError:
|
||||
pass
|
||||
|
||||
# Restore the original profiles.ini.
|
||||
@ -363,7 +354,7 @@ class B2GReftest(RefTest):
|
||||
def restoreProfilesIni(self):
|
||||
# restore profiles.ini on the device to its previous state
|
||||
if not self.originalProfilesIni or not os.access(self.originalProfilesIni, os.F_OK):
|
||||
raise devicemanager.DMError('Unable to install original profiles.ini; file not found: %s',
|
||||
raise DMError('Unable to install original profiles.ini; file not found: %s',
|
||||
self.originalProfilesIni)
|
||||
|
||||
self._devicemanager.pushFile(self.originalProfilesIni, self.remoteProfilesIniPath)
|
||||
@ -431,7 +422,7 @@ user_pref("capability.principal.codebase.p2.id", "http://%s:%s");
|
||||
self._devicemanager.removeDir(self.remoteProfile)
|
||||
try:
|
||||
self._devicemanager.pushDir(profileDir, self.remoteProfile)
|
||||
except devicemanager.DMError:
|
||||
except DMError:
|
||||
print "Automation Error: Unable to copy profile to device."
|
||||
raise
|
||||
|
||||
@ -444,7 +435,7 @@ user_pref("capability.principal.codebase.p2.id", "http://%s:%s");
|
||||
os.path.join(self.bundlesDir, filename)])
|
||||
try:
|
||||
self._devicemanager.pushDir(extensionDir, self.bundlesDir)
|
||||
except devicemanager.DMError:
|
||||
except DMError:
|
||||
print "Automation Error: Unable to copy extensions to device."
|
||||
raise
|
||||
|
||||
@ -463,7 +454,7 @@ user_pref("capability.principal.codebase.p2.id", "http://%s:%s");
|
||||
RefTest.copyExtraFilesToProfile(self, options, profileDir)
|
||||
try:
|
||||
self._devicemanager.pushDir(profileDir, options.remoteProfile)
|
||||
except devicemanager.DMError:
|
||||
except DMError:
|
||||
print "Automation Error: Failed to copy extra files to device"
|
||||
raise
|
||||
|
||||
@ -506,7 +497,7 @@ def main(args=sys.argv[1:]):
|
||||
if options.deviceIP:
|
||||
kwargs.update({'host': options.deviceIP,
|
||||
'port': options.devicePort})
|
||||
dm = devicemanagerADB.DeviceManagerADB(**kwargs)
|
||||
dm = DeviceManagerADB(**kwargs)
|
||||
auto.setDeviceManager(dm)
|
||||
|
||||
options = parser.verifyRemoteOptions(options)
|
||||
|
@ -18,9 +18,7 @@ from runtests import Mochitest
|
||||
from runtests import MochitestOptions
|
||||
from runtests import MochitestServer
|
||||
|
||||
import devicemanager
|
||||
import devicemanagerADB
|
||||
|
||||
from mozdevice import DeviceManagerADB, DMError
|
||||
from marionette import Marionette
|
||||
|
||||
|
||||
@ -328,7 +326,7 @@ class B2GMochitest(Mochitest, B2GMochitestMixin):
|
||||
try:
|
||||
self._dm._checkCmdAs(['shell', 'rm', '-rf',
|
||||
os.path.join(self.bundlesDir, filename)])
|
||||
except devicemanager.DMError:
|
||||
except DMError:
|
||||
pass
|
||||
|
||||
if not options.emulator:
|
||||
@ -477,7 +475,7 @@ class B2GMochitest(Mochitest, B2GMochitestMixin):
|
||||
self._dm._checkCmdAs(['shell', 'rm', '-r', self.remoteProfile])
|
||||
try:
|
||||
self._dm.pushDir(options.profilePath, self.remoteProfile)
|
||||
except devicemanager.DMError:
|
||||
except DMError:
|
||||
print "Automation Error: Unable to copy profile to device."
|
||||
raise
|
||||
|
||||
@ -490,7 +488,7 @@ class B2GMochitest(Mochitest, B2GMochitestMixin):
|
||||
os.path.join(self.bundlesDir, filename)])
|
||||
try:
|
||||
self._dm.pushDir(extensionDir, self.bundlesDir)
|
||||
except devicemanager.DMError:
|
||||
except DMError:
|
||||
print "Automation Error: Unable to copy extensions to device."
|
||||
raise
|
||||
|
||||
@ -588,7 +586,7 @@ def run_remote_mochitests(automation, parser, options):
|
||||
if options.deviceIP:
|
||||
kwargs.update({'host': options.deviceIP,
|
||||
'port': options.devicePort})
|
||||
dm = devicemanagerADB.DeviceManagerADB(**kwargs)
|
||||
dm = DeviceManagerADB(**kwargs)
|
||||
automation.setDeviceManager(dm)
|
||||
options = parser.verifyRemoteOptions(options, automation)
|
||||
if (options == None):
|
||||
|
Loading…
Reference in New Issue
Block a user