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

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

Issue 897423002: Update {virtual,override,final} to follow C++11 style in net. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months 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
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 <map> 5 #include <map>
6 #include <string> 6 #include <string>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
12 #include "net/proxy/proxy_config.h" 12 #include "net/proxy/proxy_config.h"
13 #include "net/proxy/proxy_config_service_android.h" 13 #include "net/proxy/proxy_config_service_android.h"
14 #include "net/proxy/proxy_info.h" 14 #include "net/proxy/proxy_info.h"
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
16 16
17 namespace net { 17 namespace net {
18 18
19 namespace { 19 namespace {
20 20
21 class TestObserver : public ProxyConfigService::Observer { 21 class TestObserver : public ProxyConfigService::Observer {
22 public: 22 public:
23 TestObserver() : availability_(ProxyConfigService::CONFIG_UNSET) {} 23 TestObserver() : availability_(ProxyConfigService::CONFIG_UNSET) {}
24 24
25 // ProxyConfigService::Observer: 25 // ProxyConfigService::Observer:
26 virtual void OnProxyConfigChanged( 26 void OnProxyConfigChanged(
27 const ProxyConfig& config, 27 const ProxyConfig& config,
28 ProxyConfigService::ConfigAvailability availability) override { 28 ProxyConfigService::ConfigAvailability availability) override {
29 config_ = config; 29 config_ = config;
30 availability_ = availability; 30 availability_ = availability;
31 } 31 }
32 32
33 ProxyConfigService::ConfigAvailability availability() const { 33 ProxyConfigService::ConfigAvailability availability() const {
34 return availability_; 34 return availability_;
35 } 35 }
36 36
(...skipping 15 matching lines...) Expand all
52 // Note that the current thread's message loop is initialized by the test 52 // Note that the current thread's message loop is initialized by the test
53 // suite (see net/test/net_test_suite.cc). 53 // suite (see net/test/net_test_suite.cc).
54 ProxyConfigServiceAndroidTestBase(const StringMap& initial_configuration) 54 ProxyConfigServiceAndroidTestBase(const StringMap& initial_configuration)
55 : configuration_(initial_configuration), 55 : configuration_(initial_configuration),
56 message_loop_(base::MessageLoop::current()), 56 message_loop_(base::MessageLoop::current()),
57 service_(message_loop_->message_loop_proxy(), 57 service_(message_loop_->message_loop_proxy(),
58 message_loop_->message_loop_proxy(), 58 message_loop_->message_loop_proxy(),
59 base::Bind(&ProxyConfigServiceAndroidTestBase::GetProperty, 59 base::Bind(&ProxyConfigServiceAndroidTestBase::GetProperty,
60 base::Unretained(this))) {} 60 base::Unretained(this))) {}
61 61
62 virtual ~ProxyConfigServiceAndroidTestBase() {} 62 ~ProxyConfigServiceAndroidTestBase() override {}
63 63
64 // testing::Test: 64 // testing::Test:
65 virtual void SetUp() override { 65 void SetUp() override {
66 message_loop_->RunUntilIdle(); 66 message_loop_->RunUntilIdle();
67 service_.AddObserver(&observer_); 67 service_.AddObserver(&observer_);
68 } 68 }
69 69
70 virtual void TearDown() override { 70 void TearDown() override { service_.RemoveObserver(&observer_); }
71 service_.RemoveObserver(&observer_);
72 }
73 71
74 void ClearConfiguration() { 72 void ClearConfiguration() {
75 configuration_.clear(); 73 configuration_.clear();
76 } 74 }
77 75
78 void AddProperty(const std::string& key, const std::string& value) { 76 void AddProperty(const std::string& key, const std::string& value) {
79 configuration_[key] = value; 77 configuration_[key] = value;
80 } 78 }
81 79
82 std::string GetProperty(const std::string& key) { 80 std::string GetProperty(const std::string& key) {
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 TEST_F(ProxyConfigServiceAndroidTest, HttpProxySupercedesSocks) { 341 TEST_F(ProxyConfigServiceAndroidTest, HttpProxySupercedesSocks) {
344 // SOCKS proxy is ignored if default HTTP proxy defined. 342 // SOCKS proxy is ignored if default HTTP proxy defined.
345 AddProperty("proxyHost", "defaultproxy.com"); 343 AddProperty("proxyHost", "defaultproxy.com");
346 AddProperty("socksProxyHost", "socksproxy.com"); 344 AddProperty("socksProxyHost", "socksproxy.com");
347 AddProperty("socksProxyPort", "9000"); 345 AddProperty("socksProxyPort", "9000");
348 ProxySettingsChanged(); 346 ProxySettingsChanged();
349 TestMapping("http://example.com/", "PROXY defaultproxy.com:80"); 347 TestMapping("http://example.com/", "PROXY defaultproxy.com:80");
350 } 348 }
351 349
352 } // namespace net 350 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_config_service_android.cc ('k') | net/test/spawned_test_server/remote_test_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698