summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-17 20:08:57 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-17 20:08:57 +0000
commit90b261041cb60c6d7d534451496f866d120d10c0 (patch)
treef829eb00e255249ce3795257e053653a499a0d66 /content
parent3c10274043357ce9513962ae463f44250779899e (diff)
downloadchromium_src-90b261041cb60c6d7d534451496f866d120d10c0.zip
chromium_src-90b261041cb60c6d7d534451496f866d120d10c0.tar.gz
chromium_src-90b261041cb60c6d7d534451496f866d120d10c0.tar.bz2
[content shell] add --no-timeout option
BUG=111316 TEST=none Review URL: https://chromiumcodereview.appspot.com/10825419 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152142 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/shell/layout_test_controller_host.cc16
-rw-r--r--content/shell/shell_switches.cc3
-rw-r--r--content/shell/shell_switches.h1
3 files changed, 14 insertions, 6 deletions
diff --git a/content/shell/layout_test_controller_host.cc b/content/shell/layout_test_controller_host.cc
index 88ab176..92a912f 100644
--- a/content/shell/layout_test_controller_host.cc
+++ b/content/shell/layout_test_controller_host.cc
@@ -4,9 +4,11 @@
#include "content/shell/layout_test_controller_host.h"
+#include "base/command_line.h"
#include "base/message_loop.h"
#include "content/public/browser/render_view_host.h"
#include "content/shell/shell_messages.h"
+#include "content/shell/shell_switches.h"
#include "webkit/support/webkit_support_gfx.h"
namespace content {
@@ -184,12 +186,14 @@ void LayoutTestControllerHost::OnDumpChildFramesAsText() {
void LayoutTestControllerHost::OnWaitUntilDone() {
if (wait_until_done_)
return;
- watchdog_.Reset(base::Bind(&LayoutTestControllerHost::TimeoutHandler,
- base::Unretained(this)));
- MessageLoop::current()->PostDelayedTask(
- FROM_HERE,
- watchdog_.callback(),
- base::TimeDelta::FromMilliseconds(kTestTimeoutMilliseconds));
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoTimeout)) {
+ watchdog_.Reset(base::Bind(&LayoutTestControllerHost::TimeoutHandler,
+ base::Unretained(this)));
+ MessageLoop::current()->PostDelayedTask(
+ FROM_HERE,
+ watchdog_.callback(),
+ base::TimeDelta::FromMilliseconds(kTestTimeoutMilliseconds));
+ }
wait_until_done_ = true;
}
diff --git a/content/shell/shell_switches.cc b/content/shell/shell_switches.cc
index e3cffb3..07daec5 100644
--- a/content/shell/shell_switches.cc
+++ b/content/shell/shell_switches.cc
@@ -15,4 +15,7 @@ const char kContentBrowserTest[] = "browser-test";
// Request pages to be dumped as text once they finished loading.
const char kDumpRenderTree[] = "dump-render-tree";
+// Disables the timeout for layout tests.
+const char kNoTimeout[] = "no-timeout";
+
} // namespace switches
diff --git a/content/shell/shell_switches.h b/content/shell/shell_switches.h
index 342cedd..cbc2860 100644
--- a/content/shell/shell_switches.h
+++ b/content/shell/shell_switches.h
@@ -12,6 +12,7 @@ namespace switches {
extern const char kCheckLayoutTestSysDeps[];
extern const char kContentBrowserTest[];
extern const char kDumpRenderTree[];
+extern const char kNoTimeout[];
} // namespace switches