| 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/layout_dump.h" | 5 #include "components/test_runner/layout_dump.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "third_party/WebKit/public/platform/WebSize.h" | 9 #include "third_party/WebKit/public/platform/WebSize.h" |
| 10 #include "third_party/WebKit/public/platform/WebString.h" | 10 #include "third_party/WebKit/public/platform/WebString.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 DCHECK(!flags.is_printing); | 71 DCHECK(!flags.is_printing); |
| 72 result = DumpFrameHeaderIfNeeded(frame); | 72 result = DumpFrameHeaderIfNeeded(frame); |
| 73 result += WebFrameContentDumper::dumpAsMarkup(frame).utf8(); | 73 result += WebFrameContentDumper::dumpAsMarkup(frame).utf8(); |
| 74 result += "\n"; | 74 result += "\n"; |
| 75 } else { | 75 } else { |
| 76 if (frame->parent() == nullptr) { | 76 if (frame->parent() == nullptr) { |
| 77 WebFrameContentDumper::LayoutAsTextControls layout_text_behavior = | 77 WebFrameContentDumper::LayoutAsTextControls layout_text_behavior = |
| 78 WebFrameContentDumper::LayoutAsTextNormal; | 78 WebFrameContentDumper::LayoutAsTextNormal; |
| 79 if (flags.is_printing) | 79 if (flags.is_printing) |
| 80 layout_text_behavior |= WebFrameContentDumper::LayoutAsTextPrinting; | 80 layout_text_behavior |= WebFrameContentDumper::LayoutAsTextPrinting; |
| 81 if (flags.debug_render_tree) | |
| 82 layout_text_behavior |= WebFrameContentDumper::LayoutAsTextDebug; | |
| 83 if (flags.dump_line_box_trees) | |
| 84 layout_text_behavior |= | |
| 85 WebFrameContentDumper::LayoutAsTextWithLineTrees; | |
| 86 result = WebFrameContentDumper::dumpLayoutTreeAsText(frame, | 81 result = WebFrameContentDumper::dumpLayoutTreeAsText(frame, |
| 87 layout_text_behavior) | 82 layout_text_behavior) |
| 88 .utf8(); | 83 .utf8(); |
| 89 } | 84 } |
| 90 result += DumpFrameScrollPosition(frame); | 85 result += DumpFrameScrollPosition(frame); |
| 91 } | 86 } |
| 92 | 87 |
| 93 return result; | 88 return result; |
| 94 } | 89 } |
| 95 | 90 |
| 96 } // namespace test_runner | 91 } // namespace test_runner |
| OLD | NEW |