| 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 "chrome/common/extensions/manifest.h" |
| 11 | 12 |
| 12 namespace extensions { | 13 namespace extensions { |
| 13 class Extension; | 14 class Extension; |
| 14 } | 15 } |
| 15 | 16 |
| 16 namespace extension_test_util { | 17 namespace extension_test_util { |
| 17 | 18 |
| 18 // Makes a fake extension id using the given |seed|. | 19 // Makes a fake extension id using the given |seed|. |
| 19 std::string MakeId(std::string seed); | 20 std::string MakeId(std::string seed); |
| 20 | 21 |
| 21 // Return a very simple extension with id |id|. | 22 // Return a very simple extension with id |id|. |
| 22 scoped_refptr<extensions::Extension> CreateExtensionWithID(std::string id); | 23 scoped_refptr<extensions::Extension> CreateExtensionWithID(std::string id); |
| 23 | 24 |
| 25 // Helpers for loading manifests, |dir| is relative to chrome::DIR_TEST_DATA |
| 26 // followed by "extensions". |
| 27 scoped_refptr<extensions::Extension> LoadManifestUnchecked( |
| 28 const std::string& dir, |
| 29 const std::string& test_file, |
| 30 extensions::Manifest::Location location, |
| 31 int extra_flags, |
| 32 const std::string& id, |
| 33 std::string* error); |
| 34 |
| 35 scoped_refptr<extensions::Extension> LoadManifestUnchecked( |
| 36 const std::string& dir, |
| 37 const std::string& test_file, |
| 38 extensions::Manifest::Location location, |
| 39 int extra_flags, |
| 40 std::string* error); |
| 41 |
| 42 scoped_refptr<extensions::Extension> LoadManifest( |
| 43 const std::string& dir, |
| 44 const std::string& test_file, |
| 45 extensions::Manifest::Location location, |
| 46 int extra_flags); |
| 47 |
| 48 scoped_refptr<extensions::Extension> LoadManifest(const std::string& dir, |
| 49 const std::string& test_file, |
| 50 int extra_flags); |
| 51 |
| 52 scoped_refptr<extensions::Extension> LoadManifestStrict( |
| 53 const std::string& dir, |
| 54 const std::string& test_file); |
| 55 |
| 56 scoped_refptr<extensions::Extension> LoadManifest(const std::string& dir, |
| 57 const std::string& test_file); |
| 58 |
| 24 } // namespace extension_test_util | 59 } // namespace extension_test_util |
| 25 | 60 |
| 26 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_TEST_UTIL_H_ | 61 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_TEST_UTIL_H_ |
| OLD | NEW |