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

Unified Diff: remoting/host/daemon_process_unittest.cc

Issue 12545006: The worker process launcher can now ask the worker to crash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/daemon_process.cc ('k') | remoting/host/daemon_process_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/daemon_process_unittest.cc
diff --git a/remoting/host/daemon_process_unittest.cc b/remoting/host/daemon_process_unittest.cc
index 6c3844adf6983719af690ac3396c09186b8b78e1..033a49fd48e460b2ac36b6f93b7feaf91d5289ef 100644
--- a/remoting/host/daemon_process_unittest.cc
+++ b/remoting/host/daemon_process_unittest.cc
@@ -4,6 +4,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
+#include "base/location.h"
#include "base/memory/ref_counted.h"
#include "base/process.h"
#include "ipc/ipc_message.h"
@@ -26,7 +27,7 @@ namespace remoting {
namespace {
enum Messages {
- kMessageCrash = ChromotingDaemonNetworkMsg_Crash::ID,
+ kMessageCrash = ChromotingDaemonMsg_Crash::ID,
kMessageConfiguration = ChromotingDaemonNetworkMsg_Configuration::ID,
kMessageConnectTerminal = ChromotingNetworkHostMsg_ConnectTerminal::ID,
kMessageDisconnectTerminal = ChromotingNetworkHostMsg_DisconnectTerminal::ID,
@@ -68,6 +69,7 @@ class MockDaemonProcess : public DaemonProcess {
bool(int, base::ProcessHandle, IPC::PlatformFileForTransit));
MOCK_METHOD1(DoCreateDesktopSessionPtr, DesktopSession*(int));
+ MOCK_METHOD1(DoCrashNetworkProcess, void(const tracked_objects::Location&));
MOCK_METHOD0(LaunchNetworkProcess, void());
private:
@@ -124,6 +126,7 @@ class DaemonProcessTest : public testing::Test {
// DaemonProcess mocks
DesktopSession* DoCreateDesktopSession(int terminal_id);
+ void DoCrashNetworkProcess(const tracked_objects::Location& location);
void LaunchNetworkProcess();
// Deletes |daemon_process_|.
@@ -168,6 +171,9 @@ void DaemonProcessTest::SetUp() {
EXPECT_CALL(*daemon_process_, DoCreateDesktopSessionPtr(_))
.Times(AnyNumber())
.WillRepeatedly(Invoke(this, &DaemonProcessTest::DoCreateDesktopSession));
+ EXPECT_CALL(*daemon_process_, DoCrashNetworkProcess(_))
+ .Times(AnyNumber())
+ .WillRepeatedly(Invoke(this, &DaemonProcessTest::DoCrashNetworkProcess));
EXPECT_CALL(*daemon_process_, LaunchNetworkProcess())
.Times(AnyNumber())
.WillRepeatedly(Invoke(this, &DaemonProcessTest::LaunchNetworkProcess));
@@ -182,6 +188,14 @@ DesktopSession* DaemonProcessTest::DoCreateDesktopSession(int terminal_id) {
return new FakeDesktopSession(daemon_process_.get(), terminal_id);
}
+void DaemonProcessTest::DoCrashNetworkProcess(
+ const tracked_objects::Location& location) {
+ daemon_process_->SendToNetwork(
+ new ChromotingDaemonMsg_Crash(location.function_name(),
+ location.file_name(),
+ location.line_number()));
+}
+
void DaemonProcessTest::LaunchNetworkProcess() {
terminal_id_ = 0;
daemon_process_->OnChannelConnected(0);
« no previous file with comments | « remoting/host/daemon_process.cc ('k') | remoting/host/daemon_process_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698