OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef PaintControllerPaintTest_h | 5 #ifndef PaintControllerPaintTest_h |
6 #define PaintControllerPaintTest_h | 6 #define PaintControllerPaintTest_h |
7 | 7 |
8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
9 #include "core/layout/LayoutTestHelper.h" | 9 #include "core/layout/LayoutTestHelper.h" |
10 #include "core/layout/LayoutView.h" | 10 #include "core/layout/LayoutView.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 bool displayItemListContains(const DisplayItemList& displayItemList, Display
ItemClient& client, DisplayItem::Type type) | 69 bool displayItemListContains(const DisplayItemList& displayItemList, Display
ItemClient& client, DisplayItem::Type type) |
70 { | 70 { |
71 for (auto& item : displayItemList) { | 71 for (auto& item : displayItemList) { |
72 if (item.client() == client && item.getType() == type) | 72 if (item.client() == client && item.getType() == type) |
73 return true; | 73 return true; |
74 } | 74 } |
75 return false; | 75 return false; |
76 } | 76 } |
77 | 77 |
| 78 int numCachedNewItems() { return rootPaintController().m_numCachedNewItems;
} |
| 79 |
78 private: | 80 private: |
79 bool m_originalSlimmingPaintInvalidationEnabled; | 81 bool m_originalSlimmingPaintInvalidationEnabled; |
80 bool m_originalSlimmingPaintV2Enabled; | 82 bool m_originalSlimmingPaintV2Enabled; |
81 bool m_enableSlimmingPaintV2; | 83 bool m_enableSlimmingPaintV2; |
82 }; | 84 }; |
83 | 85 |
84 class PaintControllerPaintTest : public PaintControllerPaintTestBase { | 86 class PaintControllerPaintTest : public PaintControllerPaintTestBase { |
85 public: | 87 public: |
86 PaintControllerPaintTest() : PaintControllerPaintTestBase(false) { } | 88 PaintControllerPaintTest() : PaintControllerPaintTestBase(false) { } |
87 }; | 89 }; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 const TestDisplayItem expected[] = { __VA_ARGS__ }; \ | 124 const TestDisplayItem expected[] = { __VA_ARGS__ }; \ |
123 for (size_t index = 0; index < std::min<size_t>(actual.size(), expectedS
ize); index++) { \ | 125 for (size_t index = 0; index < std::min<size_t>(actual.size(), expectedS
ize); index++) { \ |
124 TRACE_DISPLAY_ITEMS(index, expected[index], actual[index]); \ | 126 TRACE_DISPLAY_ITEMS(index, expected[index], actual[index]); \ |
125 EXPECT_EQ(expected[index].client(), actual[index].client()); \ | 127 EXPECT_EQ(expected[index].client(), actual[index].client()); \ |
126 EXPECT_EQ(expected[index].getType(), actual[index].getType()); \ | 128 EXPECT_EQ(expected[index].getType(), actual[index].getType()); \ |
127 } \ | 129 } \ |
128 } while (false); | 130 } while (false); |
129 | 131 |
130 // Shorter names for frequently used display item types in tests. | 132 // Shorter names for frequently used display item types in tests. |
131 const DisplayItem::Type backgroundType = DisplayItem::BoxDecorationBackground; | 133 const DisplayItem::Type backgroundType = DisplayItem::BoxDecorationBackground; |
132 const DisplayItem::Type cachedBackgroundType = DisplayItem::drawingTypeToCachedD
rawingType(backgroundType); | |
133 const DisplayItem::Type foregroundType = DisplayItem::paintPhaseToDrawingType(Pa
intPhaseForeground); | 134 const DisplayItem::Type foregroundType = DisplayItem::paintPhaseToDrawingType(Pa
intPhaseForeground); |
134 const DisplayItem::Type cachedForegroundType = DisplayItem::drawingTypeToCachedD
rawingType(foregroundType); | |
135 const DisplayItem::Type documentBackgroundType = DisplayItem::DocumentBackground
; | 135 const DisplayItem::Type documentBackgroundType = DisplayItem::DocumentBackground
; |
136 const DisplayItem::Type cachedDocumentBackgroundType = DisplayItem::drawingTypeT
oCachedDrawingType(DisplayItem::DocumentBackground); | |
137 | 136 |
138 } // namespace blink | 137 } // namespace blink |
139 | 138 |
140 #endif // PaintControllerPaintTest_h | 139 #endif // PaintControllerPaintTest_h |
OLD | NEW |