Chromium Code Reviews| Index: extensions/browser/api_test_utils.cc |
| diff --git a/extensions/browser/api_test_utils.cc b/extensions/browser/api_test_utils.cc |
| index 0dafbbe00789b69248ffe745a71cecc8337886e9..57b4a3e33277be4bfcb18dcde23882446b3fac69 100644 |
| --- a/extensions/browser/api_test_utils.cc |
| +++ b/extensions/browser/api_test_utils.cc |
| @@ -159,6 +159,26 @@ base::Value* RunFunctionWithDelegateAndReturnSingleResult( |
| return NULL; |
| } |
| +base::Value* RunFunctionWithDelegateAndReturnSingleResult( |
|
Devlin
2016/06/06 16:35:01
If you want to add this, we should do a few things
jdufault
2016/06/08 18:39:10
I've made the other version call into this one.
B
Devlin
2016/06/08 23:26:41
The old versions of this *should* return a std::un
Devlin
2016/06/13 14:50:23
Looks like this still needs to be done?
jdufault
2016/06/20 22:18:25
I've changed the APIs. This propagated to a number
|
| + 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, 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)) { |
| + return single_result->DeepCopy(); |
| + } |
| + return NULL; |
| +} |
| + |
| base::Value* RunFunctionAndReturnSingleResult( |
| UIThreadExtensionFunction* function, |
| const std::string& args, |