Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2162)

Unified Diff: ppapi/tests/test_case.cc

Issue 10081020: PPAPI: Make blocking completion callbacks work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: try again Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ppapi/tests/test_case.cc
diff --git a/ppapi/tests/test_case.cc b/ppapi/tests/test_case.cc
index 26f6d40ba5235ec7829e3129b03e913b8d97c404..cc0ba486521c7fc9034bbe81ab792af3b8db9285 100644
--- a/ppapi/tests/test_case.cc
+++ b/ppapi/tests/test_case.cc
@@ -107,8 +107,10 @@ bool TestCase::MatchesFilter(const std::string& test_name,
return filter.empty() || (test_name == filter);
}
-std::string TestCase::CheckResourcesAndVars() {
- std::string errors;
+std::string TestCase::CheckResourcesAndVars(std::string errors) {
+ if (!errors.empty())
+ return errors;
+
if (testing_interface_) {
// TODO(dmichael): Fix tests that leak resources and enable the following:
/*
@@ -143,4 +145,17 @@ std::string TestCase::CheckResourcesAndVars() {
return errors;
}
+// static
+void TestCase::QuitMainMessageLoop(PP_Instance instance) {
+ PP_Instance* heap_instance = new PP_Instance(instance);
+ pp::CompletionCallback callback(&DoQuitMainMessageLoop, heap_instance);
+ pp::Module::Get()->core()->CallOnMainThread(0, callback);
+}
+
+// static
+void TestCase::DoQuitMainMessageLoop(void* pp_instance, int32_t result) {
+ PP_Instance* instance = static_cast<PP_Instance*>(pp_instance);
+ GetTestingInterface()->QuitMessageLoop(*instance);
+ delete instance;
+}
« no previous file with comments | « ppapi/tests/test_case.h ('k') | ppapi/tests/test_url_loader.cc » ('j') | ppapi/thunk/enter.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698