Bug 586885 - Add raw host to robotium.config. r=jmaher

This commit is contained in:
Brian Nicholson 2012-06-05 14:07:14 -07:00
parent cc98fe019b
commit 355e9fdee1
2 changed files with 9 additions and 2 deletions

View File

@ -32,6 +32,7 @@ abstract class BaseTest extends ActivityInstrumentationTestCase2<Activity> {
protected Assert mAsserter;
protected Actions mActions;
protected String mBaseUrl;
protected String mRawBaseUrl;
private String mTestType;
private String mLogFile;
protected String mProfile;
@ -70,6 +71,7 @@ abstract class BaseTest extends ActivityInstrumentationTestCase2<Activity> {
mLogFile = (String)config.get("logfile");
mBaseUrl = ((String)config.get("host")).replaceAll("(/$)", "");
mRawBaseUrl = ((String)config.get("rawhost")).replaceAll("(/$)", "");
}
public void setTestType(String type) {
@ -172,6 +174,10 @@ abstract class BaseTest extends ActivityInstrumentationTestCase2<Activity> {
return mBaseUrl + "/" + url.replaceAll("(^/)", "");
}
protected final String getAbsoluteRawUrl(String url) {
return mRawBaseUrl + "/" + url.replaceAll("(^/)", "");
}
protected final boolean waitForTest(BooleanTest t, int timeout) {
long end = SystemClock.uptimeMillis() + timeout;
while (SystemClock.uptimeMillis() < end) {

View File

@ -62,12 +62,12 @@ class RemoteOptions(MochitestOptions):
self.add_option("--http-port", action = "store",
type = "string", dest = "httpPort",
help = "ip address where the remote web server is hosted at")
help = "http port of the remote web server")
defaults["httpPort"] = automation.DEFAULT_HTTP_PORT
self.add_option("--ssl-port", action = "store",
type = "string", dest = "sslPort",
help = "ip address where the remote web server is hosted at")
help = "ssl port of the remote web server")
defaults["sslPort"] = automation.DEFAULT_SSL_PORT
self.add_option("--pidfile", action = "store",
@ -421,6 +421,7 @@ def main():
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()