git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20391 0039d316-1c4b-4281-b951-d872f2087c98
Esse commit está contido em:
tejasshah@google.com
2009-07-10 18:29:39 +00:00
commit 62480a4548
2 arquivos alterados com 16 adições e 4 exclusões
+10 -4
Ver Arquivo
@@ -33,8 +33,8 @@ extern int BrowserMain(const MainFunctionParams&);
const wchar_t kUnitTestShowWindows[] = L"show-windows";
// Delay for the time-out at which we stop the inner-message loop the first
// time.
// Default delay for the time-out at which we stop the
// inner-message loop the first time.
const int kInitialTimeoutInMS = 30000;
// Delay for sub-sequent time-outs once the initial time-out happened.
@@ -62,7 +62,8 @@ InProcessBrowserTest::InProcessBrowserTest()
show_window_(false),
dom_automation_enabled_(false),
single_process_(false),
original_single_process_(false) {
original_single_process_(false),
initial_timeout_(kInitialTimeoutInMS) {
}
void InProcessBrowserTest::SetUp() {
@@ -223,7 +224,7 @@ void InProcessBrowserTest::RunTestOnMainThreadLoop() {
// Start the timeout timer to prevent hangs.
MessageLoopForUI::current()->PostDelayedTask(FROM_HERE,
NewRunnableMethod(this, &InProcessBrowserTest::TimedOut),
kInitialTimeoutInMS);
initial_timeout_);
RunTestOnMainThread();
CleanUpOnMainThread();
@@ -258,3 +259,8 @@ void InProcessBrowserTest::TimedOut() {
MessageLoopForUI::current()->Quit();
}
void InProcessBrowserTest::SetInitialTimeoutInMS(int timeout_value) {
DCHECK_GT(timeout_value, 0);
initial_timeout_ = timeout_value;
}
+6
Ver Arquivo
@@ -74,6 +74,9 @@ class InProcessBrowserTest : public testing::Test {
// Invoked when a test is not finishing in a timely manner.
void TimedOut();
// Sets Initial Timeout value.
void SetInitialTimeoutInMS(int initial_timeout);
// Starts an HTTP server.
HTTPTestServer* StartHTTPServer();
@@ -118,6 +121,9 @@ class InProcessBrowserTest : public testing::Test {
// Saved to restore the value of RenderProcessHost::run_renderer_in_process.
bool original_single_process_;
// Initial timeout value in ms.
int initial_timeout_;
DISALLOW_COPY_AND_ASSIGN(InProcessBrowserTest);
};