| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/test/ui/ui_test_suite.h" | 5 #include "chrome/test/ui/ui_test_suite.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/environment.h" | 10 #include "base/environment.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 void UITestSuite::Shutdown() { | 33 void UITestSuite::Shutdown() { |
| 34 #if defined(OS_WIN) | 34 #if defined(OS_WIN) |
| 35 if (crash_service_) | 35 if (crash_service_) |
| 36 base::KillProcess(crash_service_, 0, false); | 36 base::KillProcess(crash_service_, 0, false); |
| 37 job_handle_.Close(); | 37 job_handle_.Close(); |
| 38 #endif | 38 #endif |
| 39 ChromeTestSuite::Shutdown(); | 39 ChromeTestSuite::Shutdown(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 bool UITestSuite::IsBrowserTestSuite() { return false; } | |
| 43 | |
| 44 #if defined(OS_WIN) | 42 #if defined(OS_WIN) |
| 45 void UITestSuite::LoadCrashService() { | 43 void UITestSuite::LoadCrashService() { |
| 46 scoped_ptr<base::Environment> env(base::Environment::Create()); | 44 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 47 if (env->HasVar(env_vars::kHeadless)) | 45 if (env->HasVar(env_vars::kHeadless)) |
| 48 return; | 46 return; |
| 49 | 47 |
| 50 if (base::GetProcessCount(L"crash_service.exe", NULL)) | 48 if (base::GetProcessCount(L"crash_service.exe", NULL)) |
| 51 return; | 49 return; |
| 52 | 50 |
| 53 job_handle_.Set(CreateJobObject(NULL, NULL)); | 51 job_handle_.Set(CreateJobObject(NULL, NULL)); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 75 base::win::ScopedHandle crash_service_handle; | 73 base::win::ScopedHandle crash_service_handle; |
| 76 if (!base::LaunchProcess(crash_service.value(), base::LaunchOptions(), | 74 if (!base::LaunchProcess(crash_service.value(), base::LaunchOptions(), |
| 77 &crash_service_handle)) { | 75 &crash_service_handle)) { |
| 78 LOG(ERROR) << "Couldn't start crash_service.exe, so this ui_tests run " | 76 LOG(ERROR) << "Couldn't start crash_service.exe, so this ui_tests run " |
| 79 << "won't tell you if any test crashes!"; | 77 << "won't tell you if any test crashes!"; |
| 80 return; | 78 return; |
| 81 } | 79 } |
| 82 crash_service_ = crash_service_handle.Take(); | 80 crash_service_ = crash_service_handle.Take(); |
| 83 } | 81 } |
| 84 #endif | 82 #endif |
| OLD | NEW |