OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 EXPECT_TRUE(decider.effective_config().has_pac_url()); | 303 EXPECT_TRUE(decider.effective_config().has_pac_url()); |
304 EXPECT_EQ(rule.url, decider.effective_config().pac_url()); | 304 EXPECT_EQ(rule.url, decider.effective_config().pac_url()); |
305 } | 305 } |
306 | 306 |
307 class ProxyScriptDeciderQuickCheckTest : public ::testing::Test { | 307 class ProxyScriptDeciderQuickCheckTest : public ::testing::Test { |
308 public: | 308 public: |
309 ProxyScriptDeciderQuickCheckTest() | 309 ProxyScriptDeciderQuickCheckTest() |
310 : rule_(rules_.AddSuccessRule("http://wpad/wpad.dat")), | 310 : rule_(rules_.AddSuccessRule("http://wpad/wpad.dat")), |
311 fetcher_(&rules_) { } | 311 fetcher_(&rules_) { } |
312 | 312 |
313 virtual void SetUp() override { | 313 void SetUp() override { |
314 request_context_.set_host_resolver(&resolver_); | 314 request_context_.set_host_resolver(&resolver_); |
315 fetcher_.SetRequestContext(&request_context_); | 315 fetcher_.SetRequestContext(&request_context_); |
316 config_.set_auto_detect(true); | 316 config_.set_auto_detect(true); |
317 decider_.reset(new ProxyScriptDecider(&fetcher_, &dhcp_fetcher_, NULL)); | 317 decider_.reset(new ProxyScriptDecider(&fetcher_, &dhcp_fetcher_, NULL)); |
318 } | 318 } |
319 | 319 |
320 int StartDecider() { | 320 int StartDecider() { |
321 return decider_->Start(config_, base::TimeDelta(), true, | 321 return decider_->Start(config_, base::TimeDelta(), true, |
322 callback_.callback()); | 322 callback_.callback()); |
323 } | 323 } |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 | 768 |
769 // Run the message loop to let the DHCP fetch complete and post the results | 769 // Run the message loop to let the DHCP fetch complete and post the results |
770 // back. Before the fix linked to above, this would try to invoke on | 770 // back. Before the fix linked to above, this would try to invoke on |
771 // the callback object provided by ProxyScriptDecider after it was | 771 // the callback object provided by ProxyScriptDecider after it was |
772 // no longer valid. | 772 // no longer valid. |
773 base::MessageLoop::current()->RunUntilIdle(); | 773 base::MessageLoop::current()->RunUntilIdle(); |
774 } | 774 } |
775 | 775 |
776 } // namespace | 776 } // namespace |
777 } // namespace net | 777 } // namespace net |
OLD | NEW |