OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 to make sure that the serialization of synchronous IPC messages | 5 // Unit test to make sure that the serialization of synchronous IPC messages |
6 // works. This ensures that the macros and templates were defined correctly. | 6 // works. This ensures that the macros and templates were defined correctly. |
7 // Doesn't test the IPC channel mechanism. | 7 // Doesn't test the IPC channel mechanism. |
8 | 8 |
9 #include <string.h> | 9 #include <string.h> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "ipc/ipc_message.h" | 12 #include "ipc/ipc_message.h" |
13 #include "ipc/ipc_message_utils.h" | 13 #include "ipc/ipc_message_utils.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 | 16 |
17 | 17 #define IPC_MESSAGE_IMPL |
18 #define MESSAGES_INTERNAL_FILE "ipc/ipc_sync_message_unittest.h" | 18 #include "ipc/ipc_sync_message_unittest.h" |
19 #include "ipc/ipc_message_macros.h" | |
20 | 19 |
21 static IPC::Message* g_reply; | 20 static IPC::Message* g_reply; |
22 | 21 |
23 class TestMessageReceiver { | 22 class TestMessageReceiver { |
24 public: | 23 public: |
25 | 24 |
26 void On_0_1(bool* out1) { | 25 void On_0_1(bool* out1) { |
27 *out1 = false; | 26 *out1 = false; |
28 } | 27 } |
29 | 28 |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 DCHECK(bool1); | 255 DCHECK(bool1); |
257 | 256 |
258 bool1 = false; | 257 bool1 = false; |
259 Send(new Msg_R_3_2(0, "3_2", false, 2, &bool1, &int1)); | 258 Send(new Msg_R_3_2(0, "3_2", false, 2, &bool1, &int1)); |
260 DCHECK(bool1 && int1 == 32); | 259 DCHECK(bool1 && int1 == 32); |
261 | 260 |
262 bool1 = true; | 261 bool1 = true; |
263 Send(new Msg_R_3_3(0, 3, "3_3", true, &string1, &int1, &bool1)); | 262 Send(new Msg_R_3_3(0, 3, "3_3", true, &string1, &int1, &bool1)); |
264 DCHECK(string1 == "3_3" && int1 == 33 && !bool1); | 263 DCHECK(string1 == "3_3" && int1 == 33 && !bool1); |
265 } | 264 } |
OLD | NEW |