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

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

Issue 8964004: check for successful exit code in WaitForSingleProcess on Windows to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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
« base/process_util_win.cc ('K') | « base/process_util_win.cc ('k') | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/process_util.h" 7 #include "base/process_util.h"
8 #include "base/test/test_timeouts.h" 8 #include "base/test/test_timeouts.h"
9 #include "chrome/browser/service/service_process_control.h" 9 #include "chrome/browser/service/service_process_control.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 service_process_handle_, 68 service_process_handle_,
69 TestTimeouts::action_max_timeout_ms())); 69 TestTimeouts::action_max_timeout_ms()));
70 } 70 }
71 71
72 void ProcessControlLaunched() { 72 void ProcessControlLaunched() {
73 base::ProcessId service_pid; 73 base::ProcessId service_pid;
74 EXPECT_TRUE(GetServiceProcessData(NULL, &service_pid)); 74 EXPECT_TRUE(GetServiceProcessData(NULL, &service_pid));
75 EXPECT_NE(static_cast<base::ProcessId>(0), service_pid); 75 EXPECT_NE(static_cast<base::ProcessId>(0), service_pid);
76 EXPECT_TRUE(base::OpenProcessHandleWithAccess( 76 EXPECT_TRUE(base::OpenProcessHandleWithAccess(
77 service_pid, 77 service_pid,
78 base::kProcessAccessWaitForTermination, 78 base::kProcessAccessWaitForTermination |
79 // we need query permission to get exit code
80 base::kProcessAccessQueryInformation,
79 &service_process_handle_)); 81 &service_process_handle_));
80 // Quit the current message. Post a QuitTask instead of just calling Quit() 82 // Quit the current message. Post a QuitTask instead of just calling Quit()
81 // because this can get invoked in the context of a Launch() call and we 83 // because this can get invoked in the context of a Launch() call and we
82 // may not be in Run() yet. 84 // may not be in Run() yet.
83 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); 85 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure());
84 } 86 }
85 87
86 void ProcessControlLaunchFailed() { 88 void ProcessControlLaunchFailed() {
87 ADD_FAILURE(); 89 ADD_FAILURE();
88 // Quit the current message. 90 // Quit the current message.
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 EXPECT_FALSE(GetServiceProcessData(NULL, &service_pid)); 200 EXPECT_FALSE(GetServiceProcessData(NULL, &service_pid));
199 // Launch the service process. 201 // Launch the service process.
200 LaunchServiceProcessControl(); 202 LaunchServiceProcessControl();
201 EXPECT_TRUE(GetServiceProcessData(NULL, &service_pid)); 203 EXPECT_TRUE(GetServiceProcessData(NULL, &service_pid));
202 EXPECT_NE(static_cast<base::ProcessId>(0), service_pid); 204 EXPECT_NE(static_cast<base::ProcessId>(0), service_pid);
203 // Disconnect from service process. 205 // Disconnect from service process.
204 ServiceProcessControl::GetInstance()->Disconnect(); 206 ServiceProcessControl::GetInstance()->Disconnect();
205 } 207 }
206 208
207 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcessControlBrowserTest); 209 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcessControlBrowserTest);
OLDNEW
« base/process_util_win.cc ('K') | « base/process_util_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698