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" |
11 #include "base/process/kill.h" | 11 #include "base/process/kill.h" |
12 #include "base/process/process_handle.h" | 12 #include "base/process/process_handle.h" |
13 #include "base/process/process_iterator.h" | 13 #include "base/process/process_iterator.h" |
14 #include "base/test/test_timeouts.h" | 14 #include "base/test/test_timeouts.h" |
15 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
16 #include "chrome/common/chrome_constants.h" | 16 #include "chrome/common/chrome_constants.h" |
17 #include "chrome/common/chrome_version_info.h" | 17 #include "chrome/common/chrome_version_info.h" |
18 #include "chrome/common/service_process_util.h" | 18 #include "chrome/common/service_process_util.h" |
19 #include "chrome/test/base/in_process_browser_test.h" | 19 #include "chrome/test/base/in_process_browser_test.h" |
20 #include "chrome/test/base/ui_test_utils.h" | |
21 #include "content/public/common/content_paths.h" | 20 #include "content/public/common/content_paths.h" |
22 #include "content/public/common/content_switches.h" | 21 #include "content/public/common/content_switches.h" |
| 22 #include "content/public/test/test_utils.h" |
23 #include "testing/gmock/include/gmock/gmock.h" | 23 #include "testing/gmock/include/gmock/gmock.h" |
24 | 24 |
25 class ServiceProcessControlBrowserTest | 25 class ServiceProcessControlBrowserTest |
26 : public InProcessBrowserTest { | 26 : public InProcessBrowserTest { |
27 public: | 27 public: |
28 ServiceProcessControlBrowserTest() | 28 ServiceProcessControlBrowserTest() |
29 : service_process_handle_(base::kNullProcessHandle) { | 29 : service_process_handle_(base::kNullProcessHandle) { |
30 } | 30 } |
31 virtual ~ServiceProcessControlBrowserTest() { | 31 virtual ~ServiceProcessControlBrowserTest() { |
32 base::CloseProcessHandle(service_process_handle_); | 32 base::CloseProcessHandle(service_process_handle_); |
(...skipping 246 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 |