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

Unified Diff: chrome/browser/extensions/extension_function_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 | « chrome/browser/extensions/extension_function_test_utils.h ('k') | extensions/browser/api_test_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_function_test_utils.cc
diff --git a/chrome/browser/extensions/extension_function_test_utils.cc b/chrome/browser/extensions/extension_function_test_utils.cc
index d3990c390779a47f250a73cc9dcd51f86b60a547..4cf8a32a52b384c1b77c51398c3660063165f8b8 100644
--- a/chrome/browser/extensions/extension_function_test_utils.cc
+++ b/chrome/browser/extensions/extension_function_test_utils.cc
@@ -242,6 +242,16 @@ bool RunFunction(UIThreadExtensionFunction* function,
const std::string& args,
Browser* browser,
RunFunctionFlags flags) {
+ scoped_ptr<base::ListValue> parsed_args(ParseList(args));
+ EXPECT_TRUE(parsed_args.get())
+ << "Could not parse extension function arguments: " << args;
+ return RunFunction(function, parsed_args.Pass(), browser, flags);
+}
+
+bool RunFunction(UIThreadExtensionFunction* function,
+ scoped_ptr<base::ListValue> args,
+ Browser* browser,
+ RunFunctionFlags flags) {
TestFunctionDispatcherDelegate dispatcher_delegate(browser);
scoped_ptr<extensions::ExtensionFunctionDispatcher> dispatcher(
new extensions::ExtensionFunctionDispatcher(browser->profile(),
@@ -250,7 +260,7 @@ bool RunFunction(UIThreadExtensionFunction* function,
// only one place. See crbug.com/394840.
return extensions::api_test_utils::RunFunction(
function,
- args,
+ args.Pass(),
browser->profile(),
dispatcher.Pass(),
static_cast<extensions::api_test_utils::RunFunctionFlags>(flags));
« no previous file with comments | « chrome/browser/extensions/extension_function_test_utils.h ('k') | extensions/browser/api_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698