summaryrefslogtreecommitdiffstats
path: root/chrome/test/live_sync
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-17 20:07:11 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-17 20:07:11 +0000
commit95409e1020037b0bbfbce17f861d3de090d10186 (patch)
tree90a893af1247b1d4a3767c5ab14aae797f467946 /chrome/test/live_sync
parent701e869b30deffda579c5c413cf1d73defee34fa (diff)
downloadchromium_src-95409e1020037b0bbfbce17f861d3de090d10186.zip
chromium_src-95409e1020037b0bbfbce17f861d3de090d10186.tar.gz
chromium_src-95409e1020037b0bbfbce17f861d3de090d10186.tar.bz2
Test server cleanup patch of death:
- reduce the number of different classes - clean up the internal code - modify the interface to expose less internal details (this will allow more flexibility with port numbers) TEST=many BUG=49680 Review URL: http://codereview.chromium.org/3080029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56405 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/live_sync')
-rw-r--r--chrome/test/live_sync/live_sync_test.cc17
-rw-r--r--chrome/test/live_sync/live_sync_test.h3
2 files changed, 9 insertions, 11 deletions
diff --git a/chrome/test/live_sync/live_sync_test.cc b/chrome/test/live_sync/live_sync_test.cc
index e09573b..8297006 100644
--- a/chrome/test/live_sync/live_sync_test.cc
+++ b/chrome/test/live_sync/live_sync_test.cc
@@ -240,22 +240,19 @@ void LiveSyncTest::TearDownInProcessBrowserTestFixture() {
}
void LiveSyncTest::SetUpLocalTestServer() {
- bool success = server_.Start(net::TestServerLauncher::ProtoHTTP,
- server_.kHostName, server_.kOKHTTPSPort,
- FilePath(), FilePath(), std::wstring());
- ASSERT_TRUE(success);
+ ASSERT_TRUE(test_server_.Start());
started_local_test_server_ = true;
CommandLine* cl = CommandLine::ForCurrentProcess();
cl->AppendSwitchASCII(switches::kSyncServiceURL,
- StringPrintf("http://%s:%d/chromiumsync", server_.kHostName,
- server_.kOKHTTPSPort));
+ StringPrintf("http://%s:%d/chromiumsync",
+ test_server_.host_port_pair().host().c_str(),
+ test_server_.host_port_pair().port()));
}
void LiveSyncTest::TearDownLocalTestServer() {
- bool success = server_.Stop();
- ASSERT_TRUE(success);
+ ASSERT_TRUE(test_server_.Stop());
}
@@ -295,8 +292,8 @@ void LiveSyncTest::SetProxyConfig(URLRequestContextGetter* context_getter,
bool LiveSyncTest::ConfigureSyncServer(const std::string& name,
const std::string& value) {
std::string url = StringPrintf("http://%s:%d/chromiumsync/configure",
- server_.kHostName,
- server_.kOKHTTPSPort);
+ test_server_.host_port_pair().host().c_str(),
+ test_server_.host_port_pair().port());
std::string data = EscapePath(name) + "=" + EscapePath(value);
ConfigureURLFectcherDelegate delegate;
scoped_ptr<URLFetcher> fetcher(
diff --git a/chrome/test/live_sync/live_sync_test.h b/chrome/test/live_sync/live_sync_test.h
index 0026251..134b200 100644
--- a/chrome/test/live_sync/live_sync_test.h
+++ b/chrome/test/live_sync/live_sync_test.h
@@ -60,6 +60,7 @@ class LiveSyncTest : public InProcessBrowserTest {
explicit LiveSyncTest(TestType test_type)
: test_type_(test_type),
num_clients_(-1),
+ test_server_(net::TestServer::TYPE_HTTP, FilePath()),
started_local_test_server_(false) {
InProcessBrowserTest::set_show_window(true);
InProcessBrowserTest::SetInitialTimeoutInMS(kTestTimeoutInMS);
@@ -195,7 +196,7 @@ class LiveSyncTest : public InProcessBrowserTest {
scoped_ptr<Profile> verifier_;
// Local instance of python sync server.
- net::TestServerLauncher server_;
+ net::TestServer test_server_;
// Keeps track of whether a local python sync server was used for a test.
bool started_local_test_server_;