| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_TEST_UTIL_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_TEST_UTIL_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_TEST_UTIL_H_ | 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_TEST_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "extensions/common/extension_builder.h" | |
| 12 #include "extensions/common/manifest.h" | 11 #include "extensions/common/manifest.h" |
| 13 | 12 |
| 14 namespace extensions { | 13 namespace extensions { |
| 15 class Extension; | 14 class Extension; |
| 15 } |
| 16 | 16 |
| 17 // Newer functions go here. | 17 // Newer functions go in extensions/common/test_util.h. |
| 18 // TODO(mpcomplete): migrate older functions over. | |
| 19 namespace extension_test_util { | 18 namespace extension_test_util { |
| 20 | 19 |
| 21 ExtensionBuilder& BuildExtension(ExtensionBuilder& builder); | |
| 22 ExtensionBuilder& BuildExtensionWithPermissions(ExtensionBuilder& builder, | |
| 23 ListBuilder& permissions); | |
| 24 | |
| 25 } // namespace extension_test_util | |
| 26 } // namespace extensions | |
| 27 | |
| 28 namespace extension_test_util { | |
| 29 | |
| 30 // Return a very simple extension with id |id|. | |
| 31 scoped_refptr<extensions::Extension> CreateExtensionWithID(std::string id); | |
| 32 | |
| 33 // Helpers for loading manifests, |dir| is relative to chrome::DIR_TEST_DATA | 20 // Helpers for loading manifests, |dir| is relative to chrome::DIR_TEST_DATA |
| 34 // followed by "extensions". | 21 // followed by "extensions". |
| 35 scoped_refptr<extensions::Extension> LoadManifestUnchecked( | 22 scoped_refptr<extensions::Extension> LoadManifestUnchecked( |
| 36 const std::string& dir, | 23 const std::string& dir, |
| 37 const std::string& test_file, | 24 const std::string& test_file, |
| 38 extensions::Manifest::Location location, | 25 extensions::Manifest::Location location, |
| 39 int extra_flags, | 26 int extra_flags, |
| 40 const std::string& id, | 27 const std::string& id, |
| 41 std::string* error); | 28 std::string* error); |
| 42 | 29 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 60 scoped_refptr<extensions::Extension> LoadManifestStrict( | 47 scoped_refptr<extensions::Extension> LoadManifestStrict( |
| 61 const std::string& dir, | 48 const std::string& dir, |
| 62 const std::string& test_file); | 49 const std::string& test_file); |
| 63 | 50 |
| 64 scoped_refptr<extensions::Extension> LoadManifest(const std::string& dir, | 51 scoped_refptr<extensions::Extension> LoadManifest(const std::string& dir, |
| 65 const std::string& test_file); | 52 const std::string& test_file); |
| 66 | 53 |
| 67 } // namespace extension_test_util | 54 } // namespace extension_test_util |
| 68 | 55 |
| 69 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_TEST_UTIL_H_ | 56 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_TEST_UTIL_H_ |
| OLD | NEW |