| 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 "chromeos/network/onc/onc_translator.h" | 5 #include "chromeos/network/onc/onc_translator.h" |
| 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 "chromeos/network/onc/onc_constants.h" | 9 #include "chromeos/network/onc/onc_constants.h" |
| 10 #include "chromeos/network/onc/onc_signature.h" | 10 #include "chromeos/network/onc/onc_signature.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // Test the translation from ONC to Shill json. | 23 // Test the translation from ONC to Shill json. |
| 24 TEST_P(ONCTranslatorOncToShillTest, Translate) { | 24 TEST_P(ONCTranslatorOncToShillTest, Translate) { |
| 25 std::string source_onc_filename = GetParam().first; | 25 std::string source_onc_filename = GetParam().first; |
| 26 scoped_ptr<const base::DictionaryValue> onc_network( | 26 scoped_ptr<const base::DictionaryValue> onc_network( |
| 27 test_utils::ReadTestDictionary(source_onc_filename)); | 27 test_utils::ReadTestDictionary(source_onc_filename)); |
| 28 std::string result_json_filename = GetParam().second; | 28 std::string result_json_filename = GetParam().second; |
| 29 scoped_ptr<const base::DictionaryValue> shill_network( | 29 scoped_ptr<const base::DictionaryValue> shill_network( |
| 30 test_utils::ReadTestDictionary(result_json_filename)); | 30 test_utils::ReadTestDictionary(result_json_filename)); |
| 31 | 31 |
| 32 scoped_ptr<base::DictionaryValue> translation(TranslateONCObjectToShill( | 32 scoped_ptr<base::DictionaryValue> translation(TranslateONCObjectToShill( |
| 33 &kNetworkConfigurationSignature, *onc_network)); | 33 *onc_network, &kNetworkConfigurationSignature)); |
| 34 | 34 |
| 35 EXPECT_TRUE(test_utils::Equals(shill_network.get(), translation.get())); | 35 EXPECT_TRUE(test_utils::Equals(shill_network.get(), translation.get())); |
| 36 } | 36 } |
| 37 | 37 |
| 38 // Test different network types, such that each ONC object type is tested at | 38 // Test different network types, such that each ONC object type is tested at |
| 39 // least once. | 39 // least once. |
| 40 INSTANTIATE_TEST_CASE_P( | 40 INSTANTIATE_TEST_CASE_P( |
| 41 ONCTranslatorOncToShillTest, | 41 ONCTranslatorOncToShillTest, |
| 42 ONCTranslatorOncToShillTest, | 42 ONCTranslatorOncToShillTest, |
| 43 ::testing::Values( | 43 ::testing::Values( |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 test_utils::ReadTestDictionary("shill_openvpn_with_errors.json")); | 100 test_utils::ReadTestDictionary("shill_openvpn_with_errors.json")); |
| 101 | 101 |
| 102 scoped_ptr<base::DictionaryValue> translation(TranslateShillServiceToONCPart( | 102 scoped_ptr<base::DictionaryValue> translation(TranslateShillServiceToONCPart( |
| 103 *shill_network, &kNetworkConfigurationSignature)); | 103 *shill_network, &kNetworkConfigurationSignature)); |
| 104 | 104 |
| 105 EXPECT_TRUE(test_utils::Equals(onc_network.get(), translation.get())); | 105 EXPECT_TRUE(test_utils::Equals(onc_network.get(), translation.get())); |
| 106 } | 106 } |
| 107 | 107 |
| 108 } // namespace onc | 108 } // namespace onc |
| 109 } // namespace chromeos | 109 } // namespace chromeos |
| OLD | NEW |