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

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

Issue 5978003: Make IPC::Channel::Listener:OnMessageReceived have a return value indicating ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 12 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
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/compiler_specific.h" 5 #include "base/compiler_specific.h"
6 #include "base/message_loop.h" 6 #include "base/message_loop.h"
7 #include "base/process_util.h" 7 #include "base/process_util.h"
8 #include "base/test/multiprocess_test.h" 8 #include "base/test/multiprocess_test.h"
9 #include "base/test/test_timeouts.h" 9 #include "base/test/test_timeouts.h"
10 #include "chrome/common/chrome_switches.h" 10 #include "chrome/common/chrome_switches.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 return command_line; 82 return command_line;
83 } 83 }
84 84
85 // Listener class that kills the message loop when it connects. 85 // Listener class that kills the message loop when it connects.
86 class SuicidalListener : public IPC::Channel::Listener { 86 class SuicidalListener : public IPC::Channel::Listener {
87 public: 87 public:
88 void OnChannelConnected(int32 peer_pid) { 88 void OnChannelConnected(int32 peer_pid) {
89 MessageLoop::current()->Quit(); 89 MessageLoop::current()->Quit();
90 } 90 }
91 91
92 void OnMessageReceived(const IPC::Message& message) { 92 bool OnMessageReceived(const IPC::Message& message) {
93 // We shouldn't receive any messages 93 // We shouldn't receive any messages
94 ASSERT_TRUE(false); 94 NOTREACHED();
95 return false;
95 } 96 }
96 }; 97 };
97 98
98 MULTIPROCESS_TEST_MAIN(SimpleRenderer) { 99 MULTIPROCESS_TEST_MAIN(SimpleRenderer) {
99 SandboxInitWrapper dummy_sandbox_init; 100 SandboxInitWrapper dummy_sandbox_init;
100 CommandLine cl(*CommandLine::ForCurrentProcess()); 101 CommandLine cl(*CommandLine::ForCurrentProcess());
101 cl.AppendSwitchASCII(switches::kProcessChannelID, kRendererTestChannelName); 102 cl.AppendSwitchASCII(switches::kProcessChannelID, kRendererTestChannelName);
102 103
103 MainFunctionParams dummy_params(cl, dummy_sandbox_init, NULL); 104 MainFunctionParams dummy_params(cl, dummy_sandbox_init, NULL);
104 return RendererMain(dummy_params); 105 return RendererMain(dummy_params);
(...skipping 11 matching lines...) Expand all
116 117
117 MessageLoop::current()->Run(); 118 MessageLoop::current()->Run();
118 119
119 // The renderer should exit when we close the channel. 120 // The renderer should exit when we close the channel.
120 control_channel.Close(); 121 control_channel.Close();
121 122
122 EXPECT_TRUE(base::WaitForSingleProcess(renderer_pid, 123 EXPECT_TRUE(base::WaitForSingleProcess(renderer_pid,
123 TestTimeouts::action_timeout_ms())); 124 TestTimeouts::action_timeout_ms()));
124 } 125 }
125 #endif // defined(OS_POSIX) 126 #endif // defined(OS_POSIX)
OLDNEW
« no previous file with comments | « chrome/renderer/render_widget.cc ('k') | chrome/renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698