Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1139)

Side by Side Diff: chromeos/network/onc/onc_translator_unittest.cc

Issue 11414101: This adds ManagedNetworkConfigurationHandler first pass (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: upload after merge Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chromeos/network/onc/onc_translator_shill_to_onc.cc ('k') | chromeos/network/onc/onc_validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698