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

Unified Diff: chrome/common/service_process_util_unittest.cc

Issue 7736002: Make the mac service process handling code clean itself up properly as far as launchd is concerned. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add launchd test Created 9 years, 4 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 | « chrome/common/service_process_util_posix.cc ('k') | chrome/common/service_process_util_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/service_process_util_unittest.cc
diff --git a/chrome/common/service_process_util_unittest.cc b/chrome/common/service_process_util_unittest.cc
index 8d38347bf553633299659e8c69bc84aabc581522..3add0c271b2688f4609024bfb22771e826c02aca 100644
--- a/chrome/common/service_process_util_unittest.cc
+++ b/chrome/common/service_process_util_unittest.cc
@@ -5,12 +5,13 @@
#include "chrome/common/service_process_util.h"
#include "base/basictypes.h"
+#include "base/command_line.h"
+#include "base/file_path.h"
+#include "base/process_util.h"
#if !defined(OS_MACOSX)
#include "base/at_exit.h"
-#include "base/command_line.h"
#include "base/memory/scoped_ptr.h"
-#include "base/process_util.h"
#include "base/string_util.h"
#include "base/test/multiprocess_test.h"
#include "base/test/test_timeouts.h"
@@ -24,7 +25,7 @@
#include "base/win/win_util.h"
#endif
-#if defined(OS_POSIX) && !defined(OS_MACOSX)
+#if defined(OS_POSIX)
#include "chrome/common/auto_start_linux.h"
#include <glib.h>
#endif
@@ -497,6 +498,26 @@ void TrashFunc(const FilePath& src) {
EXPECT_EQ(status, noErr) << "FSMoveObjectToTrashSync " << status;
}
+TEST_F(ServiceProcessStateFileManipulationTest, VerifyLaunchD) {
+ // There have been problems where launchd has gotten into a bad state, usually
+ // because something had deleted all the files in /tmp. launchd depends on
+ // a Unix Domain Socket that it creates at /tmp/launchd*/sock.
+ // The symptom of this problem is that the service process connect fails
+ // on Mac and "launch_msg(): Socket is not connected" appears.
+ // This test is designed to make sure that launchd is working.
+ // http://crbug/75518
+
+ CommandLine cl(FilePath("/bin/launchctl"));
+ cl.AppendArg("list");
+ cl.AppendArg("com.apple.launchctl.Aqua");
+
+ std::string output;
+ int exit_code = -1;
+ ASSERT_TRUE(base::GetAppOutputWithExitCode(cl, &output, &exit_code)
+ && exit_code == 0)
+ << " exit_code:" << exit_code << " " << output;
+}
+
TEST_F(ServiceProcessStateFileManipulationTest, DeleteFile) {
GetIOMessageLoopProxy()->PostTask(
FROM_HERE,
« no previous file with comments | « chrome/common/service_process_util_posix.cc ('k') | chrome/common/service_process_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698