diff options
author | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-29 17:43:44 +0000 |
---|---|---|
committer | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-29 17:43:44 +0000 |
commit | 276aa6a60396329c7fb4a988bd0be7f7d0895651 (patch) | |
tree | 62ed233e5faf34a14cf99fcbe49416b64e506d23 /base/process_util_unittest.cc | |
parent | 57f9caa083ef107001b12ec6e455e23a5f94e420 (diff) | |
download | chromium_src-276aa6a60396329c7fb4a988bd0be7f7d0895651.zip chromium_src-276aa6a60396329c7fb4a988bd0be7f7d0895651.tar.gz chromium_src-276aa6a60396329c7fb4a988bd0be7f7d0895651.tar.bz2 |
Lower priorities of background tabs on linux.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/345009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30470 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util_unittest.cc')
-rw-r--r-- | base/process_util_unittest.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/base/process_util_unittest.cc b/base/process_util_unittest.cc index eff8fae..e2fb5bf 100644 --- a/base/process_util_unittest.cc +++ b/base/process_util_unittest.cc @@ -69,6 +69,20 @@ TEST_F(ProcessUtilTest, KillSlowChild) { base::CloseProcessHandle(handle); } +// 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) { + ProcessHandle handle = this->SpawnChild(L"SimpleChildProcess"); + Process process(handle); + int old_priority = process.GetPriority(); + process.SetProcessBackgrounded(true); + process.SetProcessBackgrounded(false); + 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) { |