OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/chromedriver/chrome_launcher.h" | 5 #include "chrome/test/chromedriver/chrome_launcher.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <utility> | 10 #include <utility> |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 browser_info->android_package.c_str())); | 215 browser_info->android_package.c_str())); |
216 } | 216 } |
217 } | 217 } |
218 | 218 |
219 base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); | 219 base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); |
220 if (cmd_line->HasSwitch("disable-build-check")) { | 220 if (cmd_line->HasSwitch("disable-build-check")) { |
221 LOG(WARNING) << "You are using an unsupported command-line switch: " | 221 LOG(WARNING) << "You are using an unsupported command-line switch: " |
222 "--disable-build-check. Please don't report bugs that " | 222 "--disable-build-check. Please don't report bugs that " |
223 "cannot be reproduced with this switch removed."; | 223 "cannot be reproduced with this switch removed."; |
224 } else if (browser_info->build_no < kMinimumSupportedChromeBuildNo) { | 224 } else if (browser_info->build_no < kMinimumSupportedChromeBuildNo) { |
225 return Status(kUnknownError, "Chrome version must be >= " + | 225 return Status( |
226 GetMinimumSupportedChromeVersion()); | 226 kSessionNotCreatedException, |
| 227 "Chrome version must be >= " + GetMinimumSupportedChromeVersion()); |
227 } | 228 } |
228 | 229 |
229 while (base::TimeTicks::Now() < deadline) { | 230 while (base::TimeTicks::Now() < deadline) { |
230 WebViewsInfo views_info; | 231 WebViewsInfo views_info; |
231 client->GetWebViewsInfo(&views_info); | 232 client->GetWebViewsInfo(&views_info); |
232 for (size_t i = 0; i < views_info.GetSize(); ++i) { | 233 for (size_t i = 0; i < views_info.GetSize(); ++i) { |
233 if (views_info.Get(i).type == WebViewInfo::kPage) { | 234 if (views_info.Get(i).type == WebViewInfo::kPage) { |
234 *user_client = std::move(client); | 235 *user_client = std::move(client); |
235 return Status(kOk); | 236 return Status(kOk); |
236 } | 237 } |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 // Write empty "First Run" file, otherwise Chrome will wipe the default | 882 // Write empty "First Run" file, otherwise Chrome will wipe the default |
882 // profile that was written. | 883 // profile that was written. |
883 if (base::WriteFile( | 884 if (base::WriteFile( |
884 user_data_dir.Append(chrome::kFirstRunSentinel), "", 0) != 0) { | 885 user_data_dir.Append(chrome::kFirstRunSentinel), "", 0) != 0) { |
885 return Status(kUnknownError, "failed to write first run file"); | 886 return Status(kUnknownError, "failed to write first run file"); |
886 } | 887 } |
887 return Status(kOk); | 888 return Status(kOk); |
888 } | 889 } |
889 | 890 |
890 } // namespace internal | 891 } // namespace internal |
OLD | NEW |