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 // Unit test for SyncChannel. | 5 // Unit test for SyncChannel. |
6 | 6 |
7 #include "ipc/ipc_sync_channel.h" | 7 #include "ipc/ipc_sync_channel.h" |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 ListenerThread()->message_loop()->PostTask( | 77 ListenerThread()->message_loop()->PostTask( |
78 FROM_HERE, base::Bind(&Worker::OnListenerThreadShutdown1, this, | 78 FROM_HERE, base::Bind(&Worker::OnListenerThreadShutdown1, this, |
79 &listener_done, &ipc_done)); | 79 &listener_done, &ipc_done)); |
80 listener_done.Wait(); | 80 listener_done.Wait(); |
81 ipc_done.Wait(); | 81 ipc_done.Wait(); |
82 ipc_thread_.Stop(); | 82 ipc_thread_.Stop(); |
83 listener_thread_.Stop(); | 83 listener_thread_.Stop(); |
84 } | 84 } |
85 void AddRef() { } | 85 void AddRef() { } |
86 void Release() { } | 86 void Release() { } |
87 static bool ImplementsThreadSafeReferenceCounting() { return true; } | |
88 bool Send(Message* msg) { return channel_->Send(msg); } | 87 bool Send(Message* msg) { return channel_->Send(msg); } |
89 bool SendWithTimeout(Message* msg, int timeout_ms) { | 88 bool SendWithTimeout(Message* msg, int timeout_ms) { |
90 return channel_->SendWithTimeout(msg, timeout_ms); | 89 return channel_->SendWithTimeout(msg, timeout_ms); |
91 } | 90 } |
92 void WaitForChannelCreation() { channel_created_->Wait(); } | 91 void WaitForChannelCreation() { channel_created_->Wait(); } |
93 void CloseChannel() { | 92 void CloseChannel() { |
94 DCHECK(MessageLoop::current() == ListenerThread()->message_loop()); | 93 DCHECK(MessageLoop::current() == ListenerThread()->message_loop()); |
95 channel_->Close(); | 94 channel_->Close(); |
96 } | 95 } |
97 void Start() { | 96 void Start() { |
(...skipping 1854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1952 | 1951 |
1953 } // namespace | 1952 } // namespace |
1954 | 1953 |
1955 // Windows needs to send an out-of-band secret to verify the client end of the | 1954 // Windows needs to send an out-of-band secret to verify the client end of the |
1956 // channel. Test that we still connect correctly in that case. | 1955 // channel. Test that we still connect correctly in that case. |
1957 TEST_F(IPCSyncChannelTest, Verified) { | 1956 TEST_F(IPCSyncChannelTest, Verified) { |
1958 Verified(); | 1957 Verified(); |
1959 } | 1958 } |
1960 | 1959 |
1961 } // namespace IPC | 1960 } // namespace IPC |
OLD | NEW |