summaryrefslogtreecommitdiffstats
path: root/extensions/browser/api_test_utils.cc
diff options
context:
space:
mode:
authorckehoe@chromium.org <ckehoe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-16 08:16:15 +0000
committerckehoe@chromium.org <ckehoe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-16 08:17:30 +0000
commitfc672e1413bd795df83aaedc81d3407a85c9b0bf (patch)
treeb784cfd17d907c55402bdade4b5692a639617eb6 /extensions/browser/api_test_utils.cc
parent8bde78e43a8e05b5c42d43861d73e7face27cebf (diff)
downloadchromium_src-fc672e1413bd795df83aaedc81d3407a85c9b0bf.zip
chromium_src-fc672e1413bd795df83aaedc81d3407a85c9b0bf.tar.gz
chromium_src-fc672e1413bd795df83aaedc81d3407a85c9b0bf.tar.bz2
Adding support for args as ListValues in extension_function_test_utils.
Review URL: https://codereview.chromium.org/473363003 Cr-Commit-Position: refs/heads/master@{#290130} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290130 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions/browser/api_test_utils.cc')
-rw-r--r--extensions/browser/api_test_utils.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/extensions/browser/api_test_utils.cc b/extensions/browser/api_test_utils.cc
index b18b249..1c70b27 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());