| Index: extensions/browser/api_test_utils.h
|
| diff --git a/extensions/browser/api_test_utils.h b/extensions/browser/api_test_utils.h
|
| index 3a059a65aafbf0d534610926dd2e4ea31546ed82..d80a856a2c4aa5e22dd8423edd90faae92c03aa2 100644
|
| --- a/extensions/browser/api_test_utils.h
|
| +++ b/extensions/browser/api_test_utils.h
|
| @@ -7,11 +7,13 @@
|
|
|
| #include <string>
|
|
|
| +#include "base/memory/ref_counted.h"
|
| #include "base/memory/scoped_ptr.h"
|
|
|
| class UIThreadExtensionFunction;
|
|
|
| namespace base {
|
| +class DictionaryValue;
|
| class ListValue;
|
| class Value;
|
| }
|
| @@ -21,6 +23,7 @@ class BrowserContext;
|
| }
|
|
|
| namespace extensions {
|
| +class Extension;
|
| class ExtensionFunctionDispatcher;
|
|
|
| // TODO(yoz): crbug.com/394840: Remove duplicate functionality in
|
| @@ -32,6 +35,22 @@ namespace api_test_utils {
|
|
|
| enum RunFunctionFlags { NONE = 0, INCLUDE_INCOGNITO = 1 << 0 };
|
|
|
| +// Parse JSON and return as the specified type, or NULL if the JSON is invalid
|
| +// or not the specified type.
|
| +base::DictionaryValue* ParseDictionary(const std::string& data);
|
| +
|
| +// Get |key| from |val| as the specified type. If |key| does not exist, or is
|
| +// not of the specified type, adds a failure to the current test and returns
|
| +// false, 0, empty string, etc.
|
| +bool GetBoolean(const base::DictionaryValue* val, const std::string& key);
|
| +int GetInteger(const base::DictionaryValue* val, const std::string& key);
|
| +std::string GetString(const base::DictionaryValue* val, const std::string& key);
|
| +
|
| +// Creates an extension instance with a specified extension value that can be
|
| +// attached to an ExtensionFunction before running.
|
| +scoped_refptr<extensions::Extension> CreateExtension(
|
| + base::DictionaryValue* test_extension_value);
|
| +
|
| // Run |function| with |args| and return the result. Adds an error to the
|
| // current test if |function| returns an error. Takes ownership of
|
| // |function|. The caller takes ownership of the result.
|
| @@ -94,7 +113,7 @@ bool RunFunction(UIThreadExtensionFunction* function,
|
| scoped_ptr<ExtensionFunctionDispatcher> dispatcher,
|
| RunFunctionFlags flags);
|
|
|
| -} // namespace function_test_utils
|
| +} // namespace api_test_utils
|
| } // namespace extensions
|
|
|
| #endif // EXTENSIONS_BROWSER_API_TEST_UTILS_H_
|
|
|