Index: extensions/renderer/api_bindings_system_unittest.cc |
diff --git a/extensions/renderer/api_bindings_system_unittest.cc b/extensions/renderer/api_bindings_system_unittest.cc |
index d9de2d47e3e97acb0599ba4fcee1aff440b204bf..a75274ff341789b7aa098162b626b448095dcd4e 100644 |
--- a/extensions/renderer/api_bindings_system_unittest.cc |
+++ b/extensions/renderer/api_bindings_system_unittest.cc |
@@ -172,7 +172,7 @@ void APIBindingsSystemTest::ValidateLastRequest( |
ValueToString(*last_request()->arguments)); |
} |
-void APIBindingsSystemTest::CallFunctionOnObject( |
+v8::Local<v8::Value> APIBindingsSystemTest::CallFunctionOnObject( |
v8::Local<v8::Context> context, |
v8::Local<v8::Object> object, |
const std::string& script_source) { |
@@ -181,10 +181,14 @@ void APIBindingsSystemTest::CallFunctionOnObject( |
v8::Local<v8::Function> func = |
FunctionFromString(context, wrapped_script_source); |
- ASSERT_FALSE(func.IsEmpty()); |
+ // Use ADD_FAILURE() to avoid messing up the return type with ASSERT. |
+ if (func.IsEmpty()) { |
+ ADD_FAILURE() << script_source; |
+ return v8::Local<v8::Value>(); |
+ } |
v8::Local<v8::Value> argv[] = {object}; |
- RunFunction(func, context, 1, argv); |
+ return RunFunction(func, context, 1, argv); |
} |
// Tests API object initialization, calling a method on the supplied APIs, and |