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

Side by Side Diff: chrome/browser/service_process/service_process_control_browsertest.cc

Issue 938453002: Remove base::WaitForSingleProcess (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cl format :( Created 5 years, 10 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/service_process/service_process_control.h" 5 #include "chrome/browser/service_process/service_process_control.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 73 }
74 74
75 virtual void TearDown() override { 75 virtual void TearDown() override {
76 if (ServiceProcessControl::GetInstance()->IsConnected()) 76 if (ServiceProcessControl::GetInstance()->IsConnected())
77 EXPECT_TRUE(ServiceProcessControl::GetInstance()->Shutdown()); 77 EXPECT_TRUE(ServiceProcessControl::GetInstance()->Shutdown());
78 #if defined(OS_MACOSX) 78 #if defined(OS_MACOSX)
79 // ForceServiceProcessShutdown removes the process from launched on Mac. 79 // ForceServiceProcessShutdown removes the process from launched on Mac.
80 ForceServiceProcessShutdown("", 0); 80 ForceServiceProcessShutdown("", 0);
81 #endif // OS_MACOSX 81 #endif // OS_MACOSX
82 if (service_process_.IsValid()) { 82 if (service_process_.IsValid()) {
83 EXPECT_TRUE(base::WaitForSingleProcess( 83 int exit_code;
84 service_process_.Handle(), 84 EXPECT_TRUE(service_process_.WaitForExitWithTimeout(
85 TestTimeouts::action_max_timeout())); 85 TestTimeouts::action_max_timeout(), &exit_code));
86 EXPECT_EQ(0, exit_code);
86 service_process_.Close(); 87 service_process_.Close();
87 } 88 }
88 } 89 }
89 90
90 void ProcessControlLaunched() { 91 void ProcessControlLaunched() {
91 base::ProcessId service_pid; 92 base::ProcessId service_pid;
92 EXPECT_TRUE(GetServiceProcessData(NULL, &service_pid)); 93 EXPECT_TRUE(GetServiceProcessData(NULL, &service_pid));
93 EXPECT_NE(static_cast<base::ProcessId>(0), service_pid); 94 EXPECT_NE(static_cast<base::ProcessId>(0), service_pid);
94 #if defined(OS_WIN) 95 #if defined(OS_WIN)
95 service_process_ = 96 service_process_ =
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 // Callback should not be called during GetHistograms call. 282 // Callback should not be called during GetHistograms call.
282 EXPECT_CALL(*this, MockHistogramsCallback()).Times(0); 283 EXPECT_CALL(*this, MockHistogramsCallback()).Times(0);
283 // Wait for real callback by providing large timeout value. 284 // Wait for real callback by providing large timeout value.
284 EXPECT_TRUE(ServiceProcessControl::GetInstance()->GetHistograms( 285 EXPECT_TRUE(ServiceProcessControl::GetInstance()->GetHistograms(
285 base::Bind(&ServiceProcessControlBrowserTest::HistogramsCallback, 286 base::Bind(&ServiceProcessControlBrowserTest::HistogramsCallback,
286 base::Unretained(this)), 287 base::Unretained(this)),
287 base::TimeDelta::FromHours(1))); 288 base::TimeDelta::FromHours(1)));
288 EXPECT_CALL(*this, MockHistogramsCallback()).Times(1); 289 EXPECT_CALL(*this, MockHistogramsCallback()).Times(1);
289 content::RunMessageLoop(); 290 content::RunMessageLoop();
290 } 291 }
OLDNEW
« no previous file with comments | « chrome/browser/process_singleton_browsertest.cc ('k') | chrome/utility/importer/firefox_importer_unittest_utils_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698