| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "ppapi/tests/test_post_message.h" | 5 #include "ppapi/tests/test_post_message.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ppapi/c/dev/ppb_testing_dev.h" | 9 #include "ppapi/c/dev/ppb_testing_dev.h" |
| 10 #include "ppapi/c/pp_var.h" | 10 #include "ppapi/c/pp_var.h" |
| 11 #include "ppapi/cpp/dev/scriptable_object_deprecated.h" | 11 #include "ppapi/cpp/dev/scriptable_object_deprecated.h" |
| 12 #include "ppapi/cpp/instance.h" | 12 #include "ppapi/cpp/instance.h" |
| 13 #include "ppapi/cpp/var.h" | 13 #include "ppapi/cpp/var.h" |
| 14 #include "ppapi/tests/test_utils.h" | 14 #include "ppapi/tests/test_utils.h" |
| 15 #include "ppapi/tests/testing_instance.h" | 15 #include "ppapi/tests/testing_instance.h" |
| 16 | 16 |
| 17 // Windows defines 'PostMessage', so we have to undef it. | |
| 18 #ifdef PostMessage | |
| 19 #undef PostMessage | |
| 20 #endif | |
| 21 | |
| 22 REGISTER_TEST_CASE(PostMessage); | 17 REGISTER_TEST_CASE(PostMessage); |
| 23 | 18 |
| 24 namespace { | 19 namespace { |
| 25 | 20 |
| 26 const char kTestString[] = "Hello world!"; | 21 const char kTestString[] = "Hello world!"; |
| 27 const bool kTestBool = true; | 22 const bool kTestBool = true; |
| 28 const int32_t kTestInt = 42; | 23 const int32_t kTestInt = 42; |
| 29 const double kTestDouble = 42.0; | 24 const double kTestDouble = 42.0; |
| 30 const int32_t kThreadsToRun = 10; | 25 const int32_t kThreadsToRun = 10; |
| 31 | 26 |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 // Therefore, we will do CallOnMainThread to yield control. That event should | 242 // Therefore, we will do CallOnMainThread to yield control. That event should |
| 248 // fire, but we should see no messages when we return. | 243 // fire, but we should see no messages when we return. |
| 249 TestCompletionCallback callback(instance_->pp_instance()); | 244 TestCompletionCallback callback(instance_->pp_instance()); |
| 250 pp::Module::Get()->core()->CallOnMainThread(0, callback); | 245 pp::Module::Get()->core()->CallOnMainThread(0, callback); |
| 251 callback.WaitForResult(); | 246 callback.WaitForResult(); |
| 252 ASSERT_TRUE(message_data_.empty()); | 247 ASSERT_TRUE(message_data_.empty()); |
| 253 | 248 |
| 254 PASS(); | 249 PASS(); |
| 255 } | 250 } |
| 256 | 251 |
| OLD | NEW |