| 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 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1103 | 1103 |
| 1104 void SendMessageOnHelperThread() { | 1104 void SendMessageOnHelperThread() { |
| 1105 int answer = 0; | 1105 int answer = 0; |
| 1106 bool result = Send(new SyncChannelTestMsg_AnswerToLife(&answer)); | 1106 bool result = Send(new SyncChannelTestMsg_AnswerToLife(&answer)); |
| 1107 DCHECK(result); | 1107 DCHECK(result); |
| 1108 DCHECK_EQ(answer, 42); | 1108 DCHECK_EQ(answer, 42); |
| 1109 | 1109 |
| 1110 worker_->Done(); | 1110 worker_->Done(); |
| 1111 } | 1111 } |
| 1112 | 1112 |
| 1113 private: |
| 1114 virtual ~TestSyncMessageFilter() {} |
| 1115 |
| 1113 Worker* worker_; | 1116 Worker* worker_; |
| 1114 base::Thread thread_; | 1117 base::Thread thread_; |
| 1115 }; | 1118 }; |
| 1116 | 1119 |
| 1117 class SyncMessageFilterServer : public Worker { | 1120 class SyncMessageFilterServer : public Worker { |
| 1118 public: | 1121 public: |
| 1119 SyncMessageFilterServer() | 1122 SyncMessageFilterServer() |
| 1120 : Worker(Channel::MODE_SERVER, "sync_message_filter_server") { | 1123 : Worker(Channel::MODE_SERVER, "sync_message_filter_server") { |
| 1121 filter_ = new TestSyncMessageFilter(shutdown_event(), this); | 1124 filter_ = new TestSyncMessageFilter(shutdown_event(), this); |
| 1122 } | 1125 } |
| (...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1949 | 1952 |
| 1950 } // namespace | 1953 } // namespace |
| 1951 | 1954 |
| 1952 // Windows needs to send an out-of-band secret to verify the client end of the | 1955 // Windows needs to send an out-of-band secret to verify the client end of the |
| 1953 // channel. Test that we still connect correctly in that case. | 1956 // channel. Test that we still connect correctly in that case. |
| 1954 TEST_F(IPCSyncChannelTest, Verified) { | 1957 TEST_F(IPCSyncChannelTest, Verified) { |
| 1955 Verified(); | 1958 Verified(); |
| 1956 } | 1959 } |
| 1957 | 1960 |
| 1958 } // namespace IPC | 1961 } // namespace IPC |
| OLD | NEW |