| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/test_runner/web_frame_test_client.h" | 5 #include "components/test_runner/web_frame_test_client.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 case blink::WebConsoleMessage::LevelWarning: | 681 case blink::WebConsoleMessage::LevelWarning: |
| 682 level = "WARNING"; | 682 level = "WARNING"; |
| 683 break; | 683 break; |
| 684 case blink::WebConsoleMessage::LevelError: | 684 case blink::WebConsoleMessage::LevelError: |
| 685 level = "ERROR"; | 685 level = "ERROR"; |
| 686 break; | 686 break; |
| 687 default: | 687 default: |
| 688 level = "MESSAGE"; | 688 level = "MESSAGE"; |
| 689 } | 689 } |
| 690 delegate_->PrintMessage(std::string("CONSOLE ") + level + ": "); | 690 delegate_->PrintMessage(std::string("CONSOLE ") + level + ": "); |
| 691 if (source_line) { | 691 if (source_line && test_runner_->shouldDumpConsoleLineNumbers()) { |
| 692 delegate_->PrintMessage(base::StringPrintf("line %d: ", source_line)); | 692 delegate_->PrintMessage(base::StringPrintf("line %d: ", source_line)); |
| 693 } | 693 } |
| 694 if (!message.text.isEmpty()) { | 694 if (!message.text.isEmpty()) { |
| 695 std::string new_message; | 695 std::string new_message; |
| 696 new_message = message.text.utf8(); | 696 new_message = message.text.utf8(); |
| 697 size_t file_protocol = new_message.find("file://"); | 697 size_t file_protocol = new_message.find("file://"); |
| 698 if (file_protocol != std::string::npos) { | 698 if (file_protocol != std::string::npos) { |
| 699 new_message = new_message.substr(0, file_protocol) + | 699 new_message = new_message.substr(0, file_protocol) + |
| 700 URLSuitableForTestResult(new_message.substr(file_protocol)); | 700 URLSuitableForTestResult(new_message.substr(file_protocol)); |
| 701 } | 701 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 | 755 |
| 756 bool WebFrameTestClient::runFileChooser( | 756 bool WebFrameTestClient::runFileChooser( |
| 757 const blink::WebFileChooserParams& params, | 757 const blink::WebFileChooserParams& params, |
| 758 blink::WebFileChooserCompletion* completion) { | 758 blink::WebFileChooserCompletion* completion) { |
| 759 delegate_->PrintMessage("Mock: Opening a file chooser.\n"); | 759 delegate_->PrintMessage("Mock: Opening a file chooser.\n"); |
| 760 // FIXME: Add ability to set file names to a file upload control. | 760 // FIXME: Add ability to set file names to a file upload control. |
| 761 return false; | 761 return false; |
| 762 } | 762 } |
| 763 | 763 |
| 764 } // namespace test_runner | 764 } // namespace test_runner |
| OLD | NEW |