| Index: base/process_util_unittest.cc
|
| ===================================================================
|
| --- base/process_util_unittest.cc (revision 83074)
|
| +++ base/process_util_unittest.cc (working copy)
|
| @@ -260,12 +260,29 @@
|
| base::ProcessHandle handle = this->SpawnChild("SimpleChildProcess", false);
|
| base::Process process(handle);
|
| int old_priority = process.GetPriority();
|
| - process.SetProcessBackgrounded(true);
|
| - process.SetProcessBackgrounded(false);
|
| + if (process.SetProcessBackgrounded(true)) {
|
| + EXPECT_TRUE(process.IsProcessBackgrounded());
|
| + EXPECT_TRUE(process.SetProcessBackgrounded(false));
|
| + EXPECT_FALSE(process.IsProcessBackgrounded());
|
| + }
|
| 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 (process.SetProcessBackgrounded(true)) {
|
| + EXPECT_TRUE(process.IsProcessBackgrounded());
|
| + EXPECT_TRUE(process.SetProcessBackgrounded(false));
|
| + EXPECT_FALSE(process.IsProcessBackgrounded());
|
| + }
|
| + int new_priority = process.GetPriority();
|
| + EXPECT_EQ(old_priority, new_priority);
|
| +}
|
| +
|
| // TODO(estade): if possible, port these 2 tests.
|
| #if defined(OS_WIN)
|
| TEST_F(ProcessUtilTest, EnableLFH) {
|
|
|