Commit 309e93a6 authored by loislo@chromium.org's avatar loislo@chromium.org

DevTools test harness: add logToStderr method on testRunner.

it is very hard to troubleshoot a flaky asynchronous DevTools test without
being able to log something directly to the console output.
With this patch DevTools window is able to do that. Also logging into
Error stream doesn't skew the normal test output so the flaky test
could be tested in a cycle until the first error.

BUG=

Review URL: https://codereview.chromium.org/288663003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271024 0039d316-1c4b-4281-b951-d872f2087c98
parent a952dfb7
......@@ -119,6 +119,7 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> {
virtual gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) OVERRIDE;
void LogToStderr(const std::string& output);
void NotifyDone();
void WaitUntilDone();
void QueueBackNavigation(int how_far_back);
......@@ -295,6 +296,7 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
return gin::Wrappable<TestRunnerBindings>::GetObjectTemplateBuilder(isolate)
// Methods controlling test execution.
.SetMethod("logToStderr", &TestRunnerBindings::LogToStderr)
.SetMethod("notifyDone", &TestRunnerBindings::NotifyDone)
.SetMethod("waitUntilDone", &TestRunnerBindings::WaitUntilDone)
.SetMethod("queueBackNavigation",
......@@ -528,6 +530,10 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder(
&TestRunnerBindings::DumpWindowStatusChanges);
}
void TestRunnerBindings::LogToStderr(const std::string& output) {
LOG(ERROR) << output;
}
void TestRunnerBindings::NotifyDone() {
if (runner_)
runner_->NotifyDone();
......
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