OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/environment.h" | 9 #include "base/environment.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 } | 108 } |
109 | 109 |
110 void UITestSuite::SuppressErrorDialogs() { | 110 void UITestSuite::SuppressErrorDialogs() { |
111 TestSuite::SuppressErrorDialogs(); | 111 TestSuite::SuppressErrorDialogs(); |
112 UITest::set_show_error_dialogs(false); | 112 UITest::set_show_error_dialogs(false); |
113 } | 113 } |
114 | 114 |
115 #if defined(OS_WIN) | 115 #if defined(OS_WIN) |
116 void UITestSuite::LoadCrashService() { | 116 void UITestSuite::LoadCrashService() { |
117 scoped_ptr<base::Environment> env(base::Environment::Create()); | 117 scoped_ptr<base::Environment> env(base::Environment::Create()); |
118 if (env->HasEnv(env_vars::kHeadless)) | 118 if (env->HasVar(env_vars::kHeadless)) |
119 return; | 119 return; |
120 | 120 |
121 if (base::GetProcessCount(L"crash_service.exe", NULL)) | 121 if (base::GetProcessCount(L"crash_service.exe", NULL)) |
122 return; | 122 return; |
123 | 123 |
124 FilePath exe_dir; | 124 FilePath exe_dir; |
125 if (!PathService::Get(base::DIR_EXE, &exe_dir)) { | 125 if (!PathService::Get(base::DIR_EXE, &exe_dir)) { |
126 DCHECK(false); | 126 DCHECK(false); |
127 return; | 127 return; |
128 } | 128 } |
129 | 129 |
130 FilePath crash_service = exe_dir.Append(L"crash_service.exe"); | 130 FilePath crash_service = exe_dir.Append(L"crash_service.exe"); |
131 if (!base::LaunchApp(crash_service.ToWStringHack(), false, false, | 131 if (!base::LaunchApp(crash_service.ToWStringHack(), false, false, |
132 &crash_service_)) { | 132 &crash_service_)) { |
133 printf("Couldn't start crash_service.exe, so this ui_test run won't tell " \ | 133 printf("Couldn't start crash_service.exe, so this ui_test run won't tell " \ |
134 "you if any test crashes!\n"); | 134 "you if any test crashes!\n"); |
135 return; | 135 return; |
136 } | 136 } |
137 | 137 |
138 printf("Started crash_service.exe so you know if a test crashes!\n"); | 138 printf("Started crash_service.exe so you know if a test crashes!\n"); |
139 } | 139 } |
140 #endif | 140 #endif |
OLD | NEW |