| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_message_loop.h" | 5 #include "ppapi/tests/test_message_loop.h" |
| 6 | 6 |
| 7 #include "ppapi/c/pp_macros.h" | 7 #include "ppapi/c/pp_macros.h" |
| 8 #include "ppapi/cpp/core.h" | 8 #include "ppapi/cpp/core.h" |
| 9 #include "ppapi/cpp/logging.h" | 9 #include "ppapi/cpp/logging.h" |
| 10 #include "ppapi/cpp/message_loop.h" | 10 #include "ppapi/cpp/message_loop.h" |
| 11 #include "ppapi/cpp/module.h" | 11 #include "ppapi/cpp/module.h" |
| 12 #include "ppapi/tests/testing_instance.h" | 12 #include "ppapi/tests/testing_instance.h" |
| 13 #include "ppapi/utility/threading/simple_thread.h" | 13 #include "ppapi/utility/threading/simple_thread.h" |
| 14 | 14 |
| 15 REGISTER_TEST_CASE(MessageLoop); | 15 REGISTER_TEST_CASE(MessageLoop); |
| 16 | 16 |
| 17 TestMessageLoop::TestMessageLoop(TestingInstance* instance) | 17 TestMessageLoop::TestMessageLoop(TestingInstance* instance) |
| 18 : TestCase(instance), | 18 : TestCase(instance), |
| 19 param_(kInvalid), | 19 param_(kInvalid), |
| 20 PP_ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)), | 20 callback_factory_(this), |
| 21 main_loop_task_ran_(instance->pp_instance()) { | 21 main_loop_task_ran_(instance->pp_instance()) { |
| 22 } | 22 } |
| 23 | 23 |
| 24 TestMessageLoop::~TestMessageLoop() { | 24 TestMessageLoop::~TestMessageLoop() { |
| 25 } | 25 } |
| 26 | 26 |
| 27 void TestMessageLoop::RunTests(const std::string& filter) { | 27 void TestMessageLoop::RunTests(const std::string& filter) { |
| 28 RUN_TEST(Basics, filter); | 28 RUN_TEST(Basics, filter); |
| 29 RUN_TEST(Post, filter); | 29 RUN_TEST(Post, filter); |
| 30 } | 30 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 main_loop_task_ran_.Signal(); | 96 main_loop_task_ran_.Signal(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void TestMessageLoop::EchoParamToMainTask(int32_t result, TestParam param) { | 99 void TestMessageLoop::EchoParamToMainTask(int32_t result, TestParam param) { |
| 100 PP_DCHECK(result == PP_OK); | 100 PP_DCHECK(result == PP_OK); |
| 101 pp::MessageLoop::GetForMainThread().PostWork( | 101 pp::MessageLoop::GetForMainThread().PostWork( |
| 102 callback_factory_.NewCallback( | 102 callback_factory_.NewCallback( |
| 103 &TestMessageLoop::SetParamAndQuitTask, param)); | 103 &TestMessageLoop::SetParamAndQuitTask, param)); |
| 104 } | 104 } |
| 105 | 105 |
| OLD | NEW |