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

Side by Side Diff: trunk/src/chrome/test/ui/ui_test.cc

Issue 14824006: Revert 198820 "Move FileEnumerator to its own file, do some refa..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
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 "chrome/test/ui/ui_test.h" 5 #include "chrome/test/ui/ui_test.h"
6 6
7 #if defined(OS_POSIX) 7 #if defined(OS_POSIX)
8 #include <signal.h> 8 #include <signal.h>
9 #include <sys/types.h> 9 #include <sys/types.h>
10 #endif 10 #endif
11 11
12 #include <set> 12 #include <set>
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/base_switches.h" 15 #include "base/base_switches.h"
16 #include "base/bind.h" 16 #include "base/bind.h"
17 #include "base/command_line.h" 17 #include "base/command_line.h"
18 #include "base/environment.h" 18 #include "base/environment.h"
19 #include "base/file_util.h" 19 #include "base/file_util.h"
20 #include "base/files/file_enumerator.h"
21 #include "base/files/file_path.h" 20 #include "base/files/file_path.h"
22 #include "base/files/scoped_temp_dir.h" 21 #include "base/files/scoped_temp_dir.h"
23 #include "base/json/json_file_value_serializer.h" 22 #include "base/json/json_file_value_serializer.h"
24 #include "base/logging.h" 23 #include "base/logging.h"
25 #include "base/memory/scoped_ptr.h" 24 #include "base/memory/scoped_ptr.h"
26 #include "base/path_service.h" 25 #include "base/path_service.h"
27 #include "base/process_util.h" 26 #include "base/process_util.h"
28 #include "base/strings/string_number_conversions.h" 27 #include "base/strings/string_number_conversions.h"
29 #include "base/strings/string_split.h" 28 #include "base/strings/string_split.h"
30 #include "base/test/test_file_util.h" 29 #include "base/test/test_file_util.h"
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 } 440 }
442 441
443 return source_history_file; 442 return source_history_file;
444 } 443 }
445 444
446 int UITestBase::GetCrashCount() const { 445 int UITestBase::GetCrashCount() const {
447 base::FilePath crash_dump_path; 446 base::FilePath crash_dump_path;
448 PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dump_path); 447 PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dump_path);
449 448
450 int files_found = 0; 449 int files_found = 0;
451 base::FileEnumerator en(crash_dump_path, false, base::FileEnumerator::FILES); 450 file_util::FileEnumerator en(crash_dump_path, false,
451 file_util::FileEnumerator::FILES);
452 while (!en.Next().empty()) { 452 while (!en.Next().empty()) {
453 if (en.GetInfo().GetLastModifiedTime() > test_start_time_) 453 file_util::FileEnumerator::FindInfo info;
454 if (file_util::FileEnumerator::GetLastModifiedTime(info) > test_start_time_)
454 files_found++; 455 files_found++;
455 } 456 }
456 457
457 #if defined(OS_WIN) 458 #if defined(OS_WIN)
458 // Each crash creates two dump files on Windows. 459 // Each crash creates two dump files on Windows.
459 return files_found / 2; 460 return files_found / 2;
460 #else 461 #else
461 return files_found; 462 return files_found;
462 #endif 463 #endif
463 } 464 }
464 465
465 std::string UITestBase::CheckErrorsAndCrashes() const { 466 std::string UITestBase::CheckErrorsAndCrashes() const {
466 // Make sure that we didn't encounter any assertion failures 467 // Make sure that we didn't encounter any assertion failures
467 logging::AssertionList assertions; 468 logging::AssertionList assertions;
468 logging::GetFatalAssertions(&assertions); 469 logging::GetFatalAssertions(&assertions);
469 470
470 // If there were errors, get all the error strings for display. 471 // If there were errors, get all the error strings for display.
471 std::wstring failures = 472 std::wstring failures =
472 L"The following error(s) occurred in the application during this test:"; 473 L"The following error(s) occurred in the application during this test:";
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 ASSERT_TRUE(session_end_completed); 715 ASSERT_TRUE(session_end_completed);
715 716
716 // Make sure session restore says we didn't crash. 717 // Make sure session restore says we didn't crash.
717 scoped_ptr<DictionaryValue> profile_prefs(GetDefaultProfilePreferences()); 718 scoped_ptr<DictionaryValue> profile_prefs(GetDefaultProfilePreferences());
718 ASSERT_TRUE(profile_prefs.get()); 719 ASSERT_TRUE(profile_prefs.get());
719 std::string exit_type; 720 std::string exit_type;
720 ASSERT_TRUE(profile_prefs->GetString(prefs::kSessionExitedCleanly, 721 ASSERT_TRUE(profile_prefs->GetString(prefs::kSessionExitedCleanly,
721 &exit_type)); 722 &exit_type));
722 EXPECT_EQ(ProfileImpl::kPrefExitTypeNormal, exit_type); 723 EXPECT_EQ(ProfileImpl::kPrefExitTypeNormal, exit_type);
723 } 724 }
OLDNEW
« no previous file with comments | « trunk/src/chrome/test/reliability/page_load_test.cc ('k') | trunk/src/chrome/test/webdriver/webdriver_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698