Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Side by Side Diff: chrome/test/chromedriver/chrome_launcher.cc

Issue 2767313002: [chromedriver] Return session not created error if version check fails. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698