OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 ipc_loop->PostDelayedTask( | 115 ipc_loop->PostDelayedTask( |
116 FROM_HERE, base::Bind(&IPC::Channel::Listener::OnChannelError, | 116 FROM_HERE, base::Bind(&IPC::Channel::Listener::OnChannelError, |
117 base::Unretained(listener)), | 117 base::Unretained(listener)), |
118 t.InMilliseconds()); | 118 t.InMilliseconds()); |
119 } | 119 } |
120 | 120 |
121 void FireMessage(const IPC::Message& m, base::TimeDelta t) { | 121 void FireMessage(const IPC::Message& m, base::TimeDelta t) { |
122 ASSERT_TRUE(ipc_loop != NULL); | 122 ASSERT_TRUE(ipc_loop != NULL); |
123 ipc_loop->PostDelayedTask( | 123 ipc_loop->PostDelayedTask( |
124 FROM_HERE, | 124 FROM_HERE, |
125 base::IgnoreReturn<bool>( | 125 base::Bind( |
126 base::Bind(&IPC::Channel::Listener::OnMessageReceived, | 126 base::IgnoreResult(&IPC::Channel::Listener::OnMessageReceived), |
127 base::Unretained(listener), m)), | 127 base::Unretained(listener), m), |
128 t.InMilliseconds()); | 128 t.InMilliseconds()); |
129 } | 129 } |
130 | 130 |
131 MockCFProxyTraits() : ipc_loop(NULL) {} | 131 MockCFProxyTraits() : ipc_loop(NULL) {} |
132 MockSender sender; | 132 MockSender sender; |
133 private: | 133 private: |
134 MessageLoop* ipc_loop; | 134 MessageLoop* ipc_loop; |
135 IPC::Channel::Listener* listener; | 135 IPC::Channel::Listener* listener; |
136 }; | 136 }; |
137 | 137 |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 | 353 |
354 queue.QueueSyncMessage(&m, &d1, NULL); | 354 queue.QueueSyncMessage(&m, &d1, NULL); |
355 | 355 |
356 testing::InSequence s; | 356 testing::InSequence s; |
357 EXPECT_CALL(d1, Completed_CreateTab(true, (HWND)1, (HWND)2, kTabHandle, | 357 EXPECT_CALL(d1, Completed_CreateTab(true, (HWND)1, (HWND)2, kTabHandle, |
358 kSessionId)); | 358 kSessionId)); |
359 | 359 |
360 // Execute replies in a worker thread. | 360 // Execute replies in a worker thread. |
361 ipc.message_loop()->PostTask( | 361 ipc.message_loop()->PostTask( |
362 FROM_HERE, | 362 FROM_HERE, |
363 base::IgnoreReturn<bool>(base::Bind(&SyncMsgSender::OnReplyReceived, | 363 base::Bind(base::IgnoreResult(&SyncMsgSender::OnReplyReceived), |
364 base::Unretained(&queue), r.get()))); | 364 base::Unretained(&queue), r.get())); |
365 ipc.Stop(); | 365 ipc.Stop(); |
366 | 366 |
367 // Expect that tab 6 has been associated with the delegate. | 367 // Expect that tab 6 has been associated with the delegate. |
368 EXPECT_EQ(&d1, tab2delegate[6]); | 368 EXPECT_EQ(&d1, tab2delegate[6]); |
369 } | 369 } |
370 | 370 |
371 TEST(SyncMsgSender, OnChannelClosed) { | 371 TEST(SyncMsgSender, OnChannelClosed) { |
372 // TODO(stoyan): implement. | 372 // TODO(stoyan): implement. |
373 } | 373 } |
OLD | NEW |