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/common/extensions/manifest_handlers/settings_overrides_handler.
h" | 5 #include "chrome/common/extensions/manifest_handlers/settings_overrides_handler.
h" |
6 | 6 |
7 #include "base/json/json_string_value_serializer.h" | 7 #include "base/json/json_string_value_serializer.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "extensions/common/error_utils.h" | 9 #include "extensions/common/error_utils.h" |
10 #include "extensions/common/extension.h" | 10 #include "extensions/common/extension.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 scoped_ptr<base::Value> root(json.Deserialize(NULL, &error)); | 155 scoped_ptr<base::Value> root(json.Deserialize(NULL, &error)); |
156 ASSERT_TRUE(root); | 156 ASSERT_TRUE(root); |
157 ASSERT_TRUE(root->IsType(base::Value::TYPE_DICTIONARY)); | 157 ASSERT_TRUE(root->IsType(base::Value::TYPE_DICTIONARY)); |
158 scoped_refptr<Extension> extension = Extension::Create( | 158 scoped_refptr<Extension> extension = Extension::Create( |
159 base::FilePath(FILE_PATH_LITERAL("//nonexistent")), | 159 base::FilePath(FILE_PATH_LITERAL("//nonexistent")), |
160 Manifest::INVALID_LOCATION, | 160 Manifest::INVALID_LOCATION, |
161 *static_cast<base::DictionaryValue*>(root.get()), | 161 *static_cast<base::DictionaryValue*>(root.get()), |
162 Extension::NO_FLAGS, | 162 Extension::NO_FLAGS, |
163 &error); | 163 &error); |
164 #if defined(OS_WIN) | 164 #if defined(OS_WIN) |
165 EXPECT_FALSE(extension); | 165 EXPECT_FALSE(extension.get()); |
166 EXPECT_EQ( | 166 EXPECT_EQ( |
167 extensions::ErrorUtils::FormatErrorMessage( | 167 extensions::ErrorUtils::FormatErrorMessage( |
168 extensions::manifest_errors::kInvalidEmptyDictionary, | 168 extensions::manifest_errors::kInvalidEmptyDictionary, |
169 extensions::manifest_keys::kSettingsOverride), | 169 extensions::manifest_keys::kSettingsOverride), |
170 error); | 170 error); |
171 #else | 171 #else |
172 EXPECT_TRUE(extension.get()); | 172 EXPECT_TRUE(extension.get()); |
173 EXPECT_FALSE( | 173 EXPECT_FALSE( |
174 extension->manifest()->HasPath(manifest_keys::kSettingsOverride)); | 174 extension->manifest()->HasPath(manifest_keys::kSettingsOverride)); |
175 #endif | 175 #endif |
176 } | 176 } |
177 | 177 |
178 } // namespace | 178 } // namespace |
OLD | NEW |