Commit 90b26104 authored by jochen@chromium.org's avatar jochen@chromium.org

[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
parent 3c102740
......@@ -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;
}
......
......@@ -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
......@@ -12,6 +12,7 @@ namespace switches {
extern const char kCheckLayoutTestSysDeps[];
extern const char kContentBrowserTest[];
extern const char kDumpRenderTree[];
extern const char kNoTimeout[];
} // namespace switches
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment