| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_test_proxy.h" | 5 #include "components/test_runner/web_test_proxy.h" |
| 6 | 6 |
| 7 #include <cctype> | 7 #include <cctype> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 } | 450 } |
| 451 | 451 |
| 452 void WebTestProxyBase::ShowValidationMessage( | 452 void WebTestProxyBase::ShowValidationMessage( |
| 453 const base::string16& message, | 453 const base::string16& message, |
| 454 const base::string16& sub_message) { | 454 const base::string16& sub_message) { |
| 455 delegate_->PrintMessage("ValidationMessageClient: main-message=" + | 455 delegate_->PrintMessage("ValidationMessageClient: main-message=" + |
| 456 base::UTF16ToUTF8(message) + " sub-message=" + | 456 base::UTF16ToUTF8(message) + " sub-message=" + |
| 457 base::UTF16ToUTF8(sub_message) + "\n"); | 457 base::UTF16ToUTF8(sub_message) + "\n"); |
| 458 } | 458 } |
| 459 | 459 |
| 460 std::string WebTestProxyBase::CaptureTree(bool debug_render_tree) { | 460 std::string WebTestProxyBase::CaptureTree( |
| 461 bool debug_render_tree, |
| 462 bool dump_line_box_trees) { |
| 461 bool should_dump_custom_text = | 463 bool should_dump_custom_text = |
| 462 test_interfaces_->GetTestRunner()->shouldDumpAsCustomText(); | 464 test_interfaces_->GetTestRunner()->shouldDumpAsCustomText(); |
| 463 bool should_dump_as_text = | 465 bool should_dump_as_text = |
| 464 test_interfaces_->GetTestRunner()->shouldDumpAsText(); | 466 test_interfaces_->GetTestRunner()->shouldDumpAsText(); |
| 465 bool should_dump_as_markup = | 467 bool should_dump_as_markup = |
| 466 test_interfaces_->GetTestRunner()->shouldDumpAsMarkup(); | 468 test_interfaces_->GetTestRunner()->shouldDumpAsMarkup(); |
| 467 bool should_dump_as_printed = test_interfaces_->GetTestRunner()->isPrinting(); | 469 bool should_dump_as_printed = test_interfaces_->GetTestRunner()->isPrinting(); |
| 468 blink::WebFrame* frame = GetWebView()->mainFrame(); | 470 blink::WebFrame* frame = GetWebView()->mainFrame(); |
| 469 std::string data_utf8; | 471 std::string data_utf8; |
| 470 if (should_dump_custom_text) { | 472 if (should_dump_custom_text) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 483 data_utf8 = DumpFramesAsMarkup(frame, recursive); | 485 data_utf8 = DumpFramesAsMarkup(frame, recursive); |
| 484 } else { | 486 } else { |
| 485 bool recursive = test_interfaces_->GetTestRunner() | 487 bool recursive = test_interfaces_->GetTestRunner() |
| 486 ->shouldDumpChildFrameScrollPositions(); | 488 ->shouldDumpChildFrameScrollPositions(); |
| 487 blink::WebFrame::LayoutAsTextControls layout_text_behavior = | 489 blink::WebFrame::LayoutAsTextControls layout_text_behavior = |
| 488 blink::WebFrame::LayoutAsTextNormal; | 490 blink::WebFrame::LayoutAsTextNormal; |
| 489 if (should_dump_as_printed) | 491 if (should_dump_as_printed) |
| 490 layout_text_behavior |= blink::WebFrame::LayoutAsTextPrinting; | 492 layout_text_behavior |= blink::WebFrame::LayoutAsTextPrinting; |
| 491 if (debug_render_tree) | 493 if (debug_render_tree) |
| 492 layout_text_behavior |= blink::WebFrame::LayoutAsTextDebug; | 494 layout_text_behavior |= blink::WebFrame::LayoutAsTextDebug; |
| 495 if (dump_line_box_trees) |
| 496 layout_text_behavior |= blink::WebFrame::LayoutAsTextWithLineTrees; |
| 493 data_utf8 = frame->layoutTreeAsText(layout_text_behavior).utf8(); | 497 data_utf8 = frame->layoutTreeAsText(layout_text_behavior).utf8(); |
| 494 data_utf8 += DumpFrameScrollPosition(frame, recursive); | 498 data_utf8 += DumpFrameScrollPosition(frame, recursive); |
| 495 } | 499 } |
| 496 | 500 |
| 497 if (test_interfaces_->GetTestRunner()->ShouldDumpBackForwardList()) | 501 if (test_interfaces_->GetTestRunner()->ShouldDumpBackForwardList()) |
| 498 data_utf8 += DumpAllBackForwardLists(test_interfaces_, delegate_); | 502 data_utf8 += DumpAllBackForwardLists(test_interfaces_, delegate_); |
| 499 | 503 |
| 500 return data_utf8; | 504 return data_utf8; |
| 501 } | 505 } |
| 502 | 506 |
| (...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1396 // to cancel the input method's ongoing composition session. | 1400 // to cancel the input method's ongoing composition session. |
| 1397 if (web_widget_) | 1401 if (web_widget_) |
| 1398 web_widget_->confirmComposition(); | 1402 web_widget_->confirmComposition(); |
| 1399 } | 1403 } |
| 1400 | 1404 |
| 1401 blink::WebString WebTestProxyBase::acceptLanguages() { | 1405 blink::WebString WebTestProxyBase::acceptLanguages() { |
| 1402 return blink::WebString::fromUTF8(accept_languages_); | 1406 return blink::WebString::fromUTF8(accept_languages_); |
| 1403 } | 1407 } |
| 1404 | 1408 |
| 1405 } // namespace test_runner | 1409 } // namespace test_runner |
| OLD | NEW |