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

Side by Side Diff: components/policy/core/browser/proxy_policy_handler_unittest.cc

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/policy/core/browser/proxy_policy_handler.h" 5 #include "components/policy/core/browser/proxy_policy_handler.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 28 matching lines...) Expand all
39 39
40 protected: 40 protected:
41 // Verify that all the proxy prefs are set to the specified expected values. 41 // Verify that all the proxy prefs are set to the specified expected values.
42 void VerifyProxyPrefs( 42 void VerifyProxyPrefs(
43 const std::string& expected_proxy_server, 43 const std::string& expected_proxy_server,
44 const std::string& expected_proxy_pac_url, 44 const std::string& expected_proxy_pac_url,
45 const std::string& expected_proxy_bypass_list, 45 const std::string& expected_proxy_bypass_list,
46 const ProxyPrefs::ProxyMode& expected_proxy_mode) { 46 const ProxyPrefs::ProxyMode& expected_proxy_mode) {
47 const base::Value* value = NULL; 47 const base::Value* value = NULL;
48 ASSERT_TRUE(store_->GetValue(proxy_config::prefs::kProxy, &value)); 48 ASSERT_TRUE(store_->GetValue(proxy_config::prefs::kProxy, &value));
49 ASSERT_EQ(base::Value::TYPE_DICTIONARY, value->GetType()); 49 ASSERT_EQ(base::Value::Type::DICTIONARY, value->GetType());
50 ProxyConfigDictionary dict( 50 ProxyConfigDictionary dict(
51 static_cast<const base::DictionaryValue*>(value)); 51 static_cast<const base::DictionaryValue*>(value));
52 std::string s; 52 std::string s;
53 if (expected_proxy_server.empty()) { 53 if (expected_proxy_server.empty()) {
54 EXPECT_FALSE(dict.GetProxyServer(&s)); 54 EXPECT_FALSE(dict.GetProxyServer(&s));
55 } else { 55 } else {
56 ASSERT_TRUE(dict.GetProxyServer(&s)); 56 ASSERT_TRUE(dict.GetProxyServer(&s));
57 EXPECT_EQ(expected_proxy_server, s); 57 EXPECT_EQ(expected_proxy_server, s);
58 } 58 }
59 if (expected_proxy_pac_url.empty()) { 59 if (expected_proxy_pac_url.empty()) {
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 policy.Set(key::kProxyServerMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, 293 policy.Set(key::kProxyServerMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
294 POLICY_SOURCE_CLOUD, base::MakeUnique<base::FundamentalValue>(i), 294 POLICY_SOURCE_CLOUD, base::MakeUnique<base::FundamentalValue>(i),
295 nullptr); 295 nullptr);
296 UpdateProviderPolicy(policy); 296 UpdateProviderPolicy(policy);
297 const base::Value* value = nullptr; 297 const base::Value* value = nullptr;
298 EXPECT_FALSE(store_->GetValue(proxy_config::prefs::kProxy, &value)); 298 EXPECT_FALSE(store_->GetValue(proxy_config::prefs::kProxy, &value));
299 } 299 }
300 } 300 }
301 301
302 } // namespace policy 302 } // namespace policy
OLDNEW
« no previous file with comments | « components/policy/core/browser/proxy_policy_handler.cc ('k') | components/policy/core/browser/url_blacklist_policy_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698