| 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 "config.h" | 5 #include "config.h" |
| 6 #include "platform/graphics/paint/DisplayItemList.h" | 6 #include "platform/graphics/paint/DisplayItemList.h" |
| 7 | 7 |
| 8 #include "core/layout/LayoutTestHelper.h" | 8 #include "core/layout/LayoutTestHelper.h" |
| 9 #include "core/layout/LayoutText.h" | 9 #include "core/layout/LayoutText.h" |
| 10 #include "core/layout/LayoutView.h" | 10 #include "core/layout/LayoutView.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 { | 50 { |
| 51 RuntimeEnabledFeatures::setSlimmingPaintEnabled(m_originalSlimmingPaintE
nabled); | 51 RuntimeEnabledFeatures::setSlimmingPaintEnabled(m_originalSlimmingPaintE
nabled); |
| 52 } | 52 } |
| 53 | 53 |
| 54 LayoutView* m_layoutView; | 54 LayoutView* m_layoutView; |
| 55 bool m_originalSlimmingPaintEnabled; | 55 bool m_originalSlimmingPaintEnabled; |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 class TestDisplayItem : public DisplayItem { | 58 class TestDisplayItem : public DisplayItem { |
| 59 public: | 59 public: |
| 60 TestDisplayItem(const DisplayItemClientWrapper& client, Type type) : Display
Item(client, type) { } | 60 TestDisplayItem(DisplayItemClientWrapper& client, Type type) |
| 61 { |
| 62 setClientAndType(client, type); |
| 63 } |
| 64 |
| 65 TestDisplayItem(LayoutObject& client, Type type) |
| 66 { |
| 67 DisplayItemClientWrapper clientWrapper(client); |
| 68 setClientAndType(clientWrapper, type); |
| 69 } |
| 70 |
| 71 TestDisplayItem(InlineBox& client, Type type) |
| 72 { |
| 73 DisplayItemClientWrapper clientWrapper(client); |
| 74 setClientAndType(clientWrapper, type); |
| 75 } |
| 61 | 76 |
| 62 virtual void replay(GraphicsContext&) override final { ASSERT_NOT_REACHED();
} | 77 virtual void replay(GraphicsContext&) override final { ASSERT_NOT_REACHED();
} |
| 63 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override
final { ASSERT_NOT_REACHED(); } | 78 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override
final { ASSERT_NOT_REACHED(); } |
| 64 }; | 79 }; |
| 65 | 80 |
| 66 #ifndef NDEBUG | 81 #ifndef NDEBUG |
| 67 #define TRACE_DISPLAY_ITEMS(i, expected, actual) \ | 82 #define TRACE_DISPLAY_ITEMS(i, expected, actual) \ |
| 68 String trace = String::format("%d: ", (int)i) + "Expected: " + (expected).as
DebugString() + " Actual: " + (actual).asDebugString(); \ | 83 String trace = String::format("%d: ", (int)i) + "Expected: " + (expected).as
DebugString() + " Actual: " + (actual).asDebugString(); \ |
| 69 SCOPED_TRACE(trace.utf8().data()); | 84 SCOPED_TRACE(trace.utf8().data()); |
| 70 #else | 85 #else |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 InlineTextBox& newFirstTextBox = *newText.firstTextBox(); | 165 InlineTextBox& newFirstTextBox = *newText.firstTextBox(); |
| 151 InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox(); | 166 InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox(); |
| 152 | 167 |
| 153 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 3, | 168 EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 3, |
| 154 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), | 169 TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground), |
| 155 TestDisplayItem(newFirstTextBox, DisplayItem::paintPhaseToDrawingType(Pa
intPhaseForeground)), | 170 TestDisplayItem(newFirstTextBox, DisplayItem::paintPhaseToDrawingType(Pa
intPhaseForeground)), |
| 156 TestDisplayItem(secondTextBox, DisplayItem::paintPhaseToDrawingType(Pain
tPhaseForeground))); | 171 TestDisplayItem(secondTextBox, DisplayItem::paintPhaseToDrawingType(Pain
tPhaseForeground))); |
| 157 } | 172 } |
| 158 | 173 |
| 159 } // namespace blink | 174 } // namespace blink |
| OLD | NEW |