Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: chrome/common/ipc_sync_message_unittest.cc

Issue 39206: NO CODE CHANGE. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/ipc_sync_message_unittest.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 DCHECK(in1 == 1 && !in2 && in3 == "3_1"); 78 DCHECK(in1 == 1 && !in2 && in3 == "3_1");
79 *out1 = true; 79 *out1 = true;
80 } 80 }
81 81
82 void On_3_2(std::string in1, bool in2, int in3, bool* out1, int* out2) { 82 void On_3_2(std::string in1, bool in2, int in3, bool* out1, int* out2) {
83 DCHECK(in1 == "3_2" && !in2 && in3 == 2); 83 DCHECK(in1 == "3_2" && !in2 && in3 == 2);
84 *out1 = true; 84 *out1 = true;
85 *out2 = 32; 85 *out2 = 32;
86 } 86 }
87 87
88 void On_3_3(int in1, std::string in2, bool in3, std::string* out1, int* out2, bool* out3) { 88 void On_3_3(int in1, std::string in2, bool in3, std::string* out1, int* out2,
89 bool* out3) {
89 DCHECK(in1 == 3 && in2 == "3_3" && in3); 90 DCHECK(in1 == 3 && in2 == "3_3" && in3);
90 *out1 = "3_3"; 91 *out1 = "3_3";
91 *out2 = 33; 92 *out2 = 33;
92 *out3 = false; 93 *out3 = false;
93 } 94 }
94 95
95 bool Send(IPC::Message* message) { 96 bool Send(IPC::Message* message) {
96 // gets the reply message, stash in global 97 // gets the reply message, stash in global
97 DCHECK(g_reply == NULL); 98 DCHECK(g_reply == NULL);
98 g_reply = message; 99 g_reply = message;
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 241
241 bool1 = false; 242 bool1 = false;
242 Send(new Msg_R_3_2(0, "3_2", false, 2, &bool1, &int1)); 243 Send(new Msg_R_3_2(0, "3_2", false, 2, &bool1, &int1));
243 DCHECK(bool1 && int1 == 32); 244 DCHECK(bool1 && int1 == 32);
244 245
245 bool1 = true; 246 bool1 = true;
246 Send(new Msg_R_3_3(0, 3, "3_3", true, &string1, &int1, &bool1)); 247 Send(new Msg_R_3_3(0, 3, "3_3", true, &string1, &int1, &bool1));
247 DCHECK(string1 == "3_3" && int1 == 33 && !bool1); 248 DCHECK(string1 == "3_3" && int1 == 33 && !bool1);
248 } 249 }
249 250
OLDNEW
« no previous file with comments | « chrome/common/ipc_sync_message_unittest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698