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 "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
6 #include "build/build_config.h" | 6 #include "build/build_config.h" |
7 #include "chrome/common/extensions/api/plugins/plugins_handler.h" | 7 #include "chrome/common/extensions/api/plugins/plugins_handler.h" |
8 #include "chrome/common/extensions/sync_helper.h" | 8 #include "chrome/common/extensions/sync_helper.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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 for (int i = 0; i < num_plugins; ++i) { | 58 for (int i = 0; i < num_plugins; ++i) { |
59 base::DictionaryValue* plugin = new base::DictionaryValue(); | 59 base::DictionaryValue* plugin = new base::DictionaryValue(); |
60 plugin->SetString(keys::kPluginsPath, std::string()); | 60 plugin->SetString(keys::kPluginsPath, std::string()); |
61 plugins->Set(i, plugin); | 61 plugins->Set(i, plugin); |
62 } | 62 } |
63 source.Set(keys::kPlugins, plugins); | 63 source.Set(keys::kPlugins, plugins); |
64 } | 64 } |
65 } | 65 } |
66 if (has_plugin_permission) { | 66 if (has_plugin_permission) { |
67 base::ListValue* plugins = new base::ListValue(); | 67 base::ListValue* plugins = new base::ListValue(); |
68 plugins->Set(0, new base::StringValue("plugin")); | 68 plugins->Set(0, new base::Value("plugin")); |
69 source.Set(keys::kPermissions, plugins); | 69 source.Set(keys::kPermissions, plugins); |
70 } | 70 } |
71 | 71 |
72 std::string error; | 72 std::string error; |
73 scoped_refptr<Extension> extension = Extension::Create( | 73 scoped_refptr<Extension> extension = Extension::Create( |
74 extension_path, location, source, creation_flags, &error); | 74 extension_path, location, source, creation_flags, &error); |
75 if (expected_error.empty()) | 75 if (expected_error.empty()) |
76 EXPECT_TRUE(extension.get()); | 76 EXPECT_TRUE(extension.get()); |
77 else | 77 else |
78 EXPECT_FALSE(extension.get()); | 78 EXPECT_FALSE(extension.get()); |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 EXTENSION, GURL(), GURL(), | 308 EXTENSION, GURL(), GURL(), |
309 Manifest::INTERNAL, base::FilePath(), | 309 Manifest::INTERNAL, base::FilePath(), |
310 Extension::NO_FLAGS, 0, true, | 310 Extension::NO_FLAGS, 0, true, |
311 ErrorUtils::FormatErrorMessage( | 311 ErrorUtils::FormatErrorMessage( |
312 errors::kPermissionNotAllowedInManifest, "plugin"))); | 312 errors::kPermissionNotAllowedInManifest, "plugin"))); |
313 } | 313 } |
314 | 314 |
315 #endif // !defined(OS_CHROMEOS) | 315 #endif // !defined(OS_CHROMEOS) |
316 | 316 |
317 } // namespace extensions | 317 } // namespace extensions |
OLD | NEW |