| 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 "chrome/common/ipc_message.h" | 12 #include "chrome/common/ipc_message.h" |
| 13 #include "chrome/common/ipc_message_utils.h" | 13 #include "chrome/common/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 #define IPC_MESSAGE_MACROS_ENUMS | |
| 18 #include "chrome/common/ipc_sync_message_unittest.h" | |
| 19 | 17 |
| 20 // define the classes | 18 #define MESSAGES_INTERNAL_FILE "chrome/common/ipc_sync_message_unittest.h" |
| 21 #define IPC_MESSAGE_MACROS_CLASSES | 19 #include "chrome/common/ipc_message_macros.h" |
| 22 #include "chrome/common/ipc_sync_message_unittest.h" | |
| 23 | |
| 24 | 20 |
| 25 static IPC::Message* g_reply; | 21 static IPC::Message* g_reply; |
| 26 | 22 |
| 27 class TestMessageReceiver { | 23 class TestMessageReceiver { |
| 28 public: | 24 public: |
| 29 | 25 |
| 30 void On_0_1(bool* out1) { | 26 void On_0_1(bool* out1) { |
| 31 *out1 = false; | 27 *out1 = false; |
| 32 } | 28 } |
| 33 | 29 |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 | 240 |
| 245 bool1 = false; | 241 bool1 = false; |
| 246 Send(new Msg_R_3_2(0, "3_2", false, 2, &bool1, &int1)); | 242 Send(new Msg_R_3_2(0, "3_2", false, 2, &bool1, &int1)); |
| 247 DCHECK(bool1 && int1 == 32); | 243 DCHECK(bool1 && int1 == 32); |
| 248 | 244 |
| 249 bool1 = true; | 245 bool1 = true; |
| 250 Send(new Msg_R_3_3(0, 3, "3_3", true, &string1, &int1, &bool1)); | 246 Send(new Msg_R_3_3(0, 3, "3_3", true, &string1, &int1, &bool1)); |
| 251 DCHECK(string1 == "3_3" && int1 == 33 && !bool1); | 247 DCHECK(string1 == "3_3" && int1 == 33 && !bool1); |
| 252 } | 248 } |
| 253 | 249 |
| OLD | NEW |