Chromium Code Reviews| Index: ppapi/tests/test_utils.h |
| diff --git a/ppapi/tests/test_utils.h b/ppapi/tests/test_utils.h |
| index 1e2ec369316475accbd41d986e2a22f40d0d1bb0..2faa6feb46385b3c0a5770c374e4c5ac75732fe0 100644 |
| --- a/ppapi/tests/test_utils.h |
| +++ b/ppapi/tests/test_utils.h |
| @@ -62,12 +62,18 @@ class NestedEvent { |
| enum CallbackType { PP_REQUIRED, PP_OPTIONAL, PP_BLOCKING }; |
| class TestCompletionCallback { |
| public: |
| + class Delegate { |
| + public: |
| + virtual void OnCallback(void* user_data, int32_t result) = 0; |
| + }; |
| explicit TestCompletionCallback(PP_Instance instance); |
| // TODO(dmichael): Remove this constructor. |
| TestCompletionCallback(PP_Instance instance, bool force_async); |
| TestCompletionCallback(PP_Instance instance, CallbackType callback_type); |
| + void SetDelegate(Delegate* delegate) { delegate_ = delegate; } |
|
dmichael (off chromium)
2012/06/25 15:50:51
Please add documentation for the method, including
Takashi Toyoshima
2012/06/26 09:19:10
Done.
|
| + |
| // Waits for the callback to be called and returns the |
| // result. Returns immediately if the callback was previously called |
| // and the result wasn't returned (i.e. each result value received |
| @@ -153,6 +159,7 @@ class TestCompletionCallback { |
| std::string errors_; |
| unsigned run_count_; |
| PP_Instance instance_; |
| + Delegate* delegate_; |
| }; |
| // Verifies that the callback didn't record any errors. If the callback is run |