OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/options/network_property_ui_data.h" | 5 #include "chrome/browser/chromeos/options/network_property_ui_data.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "components/onc/onc_constants.h" | 8 #include "components/onc/onc_constants.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 NetworkPropertyUIData empty_prop; | 34 NetworkPropertyUIData empty_prop; |
35 CheckProperty(empty_prop, NULL, false, true); | 35 CheckProperty(empty_prop, NULL, false, true); |
36 | 36 |
37 NetworkPropertyUIData null_prop(onc::ONC_SOURCE_NONE); | 37 NetworkPropertyUIData null_prop(onc::ONC_SOURCE_NONE); |
38 CheckProperty(null_prop, NULL, false, true); | 38 CheckProperty(null_prop, NULL, false, true); |
39 } | 39 } |
40 | 40 |
41 TEST_F(NetworkPropertyUIDataTest, ParseOncProperty) { | 41 TEST_F(NetworkPropertyUIDataTest, ParseOncProperty) { |
42 base::DictionaryValue onc; | 42 base::DictionaryValue onc; |
43 | 43 |
44 base::StringValue val_a("a"); | 44 base::Value val_a("a"); |
45 base::StringValue val_b("b"); | 45 base::Value val_b("b"); |
46 base::StringValue val_a_a("a_a"); | 46 base::Value val_a_a("a_a"); |
47 base::StringValue val_a_b("a_b"); | 47 base::Value val_a_b("a_b"); |
48 | 48 |
49 onc.Set("a", val_a.DeepCopy()); | 49 onc.Set("a", val_a.DeepCopy()); |
50 onc.Set("b", val_b.DeepCopy()); | 50 onc.Set("b", val_b.DeepCopy()); |
51 onc.Set("a.a", val_a_a.DeepCopy()); | 51 onc.Set("a.a", val_a_a.DeepCopy()); |
52 onc.Set("a.b", val_a_b.DeepCopy()); | 52 onc.Set("a.b", val_a_b.DeepCopy()); |
53 base::ListValue recommended; | 53 base::ListValue recommended; |
54 recommended.AppendString("b"); | 54 recommended.AppendString("b"); |
55 recommended.AppendString("c"); | 55 recommended.AppendString("c"); |
56 recommended.AppendString("a.a"); | 56 recommended.AppendString("a.a"); |
57 onc.Set("Recommended", recommended.DeepCopy()); | 57 onc.Set("Recommended", recommended.DeepCopy()); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 CheckProperty(prop, NULL, false, true); | 97 CheckProperty(prop, NULL, false, true); |
98 | 98 |
99 prop.ParseOncProperty(source, &onc, "a.d"); | 99 prop.ParseOncProperty(source, &onc, "a.d"); |
100 CheckProperty(prop, NULL, true, false); | 100 CheckProperty(prop, NULL, true, false); |
101 | 101 |
102 prop.ParseOncProperty(source, NULL, "a.e"); | 102 prop.ParseOncProperty(source, NULL, "a.e"); |
103 CheckProperty(prop, NULL, true, false); | 103 CheckProperty(prop, NULL, true, false); |
104 } | 104 } |
105 | 105 |
106 } // namespace chromeos | 106 } // namespace chromeos |
OLD | NEW |