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 "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 Loading... |
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 Loading... |
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 |
OLD | NEW |