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 ac5729a2ff0d16c3427076f0e388e3f1386169c1..5cf93ab9189eefac8954060042407cfd92420571 100644 |
--- a/extensions/renderer/api_bindings_system_unittest.cc |
+++ b/extensions/renderer/api_bindings_system_unittest.cc |
@@ -174,7 +174,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) { |
@@ -183,10 +183,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 |