OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <fstream> | 5 #include <fstream> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/file_version_info.h" | 12 #include "base/file_version_info.h" |
13 #include "base/files/file_enumerator.h" | |
14 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
15 #include "base/i18n/time_formatting.h" | 14 #include "base/i18n/time_formatting.h" |
16 #include "base/logging.h" | 15 #include "base/logging.h" |
17 #include "base/path_service.h" | 16 #include "base/path_service.h" |
18 #include "base/rand_util.h" | 17 #include "base/rand_util.h" |
19 #include "base/string_util.h" | 18 #include "base/string_util.h" |
20 #include "base/stringprintf.h" | 19 #include "base/stringprintf.h" |
21 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
22 #include "base/strings/string_split.h" | 21 #include "base/strings/string_split.h" |
23 #include "base/threading/platform_thread.h" | 22 #include "base/threading/platform_thread.h" |
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 } | 764 } |
766 | 765 |
767 base::FilePath AutomatedUITest::GetMostRecentCrashDump() { | 766 base::FilePath AutomatedUITest::GetMostRecentCrashDump() { |
768 base::FilePath crash_dump_path; | 767 base::FilePath crash_dump_path; |
769 base::FilePath most_recent_file_name; | 768 base::FilePath most_recent_file_name; |
770 PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dump_path); | 769 PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dump_path); |
771 base::Time most_recent_file_time; | 770 base::Time most_recent_file_time; |
772 | 771 |
773 bool first_file = true; | 772 bool first_file = true; |
774 | 773 |
775 base::FileEnumerator enumerator(crash_dump_path, | 774 file_util::FileEnumerator enumerator(crash_dump_path, |
776 false, // not recursive | 775 false, // not recursive |
777 base::FileEnumerator::FILES); | 776 file_util::FileEnumerator::FILES); |
778 for (base::FilePath path = enumerator.Next(); !path.value().empty(); | 777 for (base::FilePath path = enumerator.Next(); !path.value().empty(); |
779 path = enumerator.Next()) { | 778 path = enumerator.Next()) { |
780 base::PlatformFileInfo file_info; | 779 base::PlatformFileInfo file_info; |
781 file_util::GetFileInfo(path, &file_info); | 780 file_util::GetFileInfo(path, &file_info); |
782 if (first_file) { | 781 if (first_file) { |
783 most_recent_file_time = file_info.last_modified; | 782 most_recent_file_time = file_info.last_modified; |
784 most_recent_file_name = path.BaseName(); | 783 most_recent_file_name = path.BaseName(); |
785 first_file = false; | 784 first_file = false; |
786 } else if (file_info.last_modified >= most_recent_file_time) { | 785 } else if (file_info.last_modified >= most_recent_file_time) { |
787 most_recent_file_time = file_info.last_modified; | 786 most_recent_file_time = file_info.last_modified; |
(...skipping 22 matching lines...) Expand all Loading... |
810 } | 809 } |
811 } | 810 } |
812 | 811 |
813 TEST_F(AutomatedUITest, TheOneAndOnlyTest) { | 812 TEST_F(AutomatedUITest, TheOneAndOnlyTest) { |
814 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 813 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
815 if (parsed_command_line.HasSwitch(kReproSwitch)) | 814 if (parsed_command_line.HasSwitch(kReproSwitch)) |
816 RunReproduction(); | 815 RunReproduction(); |
817 else | 816 else |
818 RunAutomatedUITest(); | 817 RunAutomatedUITest(); |
819 } | 818 } |
OLD | NEW |