зеркало из https://github.com/mozilla/gecko-dev.git
Backout f271acb304c2 (bug 799107),
This commit is contained in:
Родитель
518619c774
Коммит
975fa8f860
|
@ -393,7 +393,7 @@ public class FennecNativeDriver implements Driver {
|
||||||
|
|
||||||
String[] lines = data.split("\n");
|
String[] lines = data.split("\n");
|
||||||
for (int i = 0; i < lines.length; i++) {
|
for (int i = 0; i < lines.length; i++) {
|
||||||
String[] parts = lines[i].split("=", 2);
|
String[] parts = lines[i].split("=");
|
||||||
retVal.put(parts[0].trim(), parts[1].trim());
|
retVal.put(parts[0].trim(), parts[1].trim());
|
||||||
}
|
}
|
||||||
return retVal;
|
return retVal;
|
||||||
|
|
|
@ -66,14 +66,6 @@ abstract class BaseTest extends ActivityInstrumentationTestCase2<Activity> {
|
||||||
mProfile = (String)config.get("profile");
|
mProfile = (String)config.get("profile");
|
||||||
i.putExtra("args", "-no-remote -profile " + mProfile);
|
i.putExtra("args", "-no-remote -profile " + mProfile);
|
||||||
|
|
||||||
String envString = (String)config.get("envvars");
|
|
||||||
if (envString != "") {
|
|
||||||
String[] envStrings = envString.split(",");
|
|
||||||
for (int iter = 0; iter < envStrings.length; iter++) {
|
|
||||||
i.putExtra("env" + iter, envStrings[iter]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Start the activity
|
// Start the activity
|
||||||
setActivityIntent(i);
|
setActivityIntent(i);
|
||||||
mActivity = getActivity();
|
mActivity = getActivity();
|
||||||
|
|
|
@ -382,41 +382,6 @@ class MochiRemote(Mochitest):
|
||||||
if failed > 0:
|
if failed > 0:
|
||||||
return 1
|
return 1
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def buildRobotiumConfig(self, options, browserEnv):
|
|
||||||
deviceRoot = self._dm.getDeviceRoot()
|
|
||||||
fHandle = tempfile.NamedTemporaryFile(suffix='.config',
|
|
||||||
prefix='robotium-',
|
|
||||||
dir=os.getcwd(),
|
|
||||||
delete=False)
|
|
||||||
fHandle.write("profile=%s\n" % (self.remoteProfile))
|
|
||||||
fHandle.write("logfile=%s\n" % (options.remoteLogFile))
|
|
||||||
fHandle.write("host=http://mochi.test:8888/tests\n")
|
|
||||||
fHandle.write("rawhost=http://%s:%s/tests\n" % (options.remoteWebServer, options.httpPort))
|
|
||||||
|
|
||||||
if browserEnv:
|
|
||||||
envstr = ""
|
|
||||||
delim = ""
|
|
||||||
for key, value in browserEnv.items():
|
|
||||||
try:
|
|
||||||
value.index(',')
|
|
||||||
print "Error: Found an ',' in our value, unable to process value."
|
|
||||||
except ValueError, e:
|
|
||||||
envstr += "%s%s=%s" % (delim, key, value)
|
|
||||||
delim = ","
|
|
||||||
|
|
||||||
fHandle.write("envvars=%s\n" % envstr)
|
|
||||||
fHandle.close()
|
|
||||||
|
|
||||||
self._dm.removeFile(os.path.join(deviceRoot, "robotium.config"))
|
|
||||||
self._dm.pushFile(fHandle.name, os.path.join(deviceRoot, "robotium.config"))
|
|
||||||
os.unlink(fHandle.name)
|
|
||||||
|
|
||||||
def buildBrowserEnv(self, options):
|
|
||||||
browserEnv = Mochitest.buildBrowserEnv(self, options)
|
|
||||||
self.buildRobotiumConfig(options, browserEnv)
|
|
||||||
return browserEnv
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
scriptdir = os.path.abspath(os.path.realpath(os.path.dirname(__file__)))
|
scriptdir = os.path.abspath(os.path.realpath(os.path.dirname(__file__)))
|
||||||
|
@ -465,8 +430,21 @@ def main():
|
||||||
mp.read(options.robocop)
|
mp.read(options.robocop)
|
||||||
robocop_tests = mp.active_tests(exists=False)
|
robocop_tests = mp.active_tests(exists=False)
|
||||||
|
|
||||||
deviceRoot = dm.getDeviceRoot()
|
fHandle = tempfile.NamedTemporaryFile(suffix='.config',
|
||||||
|
prefix='robotium-',
|
||||||
|
dir=os.getcwd(),
|
||||||
|
delete=False)
|
||||||
|
fHandle.write("profile=%s\n" % (mochitest.remoteProfile))
|
||||||
|
fHandle.write("logfile=%s\n" % (options.remoteLogFile))
|
||||||
|
fHandle.write("host=http://mochi.test:8888/tests\n")
|
||||||
|
fHandle.write("rawhost=http://%s:%s/tests\n" % (options.remoteWebServer, options.httpPort))
|
||||||
|
fHandle.close()
|
||||||
|
deviceRoot = dm.getDeviceRoot()
|
||||||
|
|
||||||
dm.removeFile(os.path.join(deviceRoot, "fennec_ids.txt"))
|
dm.removeFile(os.path.join(deviceRoot, "fennec_ids.txt"))
|
||||||
|
dm.removeFile(os.path.join(deviceRoot, "robotium.config"))
|
||||||
|
dm.pushFile(fHandle.name, os.path.join(deviceRoot, "robotium.config"))
|
||||||
|
os.unlink(fHandle.name)
|
||||||
fennec_ids = os.path.abspath("fennec_ids.txt")
|
fennec_ids = os.path.abspath("fennec_ids.txt")
|
||||||
if not os.path.exists(fennec_ids) and options.robocopIds:
|
if not os.path.exists(fennec_ids) and options.robocopIds:
|
||||||
fennec_ids = options.robocopIds
|
fennec_ids = options.robocopIds
|
||||||
|
|
Загрузка…
Ссылка в новой задаче