Index: ppapi/tests/test_utils.cc |
diff --git a/ppapi/tests/test_utils.cc b/ppapi/tests/test_utils.cc |
index 30246ab1b0b76a40b41b72d7a960f81f59fa7247..fcaff40b35422e00174a1df8dcc53972cd8d6d28 100644 |
--- a/ppapi/tests/test_utils.cc |
+++ b/ppapi/tests/test_utils.cc |
@@ -26,16 +26,17 @@ std::string ReportError(const char* method, int32_t error) { |
return result; |
} |
-TestCompletionCallback::TestCompletionCallback() |
+TestCompletionCallback::TestCompletionCallback(PP_Instance instance) |
: result_(PP_ERROR_WOULDBLOCK), |
post_quit_task_(false), |
- run_count_(0) { |
+ run_count_(0), |
+ instance_(instance) { |
} |
int32_t TestCompletionCallback::WaitForResult() { |
result_ = PP_ERROR_WOULDBLOCK; // Reset |
post_quit_task_ = true; |
- GetTestingInterface()->RunMessageLoop(); |
+ GetTestingInterface()->RunMessageLoop(instance_); |
return result_; |
} |
@@ -52,6 +53,6 @@ void TestCompletionCallback::Handler(void* user_data, int32_t result) { |
callback->run_count_++; |
if (callback->post_quit_task_) { |
callback->post_quit_task_ = false; |
- GetTestingInterface()->QuitMessageLoop(); |
+ GetTestingInterface()->QuitMessageLoop(callback->instance_); |
} |
} |