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

Unified Diff: ppapi/tests/test_case.h

Issue 8934003: WebSocket Pepper API: Add live object check to WebSocket PPAPI tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years 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
« no previous file with comments | « no previous file | ppapi/tests/test_websocket.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_case.h
diff --git a/ppapi/tests/test_case.h b/ppapi/tests/test_case.h
index e974c507811f212ee8e20088f41904052c9b9d20..8ea3aef5d7c3af2cb1cd78ccfc5c51104cbdeb36 100644
--- a/ppapi/tests/test_case.h
+++ b/ppapi/tests/test_case.h
@@ -153,6 +153,20 @@ class TestCaseFactory {
instance_->LogTest(#name, Test##name()); \
}
+#define RUN_TEST_WITH_REFERENCE_CHECK(name, test_filter) \
+ if (MatchesFilter(#name, test_filter)) { \
+ force_async_ = false; \
+ uint32_t objects = testing_interface_->GetLiveObjectsForInstance( \
+ instance_->pp_instance()); \
+ std::string error_message = Test##name(); \
+ if (error_message.empty() && \
+ testing_interface_->GetLiveObjectsForInstance( \
+ instance_->pp_instance()) != objects) \
+ error_message = MakeFailureMessage(__FILE__, __LINE__, \
+ "reference leak check"); \
+ instance_->LogTest(#name, error_message); \
+ }
+
// Like RUN_TEST above but forces functions taking callbacks to complete
// asynchronously on success or error.
#define RUN_TEST_FORCEASYNC(name, test_filter) \
« no previous file with comments | « no previous file | ppapi/tests/test_websocket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698