OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PPAPI_TESTS_TEST_MESSAGE_HANDLER_H_ | 5 #ifndef PPAPI_TESTS_TEST_MESSAGE_HANDLER_H_ |
6 #define PPAPI_TESTS_TEST_MESSAGE_HANDLER_H_ | 6 #define PPAPI_TESTS_TEST_MESSAGE_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 private: | 21 private: |
22 // TestCase implementation. | 22 // TestCase implementation. |
23 virtual bool Init(); | 23 virtual bool Init(); |
24 virtual void RunTests(const std::string& filter); | 24 virtual void RunTests(const std::string& filter); |
25 virtual void HandleMessage(const pp::Var& message_data); | 25 virtual void HandleMessage(const pp::Var& message_data); |
26 | 26 |
27 std::string TestRegisterErrorConditions(); | 27 std::string TestRegisterErrorConditions(); |
28 std::string TestPostMessageAndAwaitResponse(); | 28 std::string TestPostMessageAndAwaitResponse(); |
29 std::string TestExceptions(); | 29 std::string TestExceptions(); |
30 | 30 |
| 31 // Wait for HandleMessage to be called, and return the Var it received. |
| 32 pp::Var WaitForMessage(); |
| 33 NestedEvent message_received_; |
| 34 pp::Var last_message_; |
| 35 |
31 const PPB_Messaging_1_2* ppb_messaging_if_; | 36 const PPB_Messaging_1_2* ppb_messaging_if_; |
32 pp::SimpleThread handler_thread_; | 37 pp::SimpleThread handler_thread_; |
33 | 38 |
34 // For TestExceptions(): | |
35 NestedEvent message_received_; | |
36 std::string last_message_; | |
37 }; | 39 }; |
38 | 40 |
39 #endif // PPAPI_TESTS_TEST_MESSAGE_HANDLER_H_ | 41 #endif // PPAPI_TESTS_TEST_MESSAGE_HANDLER_H_ |
40 | 42 |
OLD | NEW |