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

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

Issue 11469026: Extending ONC validator's logging. Completing toplevel validation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@add_error_handling_to_validator
Patch Set: Rebased. Created 8 years 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
« no previous file with comments | « chromeos/network/onc/onc_signature.cc ('k') | chromeos/network/onc/onc_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 23 matching lines...) Expand all
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(
44 std::make_pair("valid.onc", "shill_ethernet.json"), 44 std::make_pair("managed_ethernet.onc", "shill_ethernet.json"),
45 std::make_pair("valid_l2tpipsec.onc", "shill_l2tpipsec.json"), 45 std::make_pair("valid_l2tpipsec.onc", "shill_l2tpipsec.json"),
46 std::make_pair("valid_openvpn.onc", "shill_openvpn.json"))); 46 std::make_pair("valid_openvpn.onc", "shill_openvpn.json")));
47 47
48 // Test the translation from Shill json to ONC. 48 // Test the translation from Shill json to ONC.
49 // 49 //
50 // Note: This translation direction doesn't have to reconstruct all of the ONC 50 // Note: This translation direction doesn't have to reconstruct all of the ONC
51 // fields, as Chrome doesn't need all of a Service's properties. 51 // fields, as Chrome doesn't need all of a Service's properties.
52 TEST(ONCTranslatorShillToOncTest, L2TPIPsec) { 52 TEST(ONCTranslatorShillToOncTest, L2TPIPsec) {
53 scoped_ptr<base::DictionaryValue> onc_network( 53 scoped_ptr<base::DictionaryValue> onc_network(
54 test_utils::ReadTestDictionary("valid_l2tpipsec.onc")); 54 test_utils::ReadTestDictionary("valid_l2tpipsec.onc"));
(...skipping 22 matching lines...) Expand all
77 test_utils::ReadTestDictionary("shill_openvpn.json")); 77 test_utils::ReadTestDictionary("shill_openvpn.json"));
78 78
79 scoped_ptr<base::DictionaryValue> translation(TranslateShillServiceToONCPart( 79 scoped_ptr<base::DictionaryValue> translation(TranslateShillServiceToONCPart(
80 *shill_network, &kNetworkConfigurationSignature)); 80 *shill_network, &kNetworkConfigurationSignature));
81 81
82 EXPECT_TRUE(test_utils::Equals(onc_network.get(), translation.get())); 82 EXPECT_TRUE(test_utils::Equals(onc_network.get(), translation.get()));
83 } 83 }
84 84
85 } // namespace onc 85 } // namespace onc
86 } // namespace chromeos 86 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/onc/onc_signature.cc ('k') | chromeos/network/onc/onc_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698