Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Side by Side Diff: net/proxy/proxy_script_decider_unittest.cc

Issue 669813003: Update from chromium https://crrev.com/301725/ (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/proxy/proxy_resolver_v8_tracing_unittest.cc ('k') | net/proxy/proxy_service_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/proxy/proxy_resolver_v8_tracing_unittest.cc ('k') | net/proxy/proxy_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698