| 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 28 matching lines...) Expand all Loading... |
| 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::Value val_a("a"); | 44 base::Value val_a("a"); |
| 45 base::Value val_b("b"); | 45 base::Value val_b("b"); |
| 46 base::Value val_a_a("a_a"); | 46 base::Value val_a_a("a_a"); |
| 47 base::Value 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.CreateDeepCopy()); |
| 50 onc.Set("b", val_b.DeepCopy()); | 50 onc.Set("b", val_b.CreateDeepCopy()); |
| 51 onc.Set("a.a", val_a_a.DeepCopy()); | 51 onc.Set("a.a", val_a_a.CreateDeepCopy()); |
| 52 onc.Set("a.b", val_a_b.DeepCopy()); | 52 onc.Set("a.b", val_a_b.CreateDeepCopy()); |
| 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.CreateDeepCopy()); |
| 58 onc.Set("a.Recommended", recommended.DeepCopy()); | 58 onc.Set("a.Recommended", recommended.CreateDeepCopy()); |
| 59 | 59 |
| 60 NetworkPropertyUIData prop; | 60 NetworkPropertyUIData prop; |
| 61 | 61 |
| 62 prop.ParseOncProperty(onc::ONC_SOURCE_NONE, &onc, "a"); | 62 prop.ParseOncProperty(onc::ONC_SOURCE_NONE, &onc, "a"); |
| 63 CheckProperty(prop, NULL, false, true); | 63 CheckProperty(prop, NULL, false, true); |
| 64 | 64 |
| 65 onc::ONCSource source = onc::ONC_SOURCE_USER_IMPORT; | 65 onc::ONCSource source = onc::ONC_SOURCE_USER_IMPORT; |
| 66 | 66 |
| 67 prop.ParseOncProperty(source, &onc, "a"); | 67 prop.ParseOncProperty(source, &onc, "a"); |
| 68 CheckProperty(prop, NULL, false, true); | 68 CheckProperty(prop, NULL, false, true); |
| (...skipping 28 matching lines...) Expand all 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 |