Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(757)

Side by Side Diff: components/test_runner/web_test_proxy.cc

Issue 1185563002: Add --dump-line-box-trees parameter to content_shell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 } 449 }
450 450
451 void WebTestProxyBase::ShowValidationMessage( 451 void WebTestProxyBase::ShowValidationMessage(
452 const base::string16& message, 452 const base::string16& message,
453 const base::string16& sub_message) { 453 const base::string16& sub_message) {
454 delegate_->PrintMessage("ValidationMessageClient: main-message=" + 454 delegate_->PrintMessage("ValidationMessageClient: main-message=" +
455 base::UTF16ToUTF8(message) + " sub-message=" + 455 base::UTF16ToUTF8(message) + " sub-message=" +
456 base::UTF16ToUTF8(sub_message) + "\n"); 456 base::UTF16ToUTF8(sub_message) + "\n");
457 } 457 }
458 458
459 std::string WebTestProxyBase::CaptureTree(bool debug_render_tree) { 459 std::string WebTestProxyBase::CaptureTree(
460 bool debug_render_tree,
461 bool dump_line_box_trees) {
460 bool should_dump_custom_text = 462 bool should_dump_custom_text =
461 test_interfaces_->GetTestRunner()->shouldDumpAsCustomText(); 463 test_interfaces_->GetTestRunner()->shouldDumpAsCustomText();
462 bool should_dump_as_text = 464 bool should_dump_as_text =
463 test_interfaces_->GetTestRunner()->shouldDumpAsText(); 465 test_interfaces_->GetTestRunner()->shouldDumpAsText();
464 bool should_dump_as_markup = 466 bool should_dump_as_markup =
465 test_interfaces_->GetTestRunner()->shouldDumpAsMarkup(); 467 test_interfaces_->GetTestRunner()->shouldDumpAsMarkup();
466 bool should_dump_as_printed = test_interfaces_->GetTestRunner()->isPrinting(); 468 bool should_dump_as_printed = test_interfaces_->GetTestRunner()->isPrinting();
467 blink::WebFrame* frame = GetWebView()->mainFrame(); 469 blink::WebFrame* frame = GetWebView()->mainFrame();
468 std::string data_utf8; 470 std::string data_utf8;
469 if (should_dump_custom_text) { 471 if (should_dump_custom_text) {
(...skipping 12 matching lines...) Expand all
482 data_utf8 = DumpFramesAsMarkup(frame, recursive); 484 data_utf8 = DumpFramesAsMarkup(frame, recursive);
483 } else { 485 } else {
484 bool recursive = test_interfaces_->GetTestRunner() 486 bool recursive = test_interfaces_->GetTestRunner()
485 ->shouldDumpChildFrameScrollPositions(); 487 ->shouldDumpChildFrameScrollPositions();
486 blink::WebFrame::LayoutAsTextControls layout_text_behavior = 488 blink::WebFrame::LayoutAsTextControls layout_text_behavior =
487 blink::WebFrame::LayoutAsTextNormal; 489 blink::WebFrame::LayoutAsTextNormal;
488 if (should_dump_as_printed) 490 if (should_dump_as_printed)
489 layout_text_behavior |= blink::WebFrame::LayoutAsTextPrinting; 491 layout_text_behavior |= blink::WebFrame::LayoutAsTextPrinting;
490 if (debug_render_tree) 492 if (debug_render_tree)
491 layout_text_behavior |= blink::WebFrame::LayoutAsTextDebug; 493 layout_text_behavior |= blink::WebFrame::LayoutAsTextDebug;
494 if (dump_line_box_trees)
495 layout_text_behavior |= blink::WebFrame::LayoutAsTextWithLineTrees;
492 data_utf8 = frame->layoutTreeAsText(layout_text_behavior).utf8(); 496 data_utf8 = frame->layoutTreeAsText(layout_text_behavior).utf8();
493 data_utf8 += DumpFrameScrollPosition(frame, recursive); 497 data_utf8 += DumpFrameScrollPosition(frame, recursive);
494 } 498 }
495 499
496 if (test_interfaces_->GetTestRunner()->ShouldDumpBackForwardList()) 500 if (test_interfaces_->GetTestRunner()->ShouldDumpBackForwardList())
497 data_utf8 += DumpAllBackForwardLists(test_interfaces_, delegate_); 501 data_utf8 += DumpAllBackForwardLists(test_interfaces_, delegate_);
498 502
499 return data_utf8; 503 return data_utf8;
500 } 504 }
501 505
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after
1397 // to cancel the input method's ongoing composition session. 1401 // to cancel the input method's ongoing composition session.
1398 if (web_widget_) 1402 if (web_widget_)
1399 web_widget_->confirmComposition(); 1403 web_widget_->confirmComposition();
1400 } 1404 }
1401 1405
1402 blink::WebString WebTestProxyBase::acceptLanguages() { 1406 blink::WebString WebTestProxyBase::acceptLanguages() {
1403 return blink::WebString::fromUTF8(accept_languages_); 1407 return blink::WebString::fromUTF8(accept_languages_);
1404 } 1408 }
1405 1409
1406 } // namespace test_runner 1410 } // namespace test_runner
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698