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

Side by Side Diff: chrome/common/service_process_util_unittest.cc

Issue 588833002: mac: Fix launchd test on 10.10 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from thestig. Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/service_process_util.h" 5 #include "chrome/common/service_process_util.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 } 338 }
339 339
340 TEST_F(ServiceProcessStateFileManipulationTest, VerifyLaunchD) { 340 TEST_F(ServiceProcessStateFileManipulationTest, VerifyLaunchD) {
341 // There have been problems where launchd has gotten into a bad state, usually 341 // There have been problems where launchd has gotten into a bad state, usually
342 // because something had deleted all the files in /tmp. launchd depends on 342 // because something had deleted all the files in /tmp. launchd depends on
343 // a Unix Domain Socket that it creates at /tmp/launchd*/sock. 343 // a Unix Domain Socket that it creates at /tmp/launchd*/sock.
344 // The symptom of this problem is that the service process connect fails 344 // The symptom of this problem is that the service process connect fails
345 // on Mac and "launch_msg(): Socket is not connected" appears. 345 // on Mac and "launch_msg(): Socket is not connected" appears.
346 // This test is designed to make sure that launchd is working. 346 // This test is designed to make sure that launchd is working.
347 // http://crbug/75518 347 // http://crbug/75518
348 // Note: This particular problem no longer affects launchd in 10.10+, since
349 // there is no user owned launchd process and sockets are no longer made at
350 // /tmp/launchd*/sock. This test is still useful as a sanity check to make
351 // sure that launchd appears to be working.
348 352
349 CommandLine cl(base::FilePath("/bin/launchctl")); 353 CommandLine cl(base::FilePath("/bin/launchctl"));
350 cl.AppendArg("list"); 354 cl.AppendArg("limit");
351 cl.AppendArg("com.apple.launchctl.Aqua");
352 355
353 std::string output; 356 std::string output;
354 int exit_code = -1; 357 int exit_code = -1;
355 ASSERT_TRUE(base::GetAppOutputWithExitCode(cl, &output, &exit_code) 358 ASSERT_TRUE(base::GetAppOutputWithExitCode(cl, &output, &exit_code)
356 && exit_code == 0) 359 && exit_code == 0)
357 << " exit_code:" << exit_code << " " << output; 360 << " exit_code:" << exit_code << " " << output;
358 } 361 }
359 362
360 TEST_F(ServiceProcessStateFileManipulationTest, DeleteFile) { 363 TEST_F(ServiceProcessStateFileManipulationTest, DeleteFile) {
361 GetIOMessageLoopProxy()->PostTask( 364 GetIOMessageLoopProxy()->PostTask(
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 ScopedAttributesRestorer restorer(bundle_path(), 0777); 416 ScopedAttributesRestorer restorer(bundle_path(), 0777);
414 GetIOMessageLoopProxy()->PostTask( 417 GetIOMessageLoopProxy()->PostTask(
415 FROM_HERE, 418 FROM_HERE,
416 base::Bind(&ChangeAttr, bundle_path(), 0222)); 419 base::Bind(&ChangeAttr, bundle_path(), 0222));
417 Run(); 420 Run();
418 ASSERT_TRUE(mock_launchd()->remove_called()); 421 ASSERT_TRUE(mock_launchd()->remove_called());
419 ASSERT_TRUE(mock_launchd()->delete_called()); 422 ASSERT_TRUE(mock_launchd()->delete_called());
420 } 423 }
421 424
422 #endif // !OS_MACOSX 425 #endif // !OS_MACOSX
OLDNEW
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698