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

Unified Diff: remoting/host/win/worker_process_launcher_unittest.cc

Issue 2950993003: [Chromoting] Use ProcessStatsSender in DaemonProcess (daemon process) (Closed)
Patch Set: Stop process stats when network process crashes Created 3 years, 6 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
Index: remoting/host/win/worker_process_launcher_unittest.cc
diff --git a/remoting/host/win/worker_process_launcher_unittest.cc b/remoting/host/win/worker_process_launcher_unittest.cc
index c7af99f9154a3cba8e28f45706eea21ebefd9b2f..6c8232b6ca659d8114d65de4c81253be659a277b 100644
--- a/remoting/host/win/worker_process_launcher_unittest.cc
+++ b/remoting/host/win/worker_process_launcher_unittest.cc
@@ -68,6 +68,7 @@ class MockIpcDelegate : public WorkerProcessIpcDelegate {
MOCK_METHOD1(OnChannelConnected, void(int32_t));
MOCK_METHOD1(OnMessageReceived, bool(const IPC::Message&));
MOCK_METHOD1(OnPermanentError, void(int));
+ MOCK_METHOD1(OnWorkerProcessStopped, void(int));
private:
DISALLOW_COPY_AND_ASSIGN(MockIpcDelegate);
@@ -394,6 +395,8 @@ TEST_F(WorkerProcessLauncherTest, Start) {
.Times(0);
EXPECT_CALL(server_listener_, OnPermanentError(_))
.Times(0);
+ EXPECT_CALL(server_listener_, OnWorkerProcessStopped(_))
+ .Times(0);
StartWorker();
StopWorker();
@@ -414,6 +417,8 @@ TEST_F(WorkerProcessLauncherTest, StartAndConnect) {
&WorkerProcessLauncherTest::StopWorker));
EXPECT_CALL(server_listener_, OnPermanentError(_))
.Times(0);
+ EXPECT_CALL(server_listener_, OnWorkerProcessStopped(_))
+ .Times(0);
StartWorker();
base::RunLoop().Run();
@@ -438,6 +443,8 @@ TEST_F(WorkerProcessLauncherTest, Restart) {
EXPECT_CALL(server_listener_, OnPermanentError(_))
.Times(0);
+ EXPECT_CALL(server_listener_, OnWorkerProcessStopped(_))
+ .Times(1);
StartWorker();
base::RunLoop().Run();
@@ -461,6 +468,8 @@ TEST_F(WorkerProcessLauncherTest, DropIpcChannel) {
EXPECT_CALL(server_listener_, OnPermanentError(_))
.Times(0);
+ EXPECT_CALL(server_listener_, OnWorkerProcessStopped(_))
+ .Times(1);
StartWorker();
base::RunLoop().Run();
@@ -484,6 +493,8 @@ TEST_F(WorkerProcessLauncherTest, PermanentError) {
.Times(1)
.WillOnce(InvokeWithoutArgs(this,
&WorkerProcessLauncherTest::StopWorker));
+ EXPECT_CALL(server_listener_, OnWorkerProcessStopped(_))
+ .Times(1);
StartWorker();
base::RunLoop().Run();
@@ -509,6 +520,8 @@ TEST_F(WorkerProcessLauncherTest, Crash) {
&WorkerProcessLauncherTest::TerminateWorker,
base::Unretained(this),
EXCEPTION_BREAKPOINT)));
+ EXPECT_CALL(server_listener_, OnWorkerProcessStopped(_))
+ .Times(1);
StartWorker();
base::RunLoop().Run();
@@ -534,6 +547,8 @@ TEST_F(WorkerProcessLauncherTest, CrashAnyway) {
.Times(1)
.WillOnce(InvokeWithoutArgs(
this, &WorkerProcessLauncherTest::SendFakeMessageToLauncher));
+ EXPECT_CALL(server_listener_, OnWorkerProcessStopped(_))
+ .Times(1);
StartWorker();
base::RunLoop().Run();

Powered by Google App Engine
This is Rietveld 408576698