| OLD | NEW |
| 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/browser/service_process/service_process_control.h" | 5 #include "chrome/browser/service_process/service_process_control.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 #if defined(OS_MACOSX) | 125 #if defined(OS_MACOSX) |
| 126 exe = exe.DirName().DirName().DirName(); | 126 exe = exe.DirName().DirName().DirName(); |
| 127 #endif | 127 #endif |
| 128 exe = exe.Append(chrome::kHelperProcessExecutablePath); | 128 exe = exe.Append(chrome::kHelperProcessExecutablePath); |
| 129 // Run chrome instead of browser_tests.exe. | 129 // Run chrome instead of browser_tests.exe. |
| 130 EXPECT_TRUE(base::PathExists(exe)); | 130 EXPECT_TRUE(base::PathExists(exe)); |
| 131 command_line->AppendSwitchPath(switches::kBrowserSubprocessPath, exe); | 131 command_line->AppendSwitchPath(switches::kBrowserSubprocessPath, exe); |
| 132 } | 132 } |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 #if defined(OS_MACOSX) | 135 // TODO(vitalybuka): Fix crbug.com/340563 |
| 136 // Does not work on MACOSX. | |
| 137 #define MAYBE_LaunchAndIPC DISABLED_LaunchAndIPC | |
| 138 #else | |
| 139 #define MAYBE_LaunchAndIPC LaunchAndIPC | |
| 140 #endif | |
| 141 | |
| 142 IN_PROC_BROWSER_TEST_F(RealServiceProcessControlBrowserTest, | 136 IN_PROC_BROWSER_TEST_F(RealServiceProcessControlBrowserTest, |
| 143 MAYBE_LaunchAndIPC) { | 137 DISABLED_LaunchAndIPC) { |
| 144 LaunchServiceProcessControl(); | 138 LaunchServiceProcessControl(); |
| 145 | 139 |
| 146 // Make sure we are connected to the service process. | 140 // Make sure we are connected to the service process. |
| 147 ASSERT_TRUE(ServiceProcessControl::GetInstance()->IsConnected()); | 141 ASSERT_TRUE(ServiceProcessControl::GetInstance()->IsConnected()); |
| 148 ServiceProcessControl::GetInstance()->GetCloudPrintProxyInfo( | 142 ServiceProcessControl::GetInstance()->GetCloudPrintProxyInfo( |
| 149 base::Bind(&ServiceProcessControlBrowserTest::CloudPrintInfoCallback)); | 143 base::Bind(&ServiceProcessControlBrowserTest::CloudPrintInfoCallback)); |
| 150 content::RunMessageLoop(); | 144 content::RunMessageLoop(); |
| 151 | 145 |
| 152 // And then shutdown the service process. | 146 // And then shutdown the service process. |
| 153 EXPECT_TRUE(ServiceProcessControl::GetInstance()->Shutdown()); | 147 EXPECT_TRUE(ServiceProcessControl::GetInstance()->Shutdown()); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 // Callback should not be called during GetHistograms call. | 279 // Callback should not be called during GetHistograms call. |
| 286 EXPECT_CALL(*this, MockHistogramsCallback()).Times(0); | 280 EXPECT_CALL(*this, MockHistogramsCallback()).Times(0); |
| 287 // Wait for real callback by providing large timeout value. | 281 // Wait for real callback by providing large timeout value. |
| 288 EXPECT_TRUE(ServiceProcessControl::GetInstance()->GetHistograms( | 282 EXPECT_TRUE(ServiceProcessControl::GetInstance()->GetHistograms( |
| 289 base::Bind(&ServiceProcessControlBrowserTest::HistogramsCallback, | 283 base::Bind(&ServiceProcessControlBrowserTest::HistogramsCallback, |
| 290 base::Unretained(this)), | 284 base::Unretained(this)), |
| 291 base::TimeDelta::FromHours(1))); | 285 base::TimeDelta::FromHours(1))); |
| 292 EXPECT_CALL(*this, MockHistogramsCallback()).Times(1); | 286 EXPECT_CALL(*this, MockHistogramsCallback()).Times(1); |
| 293 content::RunMessageLoop(); | 287 content::RunMessageLoop(); |
| 294 } | 288 } |
| OLD | NEW |