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

Unified Diff: chrome/browser/extensions/extension_function_test_utils.cc

Issue 10694106: Added support for multiple parameters to Extension API callbacks. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Indentation fixes and comment. Created 8 years, 5 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
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 2f0fc463ee29eb9800571ef5450584fe8c8c2d86..6d7e7d3b214d648bb66a1a0fbab9c10cc2682336 100644
--- a/chrome/browser/extensions/extension_function_test_utils.cc
+++ b/chrome/browser/extensions/extension_function_test_utils.cc
@@ -130,25 +130,31 @@ std::string RunFunctionAndReturnError(UIThreadExtensionFunction* function,
RunFunctionFlags flags) {
scoped_refptr<ExtensionFunction> function_owner(function);
RunFunction(function, args, browser, flags);
- EXPECT_FALSE(function->GetResultValue()) << "Did not expect a result";
+ EXPECT_FALSE(function->GetResultsListValue()) << "Did not expect a result";
return function->GetError();
}
-base::Value* RunFunctionAndReturnResult(UIThreadExtensionFunction* function,
- const std::string& args,
- Browser* browser) {
- return RunFunctionAndReturnResult(function, args, browser, NONE);
+base::Value* RunFunctionAndReturnSingleResult(
+ UIThreadExtensionFunction* function,
+ const std::string& args,
+ Browser* browser) {
+ return RunFunctionAndReturnSingleResult(function, args, browser, NONE);
}
-base::Value* RunFunctionAndReturnResult(UIThreadExtensionFunction* function,
- const std::string& args,
- Browser* browser,
- RunFunctionFlags flags) {
+base::Value* RunFunctionAndReturnSingleResult(
+ UIThreadExtensionFunction* function,
+ const std::string& args,
+ Browser* browser,
+ RunFunctionFlags flags) {
scoped_refptr<ExtensionFunction> function_owner(function);
RunFunction(function, args, browser, flags);
EXPECT_TRUE(function->GetError().empty()) << "Unexpected error: "
<< function->GetError();
- return (function->GetResultValue() == NULL) ? NULL :
- function->GetResultValue()->DeepCopy();
+ base::Value* single_result;
Aaron Boodman 2012/07/09 04:39:31 initialize primitives
Matt Tytel 2012/07/10 18:50:45 Done.
+ if (function->GetResultsListValue() != NULL &&
+ function->GetResultsListValue()->Get(0, &single_result)) {
+ return single_result->DeepCopy();
+ }
+ return NULL;
}
// This helps us be able to wait until an AsyncExtensionFunction calls

Powered by Google App Engine
This is Rietveld 408576698