| 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 "net/proxy/proxy_config_service_linux.h" | 5 #include "net/proxy/proxy_config_service_linux.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 // Mapping from a setting name to the location of the corresponding | 85 // Mapping from a setting name to the location of the corresponding |
| 86 // value (inside a EnvVarValues or GConfValues struct). | 86 // value (inside a EnvVarValues or GConfValues struct). |
| 87 template<typename key_type, typename value_type> | 87 template<typename key_type, typename value_type> |
| 88 struct SettingsTable { | 88 struct SettingsTable { |
| 89 typedef std::map<key_type, value_type*> map_type; | 89 typedef std::map<key_type, value_type*> map_type; |
| 90 | 90 |
| 91 // Gets the value from its location | 91 // Gets the value from its location |
| 92 value_type Get(key_type key) { | 92 value_type Get(key_type key) { |
| 93 auto it = settings.find(key); | 93 auto it = settings.find(key); |
| 94 // In case there's a typo or the unittest becomes out of sync. | 94 // In case there's a typo or the unittest becomes out of sync. |
| 95 CHECK(it != settings.end()) << "key " << key << " not found"; | 95 // key |key| not found |
| 96 CHECK(it != settings.end()); |
| 96 value_type* value_ptr = it->second; | 97 value_type* value_ptr = it->second; |
| 97 return *value_ptr; | 98 return *value_ptr; |
| 98 } | 99 } |
| 99 | 100 |
| 100 map_type settings; | 101 map_type settings; |
| 101 }; | 102 }; |
| 102 | 103 |
| 103 class MockEnvironment : public base::Environment { | 104 class MockEnvironment : public base::Environment { |
| 104 public: | 105 public: |
| 105 MockEnvironment() { | 106 MockEnvironment() { |
| (...skipping 1566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1672 EXPECT_EQ(ProxyConfigService::CONFIG_VALID, | 1673 EXPECT_EQ(ProxyConfigService::CONFIG_VALID, |
| 1673 sync_config_getter.SyncGetLatestProxyConfig(&config)); | 1674 sync_config_getter.SyncGetLatestProxyConfig(&config)); |
| 1674 EXPECT_FALSE(config.auto_detect()); | 1675 EXPECT_FALSE(config.auto_detect()); |
| 1675 EXPECT_TRUE(slaverc5_rules.Matches(config.proxy_rules())); | 1676 EXPECT_TRUE(slaverc5_rules.Matches(config.proxy_rules())); |
| 1676 } | 1677 } |
| 1677 } | 1678 } |
| 1678 | 1679 |
| 1679 } // namespace | 1680 } // namespace |
| 1680 | 1681 |
| 1681 } // namespace net | 1682 } // namespace net |
| OLD | NEW |