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_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_TEST_UTILS_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_TEST_UTILS_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_TEST_UTILS_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_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" |
11 #include "extensions/common/manifest.h" | 11 #include "extensions/common/manifest.h" |
12 | 12 |
13 class Browser; | 13 class Browser; |
14 class UIThreadExtensionFunction; | 14 class UIThreadExtensionFunction; |
15 | 15 |
16 namespace base { | 16 namespace base { |
17 class Value; | 17 class Value; |
18 class DictionaryValue; | 18 class DictionaryValue; |
19 class ListValue; | 19 class ListValue; |
20 } | 20 } |
21 | 21 |
22 namespace extensions { | 22 namespace extensions { |
23 class Extension; | 23 class Extension; |
24 } | 24 } |
25 | 25 |
26 // TODO(ckehoe): Accept args as scoped_ptr<base::Value>, | 26 // TODO(ckehoe): Accept args as scoped_ptr<base::Value>, |
27 // and migrate existing users to the new API. | 27 // and migrate existing users to the new API. |
| 28 // This file is DEPRECATED. New tests should use the versions in |
| 29 // extensions/browser/api_test_utils.h. |
28 namespace extension_function_test_utils { | 30 namespace extension_function_test_utils { |
29 | 31 |
30 // Parse JSON and return as the specified type, or NULL if the JSON is invalid | 32 // Parse JSON and return as the specified type, or NULL if the JSON is invalid |
31 // or not the specified type. | 33 // or not the specified type. |
32 base::Value* ParseJSON(const std::string& data); | 34 base::Value* ParseJSON(const std::string& data); |
33 base::ListValue* ParseList(const std::string& data); | 35 base::ListValue* ParseList(const std::string& data); |
34 base::DictionaryValue* ParseDictionary(const std::string& data); | 36 base::DictionaryValue* ParseDictionary(const std::string& data); |
35 | 37 |
36 // Get |key| from |val| as the specified type. If |key| does not exist, or is | 38 // Get |key| from |val| as the specified type. If |key| does not exist, or is |
37 // not of the specified type, adds a failure to the current test and returns | 39 // not of the specified type, adds a failure to the current test and returns |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 Browser* browser, | 124 Browser* browser, |
123 RunFunctionFlags flags); | 125 RunFunctionFlags flags); |
124 bool RunFunction(UIThreadExtensionFunction* function, | 126 bool RunFunction(UIThreadExtensionFunction* function, |
125 scoped_ptr<base::ListValue> args, | 127 scoped_ptr<base::ListValue> args, |
126 Browser* browser, | 128 Browser* browser, |
127 RunFunctionFlags flags); | 129 RunFunctionFlags flags); |
128 | 130 |
129 } // namespace extension_function_test_utils | 131 } // namespace extension_function_test_utils |
130 | 132 |
131 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_TEST_UTILS_H_ | 133 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_TEST_UTILS_H_ |
OLD | NEW |