| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/prefs/proxy_config_dictionary.h" | 9 #include "chrome/browser/prefs/proxy_config_dictionary.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 ASSERT_TRUE(dict.GetMode(&h.mode)); | 37 ASSERT_TRUE(dict.GetMode(&h.mode)); |
| 38 EXPECT_EQ(ProxyPrefs::MODE_AUTO_DETECT, h.mode); | 38 EXPECT_EQ(ProxyPrefs::MODE_AUTO_DETECT, h.mode); |
| 39 ASSERT_FALSE(dict.GetPacUrl(&h.bypass_list)); | 39 ASSERT_FALSE(dict.GetPacUrl(&h.bypass_list)); |
| 40 ASSERT_FALSE(dict.GetProxyServer(&h.proxy_server)); | 40 ASSERT_FALSE(dict.GetProxyServer(&h.proxy_server)); |
| 41 ASSERT_FALSE(dict.GetBypassList(&h.bypass_list)); | 41 ASSERT_FALSE(dict.GetBypassList(&h.bypass_list)); |
| 42 } | 42 } |
| 43 | 43 |
| 44 TEST(ProxyConfigDictionaryTest, CreatePacScript) { | 44 TEST(ProxyConfigDictionaryTest, CreatePacScript) { |
| 45 scoped_ptr<DictionaryValue> dict_value( | 45 scoped_ptr<DictionaryValue> dict_value( |
| 46 ProxyConfigDictionary::CreatePacScript("pac")); | 46 ProxyConfigDictionary::CreatePacScript("pac", false)); |
| 47 ProxyConfigDictionary dict(dict_value.get()); | 47 ProxyConfigDictionary dict(dict_value.get()); |
| 48 ProxyConfigHolder h; | 48 ProxyConfigHolder h; |
| 49 | 49 |
| 50 ASSERT_TRUE(dict.GetMode(&h.mode)); | 50 ASSERT_TRUE(dict.GetMode(&h.mode)); |
| 51 EXPECT_EQ(ProxyPrefs::MODE_PAC_SCRIPT, h.mode); | 51 EXPECT_EQ(ProxyPrefs::MODE_PAC_SCRIPT, h.mode); |
| 52 ASSERT_TRUE(dict.GetPacUrl(&h.bypass_list)); | 52 ASSERT_TRUE(dict.GetPacUrl(&h.bypass_list)); |
| 53 EXPECT_EQ("pac", h.bypass_list); | 53 EXPECT_EQ("pac", h.bypass_list); |
| 54 ASSERT_FALSE(dict.GetProxyServer(&h.proxy_server)); | 54 ASSERT_FALSE(dict.GetProxyServer(&h.proxy_server)); |
| 55 ASSERT_FALSE(dict.GetBypassList(&h.bypass_list)); | 55 ASSERT_FALSE(dict.GetBypassList(&h.bypass_list)); |
| 56 } | 56 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 75 scoped_ptr<DictionaryValue> dict_value(ProxyConfigDictionary::CreateSystem()); | 75 scoped_ptr<DictionaryValue> dict_value(ProxyConfigDictionary::CreateSystem()); |
| 76 ProxyConfigDictionary dict(dict_value.get()); | 76 ProxyConfigDictionary dict(dict_value.get()); |
| 77 ProxyConfigHolder h; | 77 ProxyConfigHolder h; |
| 78 | 78 |
| 79 ASSERT_TRUE(dict.GetMode(&h.mode)); | 79 ASSERT_TRUE(dict.GetMode(&h.mode)); |
| 80 EXPECT_EQ(ProxyPrefs::MODE_SYSTEM, h.mode); | 80 EXPECT_EQ(ProxyPrefs::MODE_SYSTEM, h.mode); |
| 81 ASSERT_FALSE(dict.GetPacUrl(&h.bypass_list)); | 81 ASSERT_FALSE(dict.GetPacUrl(&h.bypass_list)); |
| 82 ASSERT_FALSE(dict.GetProxyServer(&h.proxy_server)); | 82 ASSERT_FALSE(dict.GetProxyServer(&h.proxy_server)); |
| 83 ASSERT_FALSE(dict.GetBypassList(&h.bypass_list)); | 83 ASSERT_FALSE(dict.GetBypassList(&h.bypass_list)); |
| 84 } | 84 } |
| OLD | NEW |