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

Side by Side Diff: base/process_util_unittest.cc

Issue 17022: Processes take a long time to start if started via ssh,... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 11 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
« no previous file with comments | « no previous file | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #define _CRT_SECURE_NO_WARNINGS 5 #define _CRT_SECURE_NO_WARNINGS
6 6
7 #include "base/multiprocess_test.h" 7 #include "base/multiprocess_test.h"
8 #include "base/platform_thread.h" 8 #include "base/platform_thread.h"
9 #include "base/process_util.h" 9 #include "base/process_util.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 15 matching lines...) Expand all
26 }; 26 };
27 27
28 MULTIPROCESS_TEST_MAIN(SimpleChildProcess) { 28 MULTIPROCESS_TEST_MAIN(SimpleChildProcess) {
29 return 0; 29 return 0;
30 } 30 }
31 31
32 TEST_F(ProcessUtilTest, SpawnChild) { 32 TEST_F(ProcessUtilTest, SpawnChild) {
33 ProcessHandle handle = this->SpawnChild(L"SimpleChildProcess"); 33 ProcessHandle handle = this->SpawnChild(L"SimpleChildProcess");
34 34
35 ASSERT_NE(static_cast<ProcessHandle>(NULL), handle); 35 ASSERT_NE(static_cast<ProcessHandle>(NULL), handle);
36 EXPECT_TRUE(WaitForSingleProcess(handle, 1000)); 36 EXPECT_TRUE(WaitForSingleProcess(handle, 5000));
37 } 37 }
38 38
39 MULTIPROCESS_TEST_MAIN(SlowChildProcess) { 39 MULTIPROCESS_TEST_MAIN(SlowChildProcess) {
40 // Sleep until file "SlowChildProcess.die" is created. 40 // Sleep until file "SlowChildProcess.die" is created.
41 FILE *fp; 41 FILE *fp;
42 do { 42 do {
43 PlatformThread::Sleep(100); 43 PlatformThread::Sleep(100);
44 fp = fopen("SlowChildProcess.die", "r"); 44 fp = fopen("SlowChildProcess.die", "r");
45 } while (!fp); 45 } while (!fp);
46 fclose(fp); 46 fclose(fp);
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 EXPECT_TRUE(WaitForSingleProcess(handle, 1000)); 204 EXPECT_TRUE(WaitForSingleProcess(handle, 1000));
205 close(fds[0]); 205 close(fds[0]);
206 close(sockets[0]); 206 close(sockets[0]);
207 close(sockets[1]); 207 close(sockets[1]);
208 close(dev_null); 208 close(dev_null);
209 } 209 }
210 210
211 #endif // defined(OS_POSIX) 211 #endif // defined(OS_POSIX)
212 212
213 } // namespace base 213 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698