summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorloislo@chromium.org <loislo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-16 15:11:31 +0000
committerloislo@chromium.org <loislo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-16 15:11:31 +0000
commit309e93a603ba642540377138310601cb3d5be769 (patch)
treeb442e8ebdea12882cbd8478132ed6415ba762274
parenta952dfb7456556a7b44eced0325c8271b5002135 (diff)
downloadchromium_src-309e93a603ba642540377138310601cb3d5be769.zip
chromium_src-309e93a603ba642540377138310601cb3d5be769.tar.gz
chromium_src-309e93a603ba642540377138310601cb3d5be769.tar.bz2
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
-rw-r--r--content/shell/renderer/test_runner/test_runner.cc6
1 files changed, 6 insertions, 0 deletions
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<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();