summaryrefslogtreecommitdiffstats
path: root/apps/app_shim
diff options
context:
space:
mode:
authortapted@chromium.org <tapted@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-21 16:24:48 +0000
committertapted@chromium.org <tapted@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-21 16:24:48 +0000
commit05205e51d11498720516e3ed9d98550e4c7fd083 (patch)
treee0d62e1932362a8c7d474045df8c1871ff681271 /apps/app_shim
parent6814ae854f9cdb6c5a2a32ec717112b912ea19a2 (diff)
downloadchromium_src-05205e51d11498720516e3ed9d98550e4c7fd083.zip
chromium_src-05205e51d11498720516e3ed9d98550e4c7fd083.tar.gz
chromium_src-05205e51d11498720516e3ed9d98550e4c7fd083.tar.bz2
Suppress uninteresting log output from mac tests due to long shim domain sockets.
The user data dir in swarmed buildbot tests typically exceeds the maximum domain socket path length on Mac (104 characters, including the null terminator). This generates confusing log spam in builder output. This CL suppresses the LOG(ERROR) in MakeUnixAddrForPath() by returning early. BUG=240554 Review URL: https://codereview.chromium.org/27159002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229828 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'apps/app_shim')
-rw-r--r--apps/app_shim/app_shim_host_manager_mac.mm12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/app_shim/app_shim_host_manager_mac.mm b/apps/app_shim/app_shim_host_manager_mac.mm
index 3e1772a..eeaa114 100644
--- a/apps/app_shim/app_shim_host_manager_mac.mm
+++ b/apps/app_shim/app_shim_host_manager_mac.mm
@@ -7,12 +7,15 @@
#include "apps/app_shim/app_shim_handler_mac.h"
#include "apps/app_shim/app_shim_host_mac.h"
#include "base/bind.h"
+#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "chrome/browser/browser_process.h"
#include "chrome/common/chrome_paths.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/mac/app_mode_common.h"
+#include "ipc/unix_domain_socket_util.h"
using content::BrowserThread;
@@ -54,6 +57,15 @@ void AppShimHostManager::InitOnFileThread() {
base::FilePath socket_path =
user_data_dir.Append(app_mode::kAppShimSocketName);
+ // This mirrors a check in unix_domain_socket_util.cc which will guarantee
+ // failure and spam log files on bots because they have deeply nested paths to
+ // |user_data_dir| when swarming. See http://crbug.com/240554. Shim tests that
+ // run on the bots must override the path using AppShimHostManagerTestApi.
+ if (socket_path.value().length() >= IPC::kMaxSocketNameLength &&
+ CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) {
+ return;
+ }
+
factory_.reset(new IPC::ChannelFactory(socket_path, this));
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,