summaryrefslogtreecommitdiffstats
path: root/chrome/test/reliability
diff options
context:
space:
mode:
authorchrisphan@chromium.org <chrisphan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-02 18:00:43 +0000
committerchrisphan@chromium.org <chrisphan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-02 18:00:43 +0000
commitb49c2a5e16548b62d1f31a5a8290f23ce77b4a3c (patch)
treed817484e58a6f5342e8d771e4d4c27a0138e2ad8 /chrome/test/reliability
parent5a593d25e0875cae1c5889118489d48db63b1fdc (diff)
downloadchromium_src-b49c2a5e16548b62d1f31a5a8290f23ce77b4a3c.zip
chromium_src-b49c2a5e16548b62d1f31a5a8290f23ce77b4a3c.tar.gz
chromium_src-b49c2a5e16548b62d1f31a5a8290f23ce77b4a3c.tar.bz2
Add support for running multiple browser instances with reliability tests.
Originally, crash_service.exe dumps all encountered crash dump files into a single directory. But if multiple browser instances are running, we want to identify which crash belongs to which browser instance. - Add a flag to crash service to archive the generated crash dumps under directory by the browser process id. - Add a flag to page_load_tests to look for crashes under the directory by the process id. For example: %USERPROFILE%\AppData\Local\Google\CrashReports\pid\3f4233fhs.dmp NOTRY=true Review URL: https://chromiumcodereview.appspot.com/10836347 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165702 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/reliability')
-rw-r--r--chrome/test/reliability/page_load_test.cc35
1 files changed, 27 insertions, 8 deletions
diff --git a/chrome/test/reliability/page_load_test.cc b/chrome/test/reliability/page_load_test.cc
index 9e3909d..fcca1c8 100644
--- a/chrome/test/reliability/page_load_test.cc
+++ b/chrome/test/reliability/page_load_test.cc
@@ -31,6 +31,8 @@
// --nopagedown: won't simulate page down key presses after page load.
// --noclearprofile: do not clear profile dir before firing up each time.
// --savedebuglog: save Chrome, V8, and test debug log for each page loaded.
+// --searchdumpsbypid: Look for crash dumps by browser process id.
+// "crash_dir/pid/"
#include <fstream>
#include <vector>
@@ -65,6 +67,7 @@
#include "chrome/test/automation/browser_proxy.h"
#include "chrome/test/automation/tab_proxy.h"
#include "chrome/test/automation/window_proxy.h"
+#include "chrome/test/base/chrome_process_util.h"
#include "chrome/test/ui/ui_test.h"
#include "net/base/net_util.h"
#include "ui/base/keycodes/keyboard_codes.h"
@@ -89,6 +92,7 @@ const char kNoClearProfileSwitch[] = "noclearprofile";
const char kSaveDebugLogSwitch[] = "savedebuglog";
const char kStressOptSwitch[] = "stress-opt";
const char kStressDeoptSwitch[] = "stress-deopt";
+const char kSearchDumpsByPid[] = "search-dumps-by-pid";
const char kDefaultServerUrl[] = "http://urllist.com";
std::string g_server_url;
@@ -123,6 +127,7 @@ FilePath g_test_log_path;
bool g_stand_alone = false;
bool g_stress_opt = false;
bool g_stress_deopt = false;
+bool g_search_dumps_by_pid = false;
void ReportHandler(const std::string& str) {
// Ignore report events.
@@ -224,12 +229,14 @@ void SetPageRange(const CommandLine& parsed_command_line) {
}
}
- if (parsed_command_line.HasSwitch(kStressOptSwitch)) {
+ if (parsed_command_line.HasSwitch(kStressOptSwitch))
g_stress_opt = true;
- }
- if (parsed_command_line.HasSwitch(kStressDeoptSwitch)) {
+
+ if (parsed_command_line.HasSwitch(kStressDeoptSwitch))
g_stress_deopt = true;
- }
+
+ if (parsed_command_line.HasSwitch(kSearchDumpsByPid))
+ g_search_dumps_by_pid = true;
}
class PageLoadTest : public UITest {
@@ -323,6 +330,16 @@ class PageLoadTest : public UITest {
test_log << "browser_launched_seconds=";
test_log << (time_now.ToDoubleT() - time_start) << std::endl;
+ // Create crash dump directory with pid.
+ if (g_search_dumps_by_pid) {
+ actual_crash_dumps_dir_path_ = FilePath(crash_dumps_dir_path_);
+ ChromeProcessList processes =
+ GetRunningChromeProcesses(browser_process_id());
+ if (!processes.empty())
+ actual_crash_dumps_dir_path_ = actual_crash_dumps_dir_path_.Append(
+ base::Int64ToString16(*processes.begin()));
+ }
+
int result = AUTOMATION_MSG_NAVIGATION_ERROR;
// This is essentially what NavigateToURL does except we don't fire
// assertion when page loading fails. We log the result instead.
@@ -693,7 +710,7 @@ class PageLoadTest : public UITest {
}
bool HasNewCrashDumps() {
- file_util::FileEnumerator enumerator(crash_dumps_dir_path_,
+ file_util::FileEnumerator enumerator(actual_crash_dumps_dir_path_,
false, // not recursive
file_util::FileEnumerator::FILES);
for (FilePath path = enumerator.Next(); !path.value().empty();
@@ -713,8 +730,7 @@ class PageLoadTest : public UITest {
NavigationMetrics* metrics,
bool delete_dumps) {
int num_dumps = 0;
-
- file_util::FileEnumerator enumerator(crash_dumps_dir_path_,
+ file_util::FileEnumerator enumerator(actual_crash_dumps_dir_path_,
false, // not recursive
file_util::FileEnumerator::FILES);
for (FilePath path = enumerator.Next(); !path.value().empty();
@@ -722,7 +738,7 @@ class PageLoadTest : public UITest {
if (path.MatchesExtension(FILE_PATH_LITERAL(".dmp")) &&
!crash_dumps_[path.BaseName()]) {
crash_dumps_[path.BaseName()] = true;
- FilePath crash_dump_file_path(crash_dumps_dir_path_);
+ FilePath crash_dump_file_path(actual_crash_dumps_dir_path_);
crash_dump_file_path = crash_dump_file_path.Append(path.BaseName());
new_crash_dumps.push_back(crash_dump_file_path);
if (delete_dumps)
@@ -782,6 +798,9 @@ class PageLoadTest : public UITest {
// The pathname of Chrome's crash dumps directory.
FilePath crash_dumps_dir_path_;
+ // The actual crash dumps directory that will be used.
+ FilePath actual_crash_dumps_dir_path_;
+
// The set of all the crash dumps we have seen. Each crash generates a
// .dmp and a .txt file in the crash dumps directory. We only store the
// .dmp files in this set.