Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // TODO(vtl): Maybe this test should actually be in //mojo/edk/platform? | 5 // TODO(vtl): Maybe this test should actually be in //mojo/edk/platform? |
| 6 | 6 |
| 7 #include "mojo/edk/platform/test_message_loops.h" | 7 #include "mojo/edk/platform/test_message_loops.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| 11 #include "mojo/edk/base_edk/message_loop_test_helper.h" | 11 #include "mojo/edk/base_edk/message_loop_test_helper.h" |
| 12 #include "mojo/edk/platform/message_loop.h" | 12 #include "mojo/edk/platform/message_loop.h" |
| 13 #include "mojo/edk/platform/message_loop_for_io.h" | |
| 14 #include "mojo/edk/platform/test_message_loops.h" | 13 #include "mojo/edk/platform/test_message_loops.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 15 |
| 17 using mojo::platform::MessageLoop; | 16 using mojo::platform::MessageLoop; |
| 18 using mojo::platform::MessageLoopForIO; | 17 using mojo::platform::PlatformHandleWatcher; |
| 19 | 18 |
| 20 namespace { | 19 namespace { |
| 21 | 20 |
| 22 TEST(TestMessageLoopsTest, CreateTestMessageLoop) { | 21 TEST(TestMessageLoopsTest, CreateTestMessageLoop) { |
| 23 std::unique_ptr<MessageLoop> message_loop = | 22 std::unique_ptr<MessageLoop> message_loop = |
| 24 mojo::platform::test::CreateTestMessageLoop(); | 23 mojo::platform::test::CreateTestMessageLoop(); |
| 25 base_edk::test::MessageLoopTestHelper(message_loop.get()); | 24 base_edk::test::MessageLoopTestHelper(message_loop.get()); |
| 26 } | 25 } |
| 27 | 26 |
| 28 TEST(TestMessageLoopsTest, CreateTestMessageLoopForIO) { | 27 TEST(TestMessageLoopsTest, CreateTestMessageLoopForIO) { |
| 29 std::unique_ptr<MessageLoopForIO> message_loop_for_io = | 28 PlatformHandleWatcher* platform_handle_watcher = nullptr; |
| 30 mojo::platform::test::CreateTestMessageLoopForIO(); | 29 std::unique_ptr<MessageLoop> message_loop = |
| 31 base_edk::test::MessageLoopTestHelper(message_loop_for_io.get()); | 30 mojo::platform::test::CreateTestMessageLoopForIO( |
| 31 &platform_handle_watcher); | |
| 32 base_edk::test::MessageLoopTestHelper(message_loop.get()); | |
| 33 EXPECT_TRUE(platform_handle_watcher); | |
| 34 // TODO(vtl): Also test the watcher. | |
|
vardhan
2015/12/09 00:18:27
:P
| |
| 32 } | 35 } |
| 33 | 36 |
| 34 } // namespace | 37 } // namespace |
| OLD | NEW |