| 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 "chrome/browser/chromeos/cros/onc_network_parser.h" | 5 #include "chrome/browser/chromeos/cros/onc_network_parser.h" |
| 6 | 6 |
| 7 #include <cert.h> | 7 #include <cert.h> |
| 8 #include <keyhi.h> | 8 #include <keyhi.h> |
| 9 #include <pk11pub.h> | 9 #include <pk11pub.h> |
| 10 | 10 |
| (...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 net::HostPortPair(socks_host, kSocksPort))); | 894 net::HostPortPair(socks_host, kSocksPort))); |
| 895 // Verify bypass rules. | 895 // Verify bypass rules. |
| 896 net::ProxyBypassRules expected_bypass_rules; | 896 net::ProxyBypassRules expected_bypass_rules; |
| 897 expected_bypass_rules.AddRuleFromString("google.com"); | 897 expected_bypass_rules.AddRuleFromString("google.com"); |
| 898 expected_bypass_rules.AddRuleToBypassLocal(); | 898 expected_bypass_rules.AddRuleToBypassLocal(); |
| 899 EXPECT_TRUE(expected_bypass_rules.Equals(rules.bypass_rules)); | 899 EXPECT_TRUE(expected_bypass_rules.Equals(rules.bypass_rules)); |
| 900 } | 900 } |
| 901 | 901 |
| 902 TEST(OncNetworkParserUserExpansionTest, GetUserExpandedValue) { | 902 TEST(OncNetworkParserUserExpansionTest, GetUserExpandedValue) { |
| 903 ScopedMockUserManagerEnabler mock_user_manager; | 903 ScopedMockUserManagerEnabler mock_user_manager; |
| 904 mock_user_manager.user_manager()->SetLoggedInUser("onc@example.com", false); | 904 mock_user_manager.user_manager()->SetLoggedInUser("onc@example.com"); |
| 905 | 905 |
| 906 EXPECT_CALL(*mock_user_manager.user_manager(), IsUserLoggedIn()) | 906 EXPECT_CALL(*mock_user_manager.user_manager(), IsUserLoggedIn()) |
| 907 .Times(2) | 907 .Times(2) |
| 908 .WillRepeatedly(Return(false)); | 908 .WillRepeatedly(Return(false)); |
| 909 | 909 |
| 910 NetworkUIData::ONCSource source = NetworkUIData::ONC_SOURCE_USER_IMPORT; | 910 NetworkUIData::ONCSource source = NetworkUIData::ONC_SOURCE_USER_IMPORT; |
| 911 | 911 |
| 912 // Setup environment needed by UserManager. | 912 // Setup environment needed by UserManager. |
| 913 MessageLoop loop; | 913 MessageLoop loop; |
| 914 content::TestBrowserThread ui_thread(content::BrowserThread::UI, &loop); | 914 content::TestBrowserThread ui_thread(content::BrowserThread::UI, &loop); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 948 EXPECT_EQ(1, parser.GetNetworkConfigsSize()); | 948 EXPECT_EQ(1, parser.GetNetworkConfigsSize()); |
| 949 EXPECT_EQ(0, parser.GetCertificatesSize()); | 949 EXPECT_EQ(0, parser.GetCertificatesSize()); |
| 950 bool marked_for_removal = false; | 950 bool marked_for_removal = false; |
| 951 scoped_ptr<Network> network(parser.ParseNetwork(0, &marked_for_removal)); | 951 scoped_ptr<Network> network(parser.ParseNetwork(0, &marked_for_removal)); |
| 952 | 952 |
| 953 EXPECT_TRUE(marked_for_removal); | 953 EXPECT_TRUE(marked_for_removal); |
| 954 EXPECT_EQ("{485d6076-dd44-6b6d-69787465725f5045}", network->unique_id()); | 954 EXPECT_EQ("{485d6076-dd44-6b6d-69787465725f5045}", network->unique_id()); |
| 955 } | 955 } |
| 956 | 956 |
| 957 } // namespace chromeos | 957 } // namespace chromeos |
| OLD | NEW |