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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/paint/DisplayItemListTest.cpp

Issue 1394313002: Make DisplayItem::replay const. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 "config.h" 5 #include "config.h"
6 #include "platform/graphics/paint/DisplayItemList.h" 6 #include "platform/graphics/paint/DisplayItemList.h"
7 7
8 #include "platform/RuntimeEnabledFeatures.h" 8 #include "platform/RuntimeEnabledFeatures.h"
9 #include "platform/graphics/GraphicsContext.h" 9 #include "platform/graphics/GraphicsContext.h"
10 #include "platform/graphics/paint/CachedDisplayItem.h" 10 #include "platform/graphics/paint/CachedDisplayItem.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 String debugName() const { return m_name; } 56 String debugName() const { return m_name; }
57 57
58 private: 58 private:
59 String m_name; 59 String m_name;
60 }; 60 };
61 61
62 class TestDisplayItem final : public DisplayItem { 62 class TestDisplayItem final : public DisplayItem {
63 public: 63 public:
64 TestDisplayItem(const TestDisplayItemClient& client, Type type) : DisplayIte m(client, type, sizeof(*this)) { } 64 TestDisplayItem(const TestDisplayItemClient& client, Type type) : DisplayIte m(client, type, sizeof(*this)) { }
65 65
66 void replay(GraphicsContext&) final { ASSERT_NOT_REACHED(); } 66 void replay(GraphicsContext&) const final { ASSERT_NOT_REACHED(); }
67 void appendToWebDisplayItemList(WebDisplayItemList*) const final { ASSERT_NO T_REACHED(); } 67 void appendToWebDisplayItemList(WebDisplayItemList*) const final { ASSERT_NO T_REACHED(); }
68 }; 68 };
69 69
70 #ifndef NDEBUG 70 #ifndef NDEBUG
71 #define TRACE_DISPLAY_ITEMS(i, expected, actual) \ 71 #define TRACE_DISPLAY_ITEMS(i, expected, actual) \
72 String trace = String::format("%d: ", (int)i) + "Expected: " + (expected).as DebugString() + " Actual: " + (actual).asDebugString(); \ 72 String trace = String::format("%d: ", (int)i) + "Expected: " + (expected).as DebugString() + " Actual: " + (actual).asDebugString(); \
73 SCOPED_TRACE(trace.utf8().data()); 73 SCOPED_TRACE(trace.utf8().data());
74 #else 74 #else
75 #define TRACE_DISPLAY_ITEMS(i, expected, actual) 75 #define TRACE_DISPLAY_ITEMS(i, expected, actual)
76 #endif 76 #endif
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 drawRect(context, client, backgroundDrawingType, FloatRect(0, 0, 100, 100)); 784 drawRect(context, client, backgroundDrawingType, FloatRect(0, 0, 100, 100));
785 785
786 displayItemList().commitNewDisplayItems(); 786 displayItemList().commitNewDisplayItems();
787 const auto& paintChunks = displayItemList().paintChunks(); 787 const auto& paintChunks = displayItemList().paintChunks();
788 ASSERT_EQ(1u, paintChunks.size()); 788 ASSERT_EQ(1u, paintChunks.size());
789 EXPECT_EQ(0u, paintChunks[0].beginIndex); 789 EXPECT_EQ(0u, paintChunks[0].beginIndex);
790 EXPECT_EQ(1u, paintChunks[0].endIndex); 790 EXPECT_EQ(1u, paintChunks[0].endIndex);
791 } 791 }
792 792
793 } // namespace blink 793 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698