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 #ifndef FakeDisplayItemClient_h | 5 #ifndef FakeDisplayItemClient_h |
6 #define FakeDisplayItemClient_h | 6 #define FakeDisplayItemClient_h |
7 | 7 |
8 #include "platform/geometry/LayoutRect.h" | 8 #include "platform/geometry/LayoutRect.h" |
9 #include "wtf/Forward.h" | 9 #include "wtf/Forward.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 // A simple DisplayItemClient implementation suitable for use in unit tests. | 13 // A simple DisplayItemClient implementation suitable for use in unit tests. |
14 class FakeDisplayItemClient : public DisplayItemClient { | 14 class FakeDisplayItemClient : public DisplayItemClient { |
15 public: | 15 public: |
16 FakeDisplayItemClient(const String& name = "FakeDisplayItemClient", const La
youtRect& visualRect = LayoutRect()) | 16 FakeDisplayItemClient(const String& name = "FakeDisplayItemClient", const La
youtRect& visualRect = LayoutRect()) |
17 : m_name(name), m_visualRect(visualRect) | 17 : m_name(name), m_visualRect(visualRect) |
18 { } | 18 { } |
19 | 19 |
20 String debugName() const final { return m_name; } | 20 String debugName() const final { return m_name; } |
21 LayoutRect visualRect() const override { return m_visualRect; } | 21 LayoutRect visualRect() const override { return m_visualRect; } |
22 | 22 |
23 private: | 23 private: |
24 DISPLAY_ITEM_CACHE_STATUS_IMPLEMENTATION | |
25 | |
26 String m_name; | 24 String m_name; |
27 LayoutRect m_visualRect; | 25 LayoutRect m_visualRect; |
28 }; | 26 }; |
29 | 27 |
30 } // namespace blink | 28 } // namespace blink |
31 | 29 |
32 #endif // FakeDisplayItemClient_h | 30 #endif // FakeDisplayItemClient_h |
OLD | NEW |