From 309e93a603ba642540377138310601cb3d5be769 Mon Sep 17 00:00:00 2001 From: "loislo@chromium.org" Date: Fri, 16 May 2014 15:11:31 +0000 Subject: 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 --- content/shell/renderer/test_runner/test_runner.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/content/shell/renderer/test_runner/test_runner.cc b/content/shell/renderer/test_runner/test_runner.cc index c76acd3..1a1b325 100644 --- a/content/shell/renderer/test_runner/test_runner.cc +++ b/content/shell/renderer/test_runner/test_runner.cc @@ -119,6 +119,7 @@ class TestRunnerBindings : public gin::Wrappable { 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::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(); -- cgit v1.1