Index: extensions/browser/api_test_utils.cc |
diff --git a/extensions/browser/api_test_utils.cc b/extensions/browser/api_test_utils.cc |
index d6116e8b58c4466d4bd72f6687db11d333ad4931..0a362f4aaf10f0479b831692d0c5fda42c293a1d 100644 |
--- a/extensions/browser/api_test_utils.cc |
+++ b/extensions/browser/api_test_utils.cc |
@@ -145,12 +145,26 @@ base::Value* RunFunctionWithDelegateAndReturnSingleResult( |
content::BrowserContext* context, |
std::unique_ptr<extensions::ExtensionFunctionDispatcher> dispatcher, |
RunFunctionFlags flags) { |
+ std::unique_ptr<base::ListValue> parsed_args = ParseList(args); |
+ EXPECT_TRUE(parsed_args.get()) |
+ << "Could not parse extension function arguments: " << args; |
+ |
+ return RunFunctionWithDelegateAndReturnSingleResult( |
+ function, std::move(parsed_args), context, std::move(dispatcher), flags); |
+} |
+ |
+base::Value* RunFunctionWithDelegateAndReturnSingleResult( |
+ UIThreadExtensionFunction* function, |
+ std::unique_ptr<base::ListValue> args, |
+ content::BrowserContext* context, |
+ std::unique_ptr<extensions::ExtensionFunctionDispatcher> dispatcher, |
+ RunFunctionFlags flags) { |
scoped_refptr<ExtensionFunction> function_owner(function); |
// Without a callback the function will not generate a result. |
function->set_has_callback(true); |
- RunFunction(function, args, context, std::move(dispatcher), flags); |
- EXPECT_TRUE(function->GetError().empty()) |
- << "Unexpected error: " << function->GetError(); |
+ RunFunction(function, std::move(args), context, std::move(dispatcher), flags); |
+ EXPECT_TRUE(function->GetError().empty()) << "Unexpected error: " |
+ << function->GetError(); |
const base::Value* single_result = NULL; |
if (function->GetResultList() != NULL && |
function->GetResultList()->Get(0, &single_result)) { |