| Index: components/test_runner/web_frame_test_client.cc
|
| diff --git a/components/test_runner/web_frame_test_client.cc b/components/test_runner/web_frame_test_client.cc
|
| index 11a8edae86f9ede7b05a9b0192646d2aa5d403b6..2dcaee2027f1f9f49d72e9896712e730fa6f249f 100644
|
| --- a/components/test_runner/web_frame_test_client.cc
|
| +++ b/components/test_runner/web_frame_test_client.cc
|
| @@ -8,6 +8,7 @@
|
|
|
| #include "base/logging.h"
|
| #include "base/strings/string_piece.h"
|
| +#include "base/strings/string_split.h"
|
| #include "base/strings/string_util.h"
|
| #include "base/strings/stringprintf.h"
|
| #include "components/test_runner/accessibility_controller.h"
|
| @@ -648,9 +649,9 @@ void WebFrameTestClient::didAddMessageToConsole(
|
| default:
|
| level = "MESSAGE";
|
| }
|
| - delegate_->PrintMessage(std::string("CONSOLE ") + level + ": ");
|
| + std::string prefix(std::string("CONSOLE ") + level + ": ");
|
| if (source_line) {
|
| - delegate_->PrintMessage(base::StringPrintf("line %d: ", source_line));
|
| + prefix += base::StringPrintf("line %d: ", source_line);
|
| }
|
| if (!message.text.isEmpty()) {
|
| std::string new_message;
|
| @@ -660,9 +661,15 @@ void WebFrameTestClient::didAddMessageToConsole(
|
| new_message = new_message.substr(0, file_protocol) +
|
| URLSuitableForTestResult(new_message.substr(file_protocol));
|
| }
|
| - delegate_->PrintMessage(new_message);
|
| + for (auto s : base::SplitStringPieceUsingSubstr(
|
| + new_message, "\n", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL)) {
|
| + delegate_->PrintMessage(prefix);
|
| + delegate_->PrintMessage(s.as_string());
|
| + delegate_->PrintMessage(std::string("\n"));
|
| + }
|
| + } else {
|
| + delegate_->PrintMessage(prefix + "\n");
|
| }
|
| - delegate_->PrintMessage(std::string("\n"));
|
| }
|
|
|
| blink::WebNavigationPolicy WebFrameTestClient::decidePolicyForNavigation(
|
|
|