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 |
11 namespace chromeos { | 11 namespace chromeos { |
12 | 12 |
13 class NetworkPropertyUIDataTest : public testing::Test { | 13 class NetworkPropertyUIDataTest : public testing::Test { |
14 protected: | 14 protected: |
15 NetworkPropertyUIDataTest() {} | 15 NetworkPropertyUIDataTest() {} |
16 virtual ~NetworkPropertyUIDataTest() {} | 16 ~NetworkPropertyUIDataTest() override {} |
17 | 17 |
18 void CheckProperty(const NetworkPropertyUIData& property, | 18 void CheckProperty(const NetworkPropertyUIData& property, |
19 const base::Value* expected_default_value, | 19 const base::Value* expected_default_value, |
20 bool expected_managed, | 20 bool expected_managed, |
21 bool expected_editable) { | 21 bool expected_editable) { |
22 if (expected_default_value) { | 22 if (expected_default_value) { |
23 EXPECT_TRUE(base::Value::Equals(expected_default_value, | 23 EXPECT_TRUE(base::Value::Equals(expected_default_value, |
24 property.default_value())); | 24 property.default_value())); |
25 } else { | 25 } else { |
26 EXPECT_FALSE(property.default_value()); | 26 EXPECT_FALSE(property.default_value()); |
(...skipping 70 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 |