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

Side by Side Diff: chrome/browser/extensions/api/proxy/proxy_apitest.cc

Issue 2785883003: Use unique_ptr<DictionaryValue> in ProxyConfigDictionary (Closed)
Patch Set: Fix compilation Created 3 years, 8 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 "build/build_config.h" 5 #include "build/build_config.h"
6 #include "chrome/browser/extensions/extension_apitest.h" 6 #include "chrome/browser/extensions/extension_apitest.h"
7 #include "chrome/browser/extensions/extension_util.h" 7 #include "chrome/browser/extensions/extension_util.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/common/chrome_switches.h" 10 #include "chrome/common/chrome_switches.h"
(...skipping 19 matching lines...) Expand all
30 const std::string& expected_server, 30 const std::string& expected_server,
31 const std::string& bypass, 31 const std::string& bypass,
32 const std::string& expected_pac_url, 32 const std::string& expected_pac_url,
33 PrefService* pref_service) { 33 PrefService* pref_service) {
34 const PrefService::Preference* pref = 34 const PrefService::Preference* pref =
35 pref_service->FindPreference(proxy_config::prefs::kProxy); 35 pref_service->FindPreference(proxy_config::prefs::kProxy);
36 ASSERT_TRUE(pref != NULL); 36 ASSERT_TRUE(pref != NULL);
37 EXPECT_TRUE(pref->IsExtensionControlled()); 37 EXPECT_TRUE(pref->IsExtensionControlled());
38 38
39 ProxyConfigDictionary dict( 39 ProxyConfigDictionary dict(
40 pref_service->GetDictionary(proxy_config::prefs::kProxy)); 40 pref_service->GetDictionary(proxy_config::prefs::kProxy)
41 ->CreateDeepCopy());
41 42
42 ProxyPrefs::ProxyMode mode; 43 ProxyPrefs::ProxyMode mode;
43 ASSERT_TRUE(dict.GetMode(&mode)); 44 ASSERT_TRUE(dict.GetMode(&mode));
44 EXPECT_EQ(expected_mode, mode); 45 EXPECT_EQ(expected_mode, mode);
45 46
46 std::string value; 47 std::string value;
47 if (!bypass.empty()) { 48 if (!bypass.empty()) {
48 ASSERT_TRUE(dict.GetBypassList(&value)); 49 ASSERT_TRUE(dict.GetBypassList(&value));
49 EXPECT_EQ(bypass, value); 50 EXPECT_EQ(bypass, value);
50 } else { 51 } else {
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 RunExtensionSubtest("proxy/events", "invalid_proxy.html")) << message_; 326 RunExtensionSubtest("proxy/events", "invalid_proxy.html")) << message_;
326 } 327 }
327 328
328 // Tests error events: PAC script parse error. 329 // Tests error events: PAC script parse error.
329 IN_PROC_BROWSER_TEST_F(ProxySettingsApiTest, ProxyEventsParseError) { 330 IN_PROC_BROWSER_TEST_F(ProxySettingsApiTest, ProxyEventsParseError) {
330 ASSERT_TRUE( 331 ASSERT_TRUE(
331 RunExtensionSubtest("proxy/events", "parse_error.html")) << message_; 332 RunExtensionSubtest("proxy/events", "parse_error.html")) << message_;
332 } 333 }
333 334
334 } // namespace extensions 335 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698