summaryrefslogtreecommitdiffstats
path: root/chrome/test/live_sync/live_sync_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/test/live_sync/live_sync_test.cc')
-rw-r--r--chrome/test/live_sync/live_sync_test.cc41
1 files changed, 7 insertions, 34 deletions
diff --git a/chrome/test/live_sync/live_sync_test.cc b/chrome/test/live_sync/live_sync_test.cc
index fcf1e47..14ecf8d 100644
--- a/chrome/test/live_sync/live_sync_test.cc
+++ b/chrome/test/live_sync/live_sync_test.cc
@@ -229,14 +229,11 @@ void LiveSyncTest::SetUpInProcessBrowserTestFixture() {
net::RuleBasedHostResolverProc* resolver =
new net::RuleBasedHostResolverProc(host_resolver());
resolver->AllowDirectLookup("*.google.com");
- // Allow direct lookup of thawte.com. On Linux, we use Chromium's nss
- // implementation which uses ocsp.thawte.com for certificate verification.
- // Without this, running the test case on Linux causes an error as we make an
- // external DNS lookup of "ocsp.thawte.com".
+ // On Linux, we use Chromium's NSS implementation which uses the following
+ // hosts for certificate verification. Without these overrides, running the
+ // integration tests on Linux causes error as we make external DNS lookups.
resolver->AllowDirectLookup("*.thawte.com");
- // The new XMPP cert seems to use crl.geotrust.com on Linux.
resolver->AllowDirectLookup("*.geotrust.com");
- // SSL chain.
resolver->AllowDirectLookup("*.gstatic.com");
mock_host_resolver_override_.reset(
new net::ScopedDefaultHostResolverProc(resolver));
@@ -268,28 +265,20 @@ void LiveSyncTest::TearDownLocalTestServer() {
void LiveSyncTest::EnableNetwork(Profile* profile) {
SetProxyConfig(profile->GetRequestContext(),
net::ProxyConfig::CreateDirect());
- // Bugs: http://crbug.com/53857
- // http://crbug.com/53858
+ // TODO(rsimha): Remove this line once http://crbug.com/53857 is fixed.
net::NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
}
void LiveSyncTest::DisableNetwork(Profile* profile) {
- // Set the current proxy configuration to a nonexistent proxy to
- // effectively disable networking.
+ // Set the current proxy configuration to a nonexistent proxy to effectively
+ // disable networking.
net::ProxyConfig config;
config.proxy_rules().ParseFromString("http=127.0.0.1:0");
SetProxyConfig(profile->GetRequestContext(), config);
+ // TODO(rsimha): Remove this line once http://crbug.com/53857 is fixed.
net::NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
}
-bool LiveSyncTest::EnsureSyncServerConfiguration() {
- const CommandLine* cl = CommandLine::ForCurrentProcess();
- if (!cl->HasSwitch(switches::kSyncServiceURL))
- return true;
-
- return ConfigureSyncServer("user_email", username_);
-}
-
void LiveSyncTest::SetProxyConfig(URLRequestContextGetter* context_getter,
const net::ProxyConfig& proxy_config) {
base::WaitableEvent done(false, false);
@@ -301,19 +290,3 @@ void LiveSyncTest::SetProxyConfig(URLRequestContextGetter* context_getter,
proxy_config));
done.Wait();
}
-
-bool LiveSyncTest::ConfigureSyncServer(const std::string& name,
- const std::string& value) {
- std::string url = StringPrintf("http://%s:%d/chromiumsync/configure",
- 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(
- URLFetcher::Create(0, GURL(url), URLFetcher::POST, &delegate));
- fetcher->set_request_context(Profile::GetDefaultRequestContext());
- fetcher->set_upload_data("application/x-www-form-urlencoded", data);
- fetcher->Start();
- MessageLoop::current()->Run();
- return delegate.success();
-}