| 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 #include "ipc/mojo/async_handle_waiter.h" | 5 #include "ipc/mojo/async_handle_waiter.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 void WaitAndAssertSignaledAndMessageIsArrived() { | 66 void WaitAndAssertSignaledAndMessageIsArrived() { |
| 67 run_loop_->Run(); | 67 run_loop_->Run(); |
| 68 EXPECT_EQ(MOJO_RESULT_OK, signaled_result_); | 68 EXPECT_EQ(MOJO_RESULT_OK, signaled_result_); |
| 69 | 69 |
| 70 ReadOneByteOfX(pipe_to_read_.get().value()); | 70 ReadOneByteOfX(pipe_to_read_.get().value()); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void WaitAndAssertNotSignaled() { | 73 void WaitAndAssertNotSignaled() { |
| 74 run_loop_->RunUntilIdle(); | 74 run_loop_->RunUntilIdle(); |
| 75 EXPECT_EQ(MOJO_RESULT_OK, MojoWait(pipe_to_read_.get().value(), | 75 EXPECT_EQ(MOJO_RESULT_OK, MojoWait(pipe_to_read_.get().value(), |
| 76 MOJO_HANDLE_SIGNAL_READABLE, 0)); | 76 MOJO_HANDLE_SIGNAL_READABLE, 0, |
| 77 nullptr)); |
| 77 EXPECT_EQ(MOJO_RESULT_UNKNOWN, signaled_result_); | 78 EXPECT_EQ(MOJO_RESULT_UNKNOWN, signaled_result_); |
| 78 } | 79 } |
| 79 | 80 |
| 80 void HandleIsReady(MojoResult result) { | 81 void HandleIsReady(MojoResult result) { |
| 81 CHECK_EQ(base::MessageLoop::current(), message_loop_.get()); | 82 CHECK_EQ(base::MessageLoop::current(), message_loop_.get()); |
| 82 CHECK_EQ(signaled_result_, MOJO_RESULT_UNKNOWN); | 83 CHECK_EQ(signaled_result_, MOJO_RESULT_UNKNOWN); |
| 83 signaled_result_ = result; | 84 signaled_result_ = result; |
| 84 run_loop_->Quit(); | 85 run_loop_->Quit(); |
| 85 } | 86 } |
| 86 | 87 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 | 200 |
| 200 EXPECT_TRUE(handler.IsClosingHandled()); | 201 EXPECT_TRUE(handler.IsClosingHandled()); |
| 201 | 202 |
| 202 // |HandlerThatReenters::RestartAndClose| already closed it. | 203 // |HandlerThatReenters::RestartAndClose| already closed it. |
| 203 ignore_result(pipe_to_read_.release()); | 204 ignore_result(pipe_to_read_.release()); |
| 204 } | 205 } |
| 205 | 206 |
| 206 } // namespace | 207 } // namespace |
| 207 } // namespace internal | 208 } // namespace internal |
| 208 } // namespace IPC | 209 } // namespace IPC |
| OLD | NEW |