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

Unified Diff: content/public/test/test_launcher.cc

Issue 10855231: Make content_browsertests support restarts across a test. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Allow _CRASH suffix Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/test/test_launcher.h ('k') | content/shell/shell_browser_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/test_launcher.cc
===================================================================
--- content/public/test/test_launcher.cc (revision 152131)
+++ content/public/test/test_launcher.cc (working copy)
@@ -61,6 +61,10 @@
// add a new binary that must be compiled on all builds.
const char kManualTestPrefix[] = "MANUAL_";
+// Tests with this suffix are expected to crash, so it won't count as a failure.
+// A test that uses this must have a PRE_ prefix.
+const char kCrashTestSuffix[] = "_CRASH";
+
TestLauncherDelegate* g_launcher_delegate;
}
@@ -331,8 +335,10 @@
if (cur_test_name == pre_test_name) {
int exit_code = RunTestInternal(test_case, pre_test_name, command_line,
default_timeout, was_timeout);
- if (exit_code != 0)
+ if (exit_code != 0 &&
+ !EndsWith(pre_test_name, kCrashTestSuffix, true)) {
return exit_code;
+ }
}
}
}
@@ -440,9 +446,18 @@
// failure status back to the parent.
new_cmd_line.AppendSwitch(base::TestSuite::kStrictFailureHandling);
- if (!launcher_delegate->AdjustChildProcessCommandLine(&new_cmd_line))
+ ScopedTempDir temp_dir;
+ // Create a new data dir and pass it to the child.
+ if (!temp_dir.CreateUniqueTempDir() || !temp_dir.IsValid()) {
+ LOG(ERROR) << "Error creating temp data directory";
return -1;
+ }
+ if (!launcher_delegate->AdjustChildProcessCommandLine(&new_cmd_line,
+ temp_dir.path())) {
+ return -1;
+ }
+
return RunTestInternal(
test_case, test_name, &new_cmd_line, default_timeout, was_timeout);
}
« no previous file with comments | « content/public/test/test_launcher.h ('k') | content/shell/shell_browser_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698