| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 base::MessageLoop::QuitClosure()); | 111 base::MessageLoop::QuitClosure()); |
| 112 } | 112 } |
| 113 | 113 |
| 114 private: | 114 private: |
| 115 base::ProcessHandle service_process_handle_; | 115 base::ProcessHandle service_process_handle_; |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 class RealServiceProcessControlBrowserTest | 118 class RealServiceProcessControlBrowserTest |
| 119 : public ServiceProcessControlBrowserTest { | 119 : public ServiceProcessControlBrowserTest { |
| 120 public: | 120 public: |
| 121 void SetUpCommandLine(CommandLine* command_line) override { | 121 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 122 ServiceProcessControlBrowserTest::SetUpCommandLine(command_line); | 122 ServiceProcessControlBrowserTest::SetUpCommandLine(command_line); |
| 123 base::FilePath exe; | 123 base::FilePath exe; |
| 124 PathService::Get(base::DIR_EXE, &exe); | 124 PathService::Get(base::DIR_EXE, &exe); |
| 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); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 // Callback should not be called during GetHistograms call. | 279 // Callback should not be called during GetHistograms call. |
| 280 EXPECT_CALL(*this, MockHistogramsCallback()).Times(0); | 280 EXPECT_CALL(*this, MockHistogramsCallback()).Times(0); |
| 281 // Wait for real callback by providing large timeout value. | 281 // Wait for real callback by providing large timeout value. |
| 282 EXPECT_TRUE(ServiceProcessControl::GetInstance()->GetHistograms( | 282 EXPECT_TRUE(ServiceProcessControl::GetInstance()->GetHistograms( |
| 283 base::Bind(&ServiceProcessControlBrowserTest::HistogramsCallback, | 283 base::Bind(&ServiceProcessControlBrowserTest::HistogramsCallback, |
| 284 base::Unretained(this)), | 284 base::Unretained(this)), |
| 285 base::TimeDelta::FromHours(1))); | 285 base::TimeDelta::FromHours(1))); |
| 286 EXPECT_CALL(*this, MockHistogramsCallback()).Times(1); | 286 EXPECT_CALL(*this, MockHistogramsCallback()).Times(1); |
| 287 content::RunMessageLoop(); | 287 content::RunMessageLoop(); |
| 288 } | 288 } |
| OLD | NEW |