Chromium Code Reviews| 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 99538077849d50df18d55913a63527c233696be1..71e56d49bead00572276b2f7de652fec7d9e303f 100644 |
| --- a/chrome/browser/extensions/extension_function_test_utils.cc |
| +++ b/chrome/browser/extensions/extension_function_test_utils.cc |
| @@ -142,6 +142,24 @@ base::Value* RunFunctionAndReturnResult(UIThreadExtensionFunction* function, |
| return function->GetResultValue()->DeepCopy(); |
|
Aaron Boodman
2011/12/14 22:23:46
Was the only reason RunFunctionWithoutResult neede
Mike West
2011/12/14 22:41:59
Yes, that's what I originally did. Having a separa
Aaron Boodman
2011/12/14 22:44:35
You can just do that assertion at the call site.
Mike West
2011/12/14 22:59:03
Done.
|
| } |
| +bool RunFunctionWithoutResult(UIThreadExtensionFunction* function, |
| + const std::string& args, |
| + Browser* browser) { |
| + return RunFunctionWithoutResult(function, args, browser, NONE); |
| +} |
| +bool RunFunctionWithoutResult(UIThreadExtensionFunction* function, |
| + const std::string& args, |
| + Browser* browser, |
| + RunFunctionFlags flags) { |
| + scoped_refptr<ExtensionFunction> function_owner(function); |
| + bool success = RunFunction(function, args, browser, flags); |
| + EXPECT_TRUE(function->GetError().empty()) << "Unexpected error: " |
| + << function->GetError(); |
| + EXPECT_FALSE(function->GetResultValue()) << "Unexpected result value: " |
| + << function->GetResult(); |
| + return success; |
| +} |
| + |
| // This helps us be able to wait until an AsyncExtensionFunction calls |
| // SendResponse. |
| class SendResponseDelegate |