diff options
Diffstat (limited to 'content')
-rw-r--r-- | content/shell/layout_test_controller_host.cc | 16 | ||||
-rw-r--r-- | content/shell/shell_switches.cc | 3 | ||||
-rw-r--r-- | content/shell/shell_switches.h | 1 |
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 |