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

Side by Side Diff: page_load_test.cc

Issue 10391175: Add alternative path for breakpad dump location. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/chrome/test/reliability/
Patch Set: Created 8 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
« 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) 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 // This file provides reliablity test which runs under UI test framework. The 5 // This file provides reliablity test which runs under UI test framework. The
6 // test is intended to run within QEMU environment. 6 // test is intended to run within QEMU environment.
7 // 7 //
8 // Usage 1: reliability_test 8 // Usage 1: reliability_test
9 // Upon invocation, it visits a hard coded list of sample URLs. This is mainly 9 // Upon invocation, it visits a hard coded list of sample URLs. This is mainly
10 // used by buildbot, to verify reliability_test itself runs ok. 10 // used by buildbot, to verify reliability_test itself runs ok.
(...skipping 18 matching lines...) Expand all
29 // --endurl=url: visits the specified url in the end. 29 // --endurl=url: visits the specified url in the end.
30 // --logfile=filepath: saves the visit log to the specified path. 30 // --logfile=filepath: saves the visit log to the specified path.
31 // --nopagedown: won't simulate page down key presses after page load. 31 // --nopagedown: won't simulate page down key presses after page load.
32 // --noclearprofile: do not clear profile dir before firing up each time. 32 // --noclearprofile: do not clear profile dir before firing up each time.
33 // --savedebuglog: save Chrome, V8, and test debug log for each page loaded. 33 // --savedebuglog: save Chrome, V8, and test debug log for each page loaded.
34 34
35 #include <fstream> 35 #include <fstream>
36 #include <vector> 36 #include <vector>
37 37
38 #include "base/command_line.h" 38 #include "base/command_line.h"
39 #include "base/environment.h"
39 #include "base/file_path.h" 40 #include "base/file_path.h"
40 #include "base/file_util.h" 41 #include "base/file_util.h"
41 #include "base/file_version_info.h" 42 #include "base/file_version_info.h"
42 #include "base/i18n/time_formatting.h" 43 #include "base/i18n/time_formatting.h"
44 #include "base/memory/scoped_ptr.h"
43 #include "base/path_service.h" 45 #include "base/path_service.h"
44 #include "base/string_number_conversions.h" 46 #include "base/string_number_conversions.h"
45 #include "base/string_util.h" 47 #include "base/string_util.h"
46 #include "base/test/test_file_util.h" 48 #include "base/test/test_file_util.h"
47 #include "base/threading/platform_thread.h" 49 #include "base/threading/platform_thread.h"
48 #include "base/time.h" 50 #include "base/time.h"
49 #include "chrome/browser/net/url_fixer_upper.h" 51 #include "chrome/browser/net/url_fixer_upper.h"
50 #include "chrome/browser/prefs/pref_service.h" 52 #include "chrome/browser/prefs/pref_service.h"
51 #include "chrome/browser/prefs/pref_service_mock_builder.h" 53 #include "chrome/browser/prefs/pref_service_mock_builder.h"
52 #include "chrome/common/automation_messages.h" 54 #include "chrome/common/automation_messages.h"
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 626
625 protected: 627 protected:
626 // Call the base class's SetUp method and initialize our own class members. 628 // Call the base class's SetUp method and initialize our own class members.
627 virtual void SetUp() { 629 virtual void SetUp() {
628 // Set UI Test members before setting up browser. 630 // Set UI Test members before setting up browser.
629 clear_profile_ = g_clear_profile; 631 clear_profile_ = g_clear_profile;
630 632
631 UITest::SetUp(); 633 UITest::SetUp();
632 g_browser_existing = true; 634 g_browser_existing = true;
633 635
634 // Initialize crash_dumps_dir_path_. 636 // If 'BREAKPAD_DUMP_LOCATION' environment variable is set, use it instead.
635 PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dumps_dir_path_); 637 scoped_ptr<base::Environment> env(base::Environment::Create());
638 std::string alternate_minidump_location;
639 if (env->GetVar("BREAKPAD_DUMP_LOCATION", &alternate_minidump_location)) {
640 crash_dumps_dir_path_ = FilePath::FromUTF8Unsafe(
641 alternate_minidump_location);
642 } else {
643 PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dumps_dir_path_);
Paweł Hajdan Jr. 2012/05/17 14:54:45 Wait, shouldn't you modify the PathService code fo
chrisphan1 2012/05/17 18:18:55 DIR_CRASH_DUMPS gets modified in the breakpad at t
Paweł Hajdan Jr. 2012/05/21 08:30:57 Could you explain more? I suggested modifying Path
644 }
645
636 file_util::FileEnumerator enumerator(crash_dumps_dir_path_, 646 file_util::FileEnumerator enumerator(crash_dumps_dir_path_,
637 false, // not recursive 647 false, // not recursive
638 file_util::FileEnumerator::FILES); 648 file_util::FileEnumerator::FILES);
639 for (FilePath path = enumerator.Next(); !path.value().empty(); 649 for (FilePath path = enumerator.Next(); !path.value().empty();
640 path = enumerator.Next()) { 650 path = enumerator.Next()) {
641 if (path.MatchesExtension(FILE_PATH_LITERAL(".dmp"))) 651 if (path.MatchesExtension(FILE_PATH_LITERAL(".dmp")))
642 crash_dumps_[path.BaseName()] = true; 652 crash_dumps_[path.BaseName()] = true;
643 } 653 }
644 } 654 }
645 655
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 if (!g_end_url.empty()) { 812 if (!g_end_url.empty()) {
803 NavigateToURLLogResult( 813 NavigateToURLLogResult(
804 g_end_url, log_file, NULL, g_continuous_load, false); 814 g_end_url, log_file, NULL, g_continuous_load, false);
805 } 815 }
806 816
807 log_file.close(); 817 log_file.close();
808 } 818 }
809 819
810 } // namespace 820 } // namespace
811 821
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