Index: apps/app_shim/chrome_main_app_mode_mac.mm |
diff --git a/apps/app_shim/chrome_main_app_mode_mac.mm b/apps/app_shim/chrome_main_app_mode_mac.mm |
index ee81b77913540ec0d22db275e58de5edbeba324d..18b8f9e1cfdbca32b371e69ba850be1f2bc33587 100644 |
--- a/apps/app_shim/chrome_main_app_mode_mac.mm |
+++ b/apps/app_shim/chrome_main_app_mode_mac.mm |
@@ -611,7 +611,11 @@ int ChromeAppModeStart(const app_mode::ChromeAppModeInfo* info) { |
main_message_loop.set_thread_name("MainThread"); |
base::PlatformThread::SetName("CrAppShimMain"); |
- if (pid == -1) { |
+ // In tests, launching Chrome does nothing, and we won't get a ping response, |
+ // so just assume the socket exists. |
+ if (pid == -1 && |
+ !CommandLine::ForCurrentProcess()->HasSwitch( |
+ app_mode::kLaunchedForTest)) { |
// Launch Chrome if it isn't already running. |
ProcessSerialNumber psn; |
CommandLine command_line(CommandLine::NO_PROGRAM); |