OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_BROWSER_API_TEST_UTILS_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_TEST_UTILS_H_ |
6 #define EXTENSIONS_BROWSER_API_TEST_UTILS_H_ | 6 #define EXTENSIONS_BROWSER_API_TEST_UTILS_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" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // Creates an extension instance with a specified extension value that can be | 50 // Creates an extension instance with a specified extension value that can be |
51 // attached to an ExtensionFunction before running. | 51 // attached to an ExtensionFunction before running. |
52 scoped_refptr<extensions::Extension> CreateExtension( | 52 scoped_refptr<extensions::Extension> CreateExtension( |
53 base::DictionaryValue* test_extension_value); | 53 base::DictionaryValue* test_extension_value); |
54 | 54 |
55 scoped_refptr<extensions::Extension> CreateExtension( | 55 scoped_refptr<extensions::Extension> CreateExtension( |
56 extensions::Manifest::Location location, | 56 extensions::Manifest::Location location, |
57 base::DictionaryValue* test_extension_value, | 57 base::DictionaryValue* test_extension_value, |
58 const std::string& id_input); | 58 const std::string& id_input); |
59 | 59 |
| 60 // Creates an extension instance with a specified location that can be attached |
| 61 // to an ExtensionFunction before running. |
| 62 scoped_refptr<extensions::Extension> CreateEmptyExtensionWithLocation( |
| 63 extensions::Manifest::Location location); |
| 64 |
60 // Run |function| with |args| and return the result. Adds an error to the | 65 // Run |function| with |args| and return the result. Adds an error to the |
61 // current test if |function| returns an error. Takes ownership of | 66 // current test if |function| returns an error. Takes ownership of |
62 // |function|. The caller takes ownership of the result. | 67 // |function|. The caller takes ownership of the result. |
63 base::Value* RunFunctionWithDelegateAndReturnSingleResult( | 68 base::Value* RunFunctionWithDelegateAndReturnSingleResult( |
64 UIThreadExtensionFunction* function, | 69 UIThreadExtensionFunction* function, |
65 const std::string& args, | 70 const std::string& args, |
66 content::BrowserContext* context, | 71 content::BrowserContext* context, |
67 scoped_ptr<ExtensionFunctionDispatcher> dispatcher); | 72 scoped_ptr<ExtensionFunctionDispatcher> dispatcher); |
68 base::Value* RunFunctionWithDelegateAndReturnSingleResult( | 73 base::Value* RunFunctionWithDelegateAndReturnSingleResult( |
69 UIThreadExtensionFunction* function, | 74 UIThreadExtensionFunction* function, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 bool RunFunction(UIThreadExtensionFunction* function, | 121 bool RunFunction(UIThreadExtensionFunction* function, |
117 scoped_ptr<base::ListValue> args, | 122 scoped_ptr<base::ListValue> args, |
118 content::BrowserContext* context, | 123 content::BrowserContext* context, |
119 scoped_ptr<ExtensionFunctionDispatcher> dispatcher, | 124 scoped_ptr<ExtensionFunctionDispatcher> dispatcher, |
120 RunFunctionFlags flags); | 125 RunFunctionFlags flags); |
121 | 126 |
122 } // namespace api_test_utils | 127 } // namespace api_test_utils |
123 } // namespace extensions | 128 } // namespace extensions |
124 | 129 |
125 #endif // EXTENSIONS_BROWSER_API_TEST_UTILS_H_ | 130 #endif // EXTENSIONS_BROWSER_API_TEST_UTILS_H_ |
OLD | NEW |