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

Side by Side Diff: chrome/common/service_process_util_unittest.cc

Issue 6689014: GTTF: Detect browser crashes on shutdown in UI tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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) 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 "chrome/common/service_process_util.h" 5 #include "chrome/common/service_process_util.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 8
9 #if !defined(OS_MACOSX) 9 #if !defined(OS_MACOSX)
10 #include "base/at_exit.h" 10 #include "base/at_exit.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 for (int i = 0; !CheckServiceProcessReady() && i < 10; ++i) { 173 for (int i = 0; !CheckServiceProcessReady() && i < 10; ++i) {
174 base::PlatformThread::Sleep(TestTimeouts::tiny_timeout_ms()); 174 base::PlatformThread::Sleep(TestTimeouts::tiny_timeout_ms());
175 } 175 }
176 ASSERT_TRUE(CheckServiceProcessReady()); 176 ASSERT_TRUE(CheckServiceProcessReady());
177 std::string version; 177 std::string version;
178 base::ProcessId pid; 178 base::ProcessId pid;
179 ASSERT_TRUE(GetServiceProcessData(&version, &pid)); 179 ASSERT_TRUE(GetServiceProcessData(&version, &pid));
180 ASSERT_TRUE(ForceServiceProcessShutdown(version, pid)); 180 ASSERT_TRUE(ForceServiceProcessShutdown(version, pid));
181 int exit_code = 0; 181 int exit_code = 0;
182 ASSERT_TRUE(base::WaitForExitCodeWithTimeout(handle, 182 ASSERT_TRUE(base::WaitForExitCodeWithTimeout(handle,
183 &exit_code, TestTimeouts::action_timeout_ms() * 2)); 183 &exit_code, TestTimeouts::action_max_timeout_ms()));
184 base::CloseProcessHandle(handle);
184 ASSERT_EQ(exit_code, 0); 185 ASSERT_EQ(exit_code, 0);
185 } 186 }
186 187
187 MULTIPROCESS_TEST_MAIN(ServiceProcessStateTestSingleton) { 188 MULTIPROCESS_TEST_MAIN(ServiceProcessStateTestSingleton) {
188 ServiceProcessState state; 189 ServiceProcessState state;
189 EXPECT_FALSE(state.Initialize()); 190 EXPECT_FALSE(state.Initialize());
190 return 0; 191 return 0;
191 } 192 }
192 193
193 MULTIPROCESS_TEST_MAIN(ServiceProcessStateTestReadyTrue) { 194 MULTIPROCESS_TEST_MAIN(ServiceProcessStateTestReadyTrue) {
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 ScopedAttributesRestorer restorer(bundle_path(), 0777); 541 ScopedAttributesRestorer restorer(bundle_path(), 0777);
541 GetIOMessageLoopProxy()->PostTask( 542 GetIOMessageLoopProxy()->PostTask(
542 FROM_HERE, 543 FROM_HERE,
543 NewRunnableFunction(&ChangeAttr, bundle_path(), 0222)); 544 NewRunnableFunction(&ChangeAttr, bundle_path(), 0222));
544 Run(); 545 Run();
545 ASSERT_TRUE(mock_launchd()->remove_called()); 546 ASSERT_TRUE(mock_launchd()->remove_called());
546 ASSERT_TRUE(mock_launchd()->delete_called()); 547 ASSERT_TRUE(mock_launchd()->delete_called());
547 } 548 }
548 549
549 #endif // !OS_MACOSX 550 #endif // !OS_MACOSX
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698