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

Unified Diff: base/process/process_unittest.cc

Issue 1142913004: Revert of Add support for backgrounding processes on the Mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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_posix.cc ('k') | content/browser/child_process_launcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/process_unittest.cc
diff --git a/base/process/process_unittest.cc b/base/process/process_unittest.cc
index e094c032f3bb07e4e7530ac3276e2e77726629e0..ba8e4e6f68820c0827a463c63d0022e588a689bb 100644
--- a/base/process/process_unittest.cc
+++ b/base/process/process_unittest.cc
@@ -10,10 +10,6 @@
#include "base/threading/platform_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/multiprocess_func_list.h"
-
-#if defined(OS_MACOSX)
-#include <mach/mach.h>
-#endif // OS_MACOSX
namespace {
@@ -174,19 +170,7 @@
TEST_F(ProcessTest, SetProcessBackgrounded) {
Process process(SpawnChild("SimpleChildProcess"));
int old_priority = process.GetPriority();
-#if defined(OS_MACOSX)
- // On the Mac, backgrounding a process requires a port to that process.
- // In the browser it's available through the MachBroker class, which is not
- // part of base. Additionally, there is an indefinite amount of time between
- // spawning a process and receiving its port. Because this test just checks
- // the ability to background/foreground a process, we can use the current
- // process's port instead.
- mach_port_t process_port = mach_task_self();
- EXPECT_TRUE(process.SetProcessBackgrounded(process_port, true));
- EXPECT_TRUE(process.IsProcessBackgrounded(process_port));
- EXPECT_TRUE(process.SetProcessBackgrounded(process_port, false));
- EXPECT_FALSE(process.IsProcessBackgrounded(process_port));
-#elif defined(OS_WIN)
+#if defined(OS_WIN)
EXPECT_TRUE(process.SetProcessBackgrounded(true));
EXPECT_TRUE(process.IsProcessBackgrounded());
EXPECT_TRUE(process.SetProcessBackgrounded(false));
@@ -204,13 +188,7 @@
TEST_F(ProcessTest, SetProcessBackgroundedSelf) {
Process process = Process::Current();
int old_priority = process.GetPriority();
-#if defined(OS_MACOSX)
- mach_port_t process_port = mach_task_self();
- EXPECT_TRUE(process.SetProcessBackgrounded(process_port, true));
- EXPECT_TRUE(process.IsProcessBackgrounded(process_port));
- EXPECT_TRUE(process.SetProcessBackgrounded(process_port, false));
- EXPECT_FALSE(process.IsProcessBackgrounded(process_port));
-#elif defined(OS_WIN)
+#if defined(OS_WIN)
EXPECT_TRUE(process.SetProcessBackgrounded(true));
EXPECT_TRUE(process.IsProcessBackgrounded());
EXPECT_TRUE(process.SetProcessBackgrounded(false));
« no previous file with comments | « base/process/process_posix.cc ('k') | content/browser/child_process_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698