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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 void WaitAndAssertSignaledAndMessageIsArrived() { | 70 void WaitAndAssertSignaledAndMessageIsArrived() { |
71 run_loop_->Run(); | 71 run_loop_->Run(); |
72 EXPECT_EQ(MOJO_RESULT_OK, signaled_result_); | 72 EXPECT_EQ(MOJO_RESULT_OK, signaled_result_); |
73 | 73 |
74 ReadOneByteOfX(pipe_to_read_.get().value()); | 74 ReadOneByteOfX(pipe_to_read_.get().value()); |
75 } | 75 } |
76 | 76 |
77 void WaitAndAssertNotSignaled() { | 77 void WaitAndAssertNotSignaled() { |
78 run_loop_->RunUntilIdle(); | 78 run_loop_->RunUntilIdle(); |
79 EXPECT_EQ(MOJO_RESULT_OK, MojoWait(pipe_to_read_.get().value(), | 79 EXPECT_EQ(MOJO_RESULT_OK, MojoWait(pipe_to_read_.get().value(), |
80 MOJO_HANDLE_SIGNAL_READABLE, 0, | 80 MOJO_HANDLE_SIGNAL_READABLE, |
81 nullptr)); | 81 MOJO_DEADLINE_INDEFINITE, nullptr)); |
82 EXPECT_EQ(MOJO_RESULT_UNKNOWN, signaled_result_); | 82 EXPECT_EQ(MOJO_RESULT_UNKNOWN, signaled_result_); |
83 } | 83 } |
84 | 84 |
85 void HandleIsReady(MojoResult result) { | 85 void HandleIsReady(MojoResult result) { |
86 CHECK_EQ(base::MessageLoop::current(), message_loop_.get()); | 86 CHECK_EQ(base::MessageLoop::current(), message_loop_.get()); |
87 CHECK_EQ(signaled_result_, MOJO_RESULT_UNKNOWN); | 87 CHECK_EQ(signaled_result_, MOJO_RESULT_UNKNOWN); |
88 signaled_result_ = result; | 88 signaled_result_ = result; |
89 run_loop_->Quit(); | 89 run_loop_->Quit(); |
90 } | 90 } |
91 | 91 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 target_->GetIOObserverForTest()->DidProcessIOEvent(); | 251 target_->GetIOObserverForTest()->DidProcessIOEvent(); |
252 EXPECT_EQ(0U, invocation_count_); | 252 EXPECT_EQ(0U, invocation_count_); |
253 | 253 |
254 target_->GetIOObserverForTest()->DidProcessIOEvent(); | 254 target_->GetIOObserverForTest()->DidProcessIOEvent(); |
255 EXPECT_EQ(1U, invocation_count_); | 255 EXPECT_EQ(1U, invocation_count_); |
256 } | 256 } |
257 | 257 |
258 } // namespace | 258 } // namespace |
259 } // namespace internal | 259 } // namespace internal |
260 } // namespace IPC | 260 } // namespace IPC |
OLD | NEW |