Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(546)

Unified Diff: extensions/browser/api_test_utils.cc

Issue 473363003: Adding support for args as ListValues in extension_function_test_utils. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/browser/api_test_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api_test_utils.cc
diff --git a/extensions/browser/api_test_utils.cc b/extensions/browser/api_test_utils.cc
index b18b249e58dd560a405d6e61a9753faae0c4e366..1c70b27bccda89f4ad4b16ecd98534db5dece4a0 100644
--- a/extensions/browser/api_test_utils.cc
+++ b/extensions/browser/api_test_utils.cc
@@ -137,12 +137,21 @@ bool RunFunction(UIThreadExtensionFunction* function,
content::BrowserContext* context,
scoped_ptr<extensions::ExtensionFunctionDispatcher> dispatcher,
RunFunctionFlags flags) {
- SendResponseDelegate response_delegate;
- function->set_test_delegate(&response_delegate);
scoped_ptr<base::ListValue> parsed_args(ParseList(args));
EXPECT_TRUE(parsed_args.get())
<< "Could not parse extension function arguments: " << args;
- function->SetArgs(parsed_args.get());
+ return RunFunction(
+ function, parsed_args.Pass(), context, dispatcher.Pass(), flags);
+}
+
+bool RunFunction(UIThreadExtensionFunction* function,
+ scoped_ptr<base::ListValue> args,
+ content::BrowserContext* context,
+ scoped_ptr<extensions::ExtensionFunctionDispatcher> dispatcher,
+ RunFunctionFlags flags) {
+ SendResponseDelegate response_delegate;
+ function->set_test_delegate(&response_delegate);
+ function->SetArgs(args.get());
CHECK(dispatcher);
function->set_dispatcher(dispatcher->AsWeakPtr());
« no previous file with comments | « extensions/browser/api_test_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698