| 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 #include "mojo/public/cpp/utility/run_loop.h" | 5 #include "mojo/public/cpp/utility/run_loop.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "gtest/gtest.h" |
| 9 #include "mojo/public/cpp/system/macros.h" | 10 #include "mojo/public/cpp/system/macros.h" |
| 10 #include "mojo/public/cpp/system/message_pipe.h" | 11 #include "mojo/public/cpp/system/message_pipe.h" |
| 11 #include "mojo/public/cpp/test_support/test_utils.h" | 12 #include "mojo/public/cpp/test_support/test_utils.h" |
| 12 #include "mojo/public/cpp/utility/run_loop_handler.h" | 13 #include "mojo/public/cpp/utility/run_loop_handler.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | |
| 14 | 14 |
| 15 namespace mojo { | 15 namespace mojo { |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 class TestRunLoopHandler : public RunLoopHandler { | 18 class TestRunLoopHandler : public RunLoopHandler { |
| 19 public: | 19 public: |
| 20 TestRunLoopHandler() {} | 20 TestRunLoopHandler() {} |
| 21 ~TestRunLoopHandler() override {} | 21 ~TestRunLoopHandler() override {} |
| 22 | 22 |
| 23 void clear_ready_count() { ready_count_ = 0; } | 23 void clear_ready_count() { ready_count_ = 0; } |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 run_loop.AddHandler(&handler, | 426 run_loop.AddHandler(&handler, |
| 427 test_pipe.handle0.get(), | 427 test_pipe.handle0.get(), |
| 428 MOJO_HANDLE_SIGNAL_READABLE, | 428 MOJO_HANDLE_SIGNAL_READABLE, |
| 429 MOJO_DEADLINE_INDEFINITE); | 429 MOJO_DEADLINE_INDEFINITE); |
| 430 run_loop.PostDelayedTask(Closure(QuittingTask(&run_loop)), 0); | 430 run_loop.PostDelayedTask(Closure(QuittingTask(&run_loop)), 0); |
| 431 run_loop.Run(); | 431 run_loop.Run(); |
| 432 } | 432 } |
| 433 | 433 |
| 434 } // namespace | 434 } // namespace |
| 435 } // namespace mojo | 435 } // namespace mojo |
| OLD | NEW |