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

Unified Diff: chrome/test/out_of_proc_test_runner.cc

Issue 5141001: Add a PDF test to load all the pdfs in a test directory, using the test serve... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix race condition Created 10 years, 1 month 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 | « chrome/chrome_tests.gypi ('k') | chrome/test/plugin/pdf_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/out_of_proc_test_runner.cc
===================================================================
--- chrome/test/out_of_proc_test_runner.cc (revision 66374)
+++ chrome/test/out_of_proc_test_runner.cc (working copy)
@@ -7,6 +7,7 @@
#include "base/command_line.h"
#include "base/file_util.h"
+#include "base/hash_tables.h"
#include "base/linked_ptr.h"
#include "base/logging.h"
#include "base/mac/scoped_nsautorelease_pool.h"
@@ -36,6 +37,12 @@
typedef int (*DLL_MAIN)(HINSTANCE, sandbox::SandboxInterfaceInfo*, wchar_t*);
#endif // defined(OS_WIN)
+// Allows a specific test to increase its timeout. This should be used very
+// sparingly, i.e. when a "test" is a really a collection of sub tests and it's
+// not possible to break them up. An example is PDFBrowserTest.Loading, which
+// loads all the files it can find in a directory.
+base::hash_map<std::string, int> g_test_timeout_overrides;
+
namespace {
const char kGTestFilterFlag[] = "gtest_filter";
@@ -57,7 +64,7 @@
// How long we wait for the subprocess to exit (with a success/failure code).
// See http://crbug.com/43862 for some discussion of the value.
-const int64 kDefaultTestTimeoutMs = 20000;
+const int kDefaultTestTimeoutMs = 20000;
// The default output file for XML output.
static const FilePath::CharType kDefaultOutputFile[] = FILE_PATH_LITERAL(
@@ -300,6 +307,8 @@
#endif
int test_terminate_timeout_ms = kDefaultTestTimeoutMs;
+ if (g_test_timeout_overrides.count(test_name))
+ test_terminate_timeout_ms = g_test_timeout_overrides[test_name];
if (cmd_line->HasSwitch(kTestTerminateTimeoutFlag)) {
std::string timeout_str =
cmd_line->GetSwitchValueASCII(kTestTerminateTimeoutFlag);
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/plugin/pdf_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698