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

Unified Diff: base/process/process_util_unittest.cc

Issue 651253002: Enforce handle ownership in base::Process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add empty line Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/process/process_unittest.cc ('k') | base/process/process_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/process_util_unittest.cc
diff --git a/base/process/process_util_unittest.cc b/base/process/process_util_unittest.cc
index 9188fd3fd652e1b1148aa43793f3290f2b69e65b..d846d1acfae2634c4aff68f1498b21eaac1b45f8 100644
--- a/base/process/process_util_unittest.cc
+++ b/base/process/process_util_unittest.cc
@@ -311,45 +311,6 @@ TEST_F(ProcessUtilTest, GetTerminationStatusKill) {
remove(signal_file.c_str());
}
-// Ensure that the priority of a process is restored correctly after
-// backgrounding and restoring.
-// Note: a platform may not be willing or able to lower the priority of
-// a process. The calls to SetProcessBackground should be noops then.
-TEST_F(ProcessUtilTest, SetProcessBackgrounded) {
- base::ProcessHandle handle = SpawnChild("SimpleChildProcess");
- base::Process process(handle);
- int old_priority = process.GetPriority();
-#if defined(OS_WIN)
- EXPECT_TRUE(process.SetProcessBackgrounded(true));
- EXPECT_TRUE(process.IsProcessBackgrounded());
- EXPECT_TRUE(process.SetProcessBackgrounded(false));
- EXPECT_FALSE(process.IsProcessBackgrounded());
-#else
- process.SetProcessBackgrounded(true);
- process.SetProcessBackgrounded(false);
-#endif
- int new_priority = process.GetPriority();
- EXPECT_EQ(old_priority, new_priority);
-}
-
-// Same as SetProcessBackgrounded but to this very process. It uses
-// a different code path at least for Windows.
-TEST_F(ProcessUtilTest, SetProcessBackgroundedSelf) {
- base::Process process(base::Process::Current().handle());
- int old_priority = process.GetPriority();
-#if defined(OS_WIN)
- EXPECT_TRUE(process.SetProcessBackgrounded(true));
- EXPECT_TRUE(process.IsProcessBackgrounded());
- EXPECT_TRUE(process.SetProcessBackgrounded(false));
- EXPECT_FALSE(process.IsProcessBackgrounded());
-#else
- process.SetProcessBackgrounded(true);
- process.SetProcessBackgrounded(false);
-#endif
- int new_priority = process.GetPriority();
- EXPECT_EQ(old_priority, new_priority);
-}
-
#if defined(OS_WIN)
// TODO(estade): if possible, port this test.
TEST_F(ProcessUtilTest, GetAppOutput) {
« no previous file with comments | « base/process/process_unittest.cc ('k') | base/process/process_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698