summaryrefslogtreecommitdiffstats
path: root/net/proxy/proxy_service_unittest.cc
diff options
context:
space:
mode:
authorrobertshield@google.com <robertshield@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-22 16:13:30 +0000
committerrobertshield@google.com <robertshield@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-22 16:13:30 +0000
commit97037a1032478f976048762aed86d963dc531c2f (patch)
treecae278fccda2bec154ff08c9fd5d66eae943de90 /net/proxy/proxy_service_unittest.cc
parent876d150b06190f15ea9c9758638f7b70714e37bd (diff)
downloadchromium_src-97037a1032478f976048762aed86d963dc531c2f.zip
chromium_src-97037a1032478f976048762aed86d963dc531c2f.tar.gz
chromium_src-97037a1032478f976048762aed86d963dc531c2f.tar.bz2
Revert of r16741 which appeared to cause a perf regression (???) on the builder.
TBR=thomasvl Review URL: http://codereview.chromium.org/115708 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16742 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy/proxy_service_unittest.cc')
-rw-r--r--net/proxy/proxy_service_unittest.cc50
1 files changed, 0 insertions, 50 deletions
diff --git a/net/proxy/proxy_service_unittest.cc b/net/proxy/proxy_service_unittest.cc
index a33dfce..a2b33d4 100644
--- a/net/proxy/proxy_service_unittest.cc
+++ b/net/proxy/proxy_service_unittest.cc
@@ -138,14 +138,6 @@ class ResultFuture : public base::RefCountedThreadSafe<ResultFuture> {
started_.Wait();
}
- void StartResetConfigService(
- net::ProxyConfigService* new_proxy_config_service) {
- DCHECK(MessageLoop::current() != io_message_loop_);
- io_message_loop_->PostTask(FROM_HERE, NewRunnableMethod(
- this, &ResultFuture::DoResetConfigService, new_proxy_config_service));
- started_.Wait();
- }
-
// Called on |io_message_loop_|.
void DoStartRequest(const GURL& url, RequestMethod method) {
DCHECK(MessageLoop::current() == io_message_loop_);
@@ -158,14 +150,6 @@ class ResultFuture : public base::RefCountedThreadSafe<ResultFuture> {
}
// Called on |io_message_loop_|.
- void DoResetConfigService(net::ProxyConfigService* new_proxy_config_service) {
- DCHECK(MessageLoop::current() == io_message_loop_);
- service_->ResetConfigService(new_proxy_config_service);
- started_.Signal();
- OnCompletion(0);
- }
-
- // Called on |io_message_loop_|.
void DoCancel() {
DCHECK(MessageLoop::current() == io_message_loop_);
if (!did_complete_)
@@ -246,13 +230,6 @@ class ProxyServiceWithFutures {
(*result)->StartReconsider(url, proxy_info);
}
- void ResetConfigService(scoped_refptr<ResultFuture>* result,
- net::ProxyConfigService* new_proxy_config_service) {
- *result = new ResultFuture(io_thread_.message_loop(),
- io_thread_state_->service);
- (*result)->StartResetConfigService(new_proxy_config_service);
- }
-
void SetProxyScriptFetcher(net::ProxyScriptFetcher* proxy_script_fetcher) {
io_thread_.message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
io_thread_state_.get(), &IOThreadState::DoSetProxyScriptFetcher,
@@ -315,12 +292,6 @@ class SyncProxyService {
return result->GetResultCode();
}
- int ResetConfigService(net::ProxyConfigService* new_proxy_config_service) {
- scoped_refptr<ResultFuture> result;
- service_.ResetConfigService(&result, new_proxy_config_service);
- return result->GetResultCode();
- }
-
private:
ProxyServiceWithFutures service_;
};
@@ -1125,24 +1096,3 @@ TEST(ProxyServiceTest, CancelWhilePACFetching) {
EXPECT_EQ("pac-v1.request3:80",
result3->GetProxyInfo().proxy_server().ToURI());
}
-
-TEST(ProxyServiceTest, ResetProxyConfigService) {
- net::ProxyConfig config1;
- config1.proxy_rules.ParseFromString("foopy1:8080");
- config1.auto_detect = false;
- scoped_ptr<SyncProxyService> service(
- new SyncProxyService(new MockProxyConfigService(config1),
- new MockProxyResolverWithoutFetch));
-
- net::ProxyInfo info;
- service->ResolveProxy(GURL("http://request1"), &info);
- EXPECT_EQ("foopy1:8080", info.proxy_server().ToURI());
-
- net::ProxyConfig config2;
- config2.proxy_rules.ParseFromString("foopy2:8080");
- config2.auto_detect = false;
- int result = service->ResetConfigService(new MockProxyConfigService(config2));
- DCHECK(result == 0);
- service->ResolveProxy(GURL("http://request2"), &info);
- EXPECT_EQ("foopy2:8080", info.proxy_server().ToURI());
-}