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

Side by Side Diff: chrome/renderer/renderer_main_unittest.cc

Issue 3759004: ipc_channel: warn if someone forgets to check the result of Connect() (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: fixes Created 10 years, 2 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
« no previous file with comments | « no previous file | ipc/ipc_channel.h » ('j') | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "base/message_loop.h" 5 #include "base/message_loop.h"
6 #include "base/process_util.h" 6 #include "base/process_util.h"
7 #include "base/test/multiprocess_test.h" 7 #include "base/test/multiprocess_test.h"
8 #include "chrome/common/chrome_switches.h" 8 #include "chrome/common/chrome_switches.h"
9 #include "chrome/common/main_function_params.h" 9 #include "chrome/common/main_function_params.h"
10 #include "ipc/ipc_channel.h" 10 #include "ipc/ipc_channel.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 } 85 }
86 86
87 TEST_F(RendererMainTest, CreateDestroy) { 87 TEST_F(RendererMainTest, CreateDestroy) {
88 SuicidalListener listener; 88 SuicidalListener listener;
89 IPC::Channel control_channel(kRendererTestChannelName, 89 IPC::Channel control_channel(kRendererTestChannelName,
90 IPC::Channel::MODE_SERVER, 90 IPC::Channel::MODE_SERVER,
91 &listener); 91 &listener);
92 base::ProcessHandle renderer_pid = SpawnChild("SimpleRenderer", 92 base::ProcessHandle renderer_pid = SpawnChild("SimpleRenderer",
93 &control_channel); 93 &control_channel);
94 94
95 control_channel.Connect(); 95 ASSERT_TRUE(control_channel.Connect());
96 MessageLoop::current()->Run(); 96 MessageLoop::current()->Run();
97 97
98 // The renderer should exit when we close the channel. 98 // The renderer should exit when we close the channel.
99 control_channel.Close(); 99 control_channel.Close();
100 100
101 EXPECT_TRUE(base::WaitForSingleProcess(renderer_pid, 5000)); 101 EXPECT_TRUE(base::WaitForSingleProcess(renderer_pid, 5000));
102 } 102 }
103 #endif // defined(OS_POSIX) 103 #endif // defined(OS_POSIX)
OLDNEW
« no previous file with comments | « no previous file | ipc/ipc_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698