OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "components/policy/core/common/preg_parser.h" | 5 #include "components/policy/core/common/preg_parser.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 << "=" << *iter_value_b->second.get(); | 53 << "=" << *iter_value_b->second.get(); |
54 } | 54 } |
55 } | 55 } |
56 | 56 |
57 return testing::AssertionSuccess(); | 57 return testing::AssertionSuccess(); |
58 } | 58 } |
59 | 59 |
60 void SetInteger(RegistryDict* dict, | 60 void SetInteger(RegistryDict* dict, |
61 const std::string& name, | 61 const std::string& name, |
62 int value) { | 62 int value) { |
63 dict->SetValue( | 63 dict->SetValue(name, base::WrapUnique<base::Value>(new base::Value(value))); |
64 name, base::WrapUnique<base::Value>(new base::FundamentalValue(value))); | |
65 } | 64 } |
66 | 65 |
67 void SetString(RegistryDict* dict, | 66 void SetString(RegistryDict* dict, |
68 const std::string& name, | 67 const std::string& name, |
69 const std::string& value) { | 68 const std::string& value) { |
70 dict->SetValue(name, | 69 dict->SetValue(name, |
71 base::WrapUnique<base::Value>(new base::StringValue(value))); | 70 base::WrapUnique<base::Value>(new base::StringValue(value))); |
72 } | 71 } |
73 | 72 |
74 TEST(PRegParserTest, TestParseFile) { | 73 TEST(PRegParserTest, TestParseFile) { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 SetInteger(&expected, "ShowHomeButton", 1); | 113 SetInteger(&expected, "ShowHomeButton", 1); |
115 SetString(&expected, "Snowman", "\xE2\x98\x83"); | 114 SetString(&expected, "Snowman", "\xE2\x98\x83"); |
116 SetString(&expected, "Empty", ""); | 115 SetString(&expected, "Empty", ""); |
117 | 116 |
118 EXPECT_TRUE(RegistryDictEquals(dict, expected)); | 117 EXPECT_TRUE(RegistryDictEquals(dict, expected)); |
119 } | 118 } |
120 | 119 |
121 } // namespace | 120 } // namespace |
122 } // namespace preg_parser | 121 } // namespace preg_parser |
123 } // namespace policy | 122 } // namespace policy |
OLD | NEW |