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

Unified Diff: ppapi/tests/test_case.h

Issue 6899055: PPAPI: Force async callback invocation option. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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
« no previous file with comments | « ppapi/tests/arch_dependent_sizes_64.h ('k') | ppapi/tests/test_case.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_case.h
===================================================================
--- ppapi/tests/test_case.h (revision 91178)
+++ ppapi/tests/test_case.h (working copy)
@@ -69,6 +69,9 @@
// NULL unless InitTestingInterface is called.
const PPB_Testing_Dev* testing_interface_;
+ // Force asynchronous completion of any operation taking a callback.
+ bool force_async_;
+
private:
// Holds the test object, if any was retrieved from CreateTestObject.
pp::Var test_object_;
@@ -114,10 +117,22 @@
// Helper macro for calling functions implementing specific tests in the
// RunTest function. This assumes the function name is TestFoo where Foo is the
-// test name,
+// test |name|.
#define RUN_TEST(name) \
+ force_async_ = false; \
instance_->LogTest(#name, Test##name());
+// Like RUN_TEST above but forces functions taking callbacks to complete
+// asynchronously on success or error.
+#define RUN_TEST_FORCEASYNC(name) \
+ force_async_ = true; \
+ instance_->LogTest(#name"ForceAsync", Test##name());
+
+#define RUN_TEST_FORCEASYNC_AND_NOT(name) \
+ RUN_TEST_FORCEASYNC(name); \
+ RUN_TEST(name);
+
+
// Helper macros for checking values in tests, and returning a location
// description of the test fails.
#define ASSERT_TRUE(cmd) \
« no previous file with comments | « ppapi/tests/arch_dependent_sizes_64.h ('k') | ppapi/tests/test_case.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698