| 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 <cert.h> | 5 #include <cert.h> |
| 6 #include <pk11pub.h> | 6 #include <pk11pub.h> |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 } | 160 } |
| 161 | 161 |
| 162 // Load the ONC from |onc_file| using NetworkLibrary::LoadOncNetworks. Check | 162 // Load the ONC from |onc_file| using NetworkLibrary::LoadOncNetworks. Check |
| 163 // that return value matches |expect_successful_import| and the configuration | 163 // that return value matches |expect_successful_import| and the configuration |
| 164 // that would be sent to Shill matches |shill_json|. | 164 // that would be sent to Shill matches |shill_json|. |
| 165 void LoadOncAndVerifyNetworks(std::string onc_file, | 165 void LoadOncAndVerifyNetworks(std::string onc_file, |
| 166 std::string shill_json, | 166 std::string shill_json, |
| 167 onc::ONCSource source, | 167 onc::ONCSource source, |
| 168 bool expect_successful_import) { | 168 bool expect_successful_import) { |
| 169 ScopedMockUserManagerEnabler mock_user_manager; | 169 ScopedMockUserManagerEnabler mock_user_manager; |
| 170 mock_user_manager.user_manager()->SetLoggedInUser("madmax@my.domain.com"); | 170 mock_user_manager.user_manager()->SetActiveUser("madmax@my.domain.com"); |
| 171 EXPECT_CALL(*mock_user_manager.user_manager(), IsUserLoggedIn()) | 171 EXPECT_CALL(*mock_user_manager.user_manager(), IsUserLoggedIn()) |
| 172 .Times(AnyNumber()) | 172 .Times(AnyNumber()) |
| 173 .WillRepeatedly(Return(true)); | 173 .WillRepeatedly(Return(true)); |
| 174 | 174 |
| 175 std::string onc_blob = | 175 std::string onc_blob = |
| 176 onc::test_utils::ReadTestData(onc_file); | 176 onc::test_utils::ReadTestData(onc_file); |
| 177 | 177 |
| 178 scoped_ptr<base::Value> expected_value = | 178 scoped_ptr<base::Value> expected_value = |
| 179 google_apis::test_util::LoadJSONFile(shill_json); | 179 google_apis::test_util::LoadJSONFile(shill_json); |
| 180 base::DictionaryValue* expected_configs; | 180 base::DictionaryValue* expected_configs; |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 | 501 |
| 502 // TODO(stevenjb): Test network profiles. | 502 // TODO(stevenjb): Test network profiles. |
| 503 | 503 |
| 504 // TODO(stevenjb): Test network devices. | 504 // TODO(stevenjb): Test network devices. |
| 505 | 505 |
| 506 // TODO(stevenjb): Test data plans. | 506 // TODO(stevenjb): Test data plans. |
| 507 | 507 |
| 508 // TODO(stevenjb): Test monitor network / device. | 508 // TODO(stevenjb): Test monitor network / device. |
| 509 | 509 |
| 510 } // namespace chromeos | 510 } // namespace chromeos |
| OLD | NEW |