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

Side by Side Diff: base/process/process_unittest.cc

Issue 2629623003: Win should call ::TerminateProcess to exit a renderer process (Closed)
Patch Set: temp Created 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/process/process.h" 5 #include "base/process/process.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/process/kill.h" 9 #include "base/process/kill.h"
10 #include "base/test/multiprocess_test.h" 10 #include "base/test/multiprocess_test.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 &exit_code); 141 &exit_code);
142 142
143 EXPECT_NE(TERMINATION_STATUS_STILL_RUNNING, 143 EXPECT_NE(TERMINATION_STATUS_STILL_RUNNING,
144 GetTerminationStatus(process.Handle(), &exit_code)); 144 GetTerminationStatus(process.Handle(), &exit_code));
145 #if !defined(OS_POSIX) 145 #if !defined(OS_POSIX)
146 // The POSIX implementation actually ignores the exit_code. 146 // The POSIX implementation actually ignores the exit_code.
147 EXPECT_EQ(kExpectedExitCode, exit_code); 147 EXPECT_EQ(kExpectedExitCode, exit_code);
148 #endif 148 #endif
149 } 149 }
150 150
151 MULTIPROCESS_TEST_MAIN(TerminateCurrentProcessImmediately) {
Primiano Tucci (use gerrit) 2017/01/17 07:55:16 Well this is good but no sufficient. You still ne
152 Process::TerminateCurrentProcessImmediately(0);
153 return 0;
154 }
155
151 MULTIPROCESS_TEST_MAIN(FastSleepyChildProcess) { 156 MULTIPROCESS_TEST_MAIN(FastSleepyChildProcess) {
152 PlatformThread::Sleep(TestTimeouts::tiny_timeout() * 10); 157 PlatformThread::Sleep(TestTimeouts::tiny_timeout() * 10);
153 return 0; 158 return 0;
154 } 159 }
155 160
156 TEST_F(ProcessTest, WaitForExit) { 161 TEST_F(ProcessTest, WaitForExit) {
157 Process process(SpawnChild("FastSleepyChildProcess")); 162 Process process(SpawnChild("FastSleepyChildProcess"));
158 ASSERT_TRUE(process.IsValid()); 163 ASSERT_TRUE(process.IsValid());
159 164
160 const int kDummyExitCode = 42; 165 const int kDummyExitCode = 42;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 "2:freezer:/chrome_renderers/to_be_frozen\n" 252 "2:freezer:/chrome_renderers/to_be_frozen\n"
248 "1:cpu:/chrome_renderers/background\n"; 253 "1:cpu:/chrome_renderers/background\n";
249 254
250 EXPECT_FALSE(IsProcessBackgroundedCGroup(kNotBackgrounded)); 255 EXPECT_FALSE(IsProcessBackgroundedCGroup(kNotBackgrounded));
251 EXPECT_TRUE(IsProcessBackgroundedCGroup(kBackgrounded)); 256 EXPECT_TRUE(IsProcessBackgroundedCGroup(kBackgrounded));
252 } 257 }
253 258
254 #endif // defined(OS_CHROMEOS) 259 #endif // defined(OS_CHROMEOS)
255 260
256 } // namespace base 261 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698