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

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

Issue 1320153002: Add new termination status for failed launch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase and a nit. Created 5 years, 3 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
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 <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 break; 379 break;
380 case base::TERMINATION_STATUS_PROCESS_WAS_KILLED: 380 case base::TERMINATION_STATUS_PROCESS_WAS_KILLED:
381 #if defined(OS_CHROMEOS) 381 #if defined(OS_CHROMEOS)
382 case base::TERMINATION_STATUS_PROCESS_WAS_KILLED_BY_OOM: 382 case base::TERMINATION_STATUS_PROCESS_WAS_KILLED_BY_OOM:
383 #endif 383 #endif
384 termination_reason = "was killed"; 384 termination_reason = "was killed";
385 break; 385 break;
386 case base::TERMINATION_STATUS_PROCESS_CRASHED: 386 case base::TERMINATION_STATUS_PROCESS_CRASHED:
387 termination_reason = "crashed"; 387 termination_reason = "crashed";
388 break; 388 break;
389 case base::TERMINATION_STATUS_LAUNCH_FAILED:
390 termination_reason = "failed to launch";
391 break;
389 default: 392 default:
390 termination_reason = "unknown"; 393 termination_reason = "unknown";
391 break; 394 break;
392 } 395 }
393 return Status(kUnknownError, 396 return Status(kUnknownError,
394 "Chrome failed to start: " + termination_reason); 397 "Chrome failed to start: " + termination_reason);
395 } 398 }
396 if (!process.Terminate(0, true)) { 399 if (!process.Terminate(0, true)) {
397 int exit_code; 400 int exit_code;
398 if (base::GetTerminationStatus(process.Handle(), &exit_code) == 401 if (base::GetTerminationStatus(process.Handle(), &exit_code) ==
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 // Write empty "First Run" file, otherwise Chrome will wipe the default 845 // Write empty "First Run" file, otherwise Chrome will wipe the default
843 // profile that was written. 846 // profile that was written.
844 if (base::WriteFile( 847 if (base::WriteFile(
845 user_data_dir.Append(chrome::kFirstRunSentinel), "", 0) != 0) { 848 user_data_dir.Append(chrome::kFirstRunSentinel), "", 0) != 0) {
846 return Status(kUnknownError, "failed to write first run file"); 849 return Status(kUnknownError, "failed to write first run file");
847 } 850 }
848 return Status(kOk); 851 return Status(kOk);
849 } 852 }
850 853
851 } // namespace internal 854 } // namespace internal
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_renderer_data.cc ('k') | chromecast/browser/metrics/cast_stability_metrics_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698