| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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( |
| 64 name, base::WrapUnique<base::Value>(new base::FundamentalValue(value))); | 64 name, base::WrapUnique<base::Value>(new base::Value(value))); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void SetString(RegistryDict* dict, | 67 void SetString(RegistryDict* dict, |
| 68 const std::string& name, | 68 const std::string& name, |
| 69 const std::string& value) { | 69 const std::string& value) { |
| 70 dict->SetValue(name, | 70 dict->SetValue(name, |
| 71 base::WrapUnique<base::Value>(new base::StringValue(value))); | 71 base::WrapUnique<base::Value>(new base::StringValue(value))); |
| 72 } | 72 } |
| 73 | 73 |
| 74 TEST(PRegParserTest, TestParseFile) { | 74 TEST(PRegParserTest, TestParseFile) { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 SetInteger(&expected, "ShowHomeButton", 1); | 114 SetInteger(&expected, "ShowHomeButton", 1); |
| 115 SetString(&expected, "Snowman", "\xE2\x98\x83"); | 115 SetString(&expected, "Snowman", "\xE2\x98\x83"); |
| 116 SetString(&expected, "Empty", ""); | 116 SetString(&expected, "Empty", ""); |
| 117 | 117 |
| 118 EXPECT_TRUE(RegistryDictEquals(dict, expected)); | 118 EXPECT_TRUE(RegistryDictEquals(dict, expected)); |
| 119 } | 119 } |
| 120 | 120 |
| 121 } // namespace | 121 } // namespace |
| 122 } // namespace preg_parser | 122 } // namespace preg_parser |
| 123 } // namespace policy | 123 } // namespace policy |
| OLD | NEW |