| 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 "platform/graphics/paint/PaintChunk.h" | 5 #include "platform/graphics/paint/PaintChunk.h" |
| 6 | 6 |
| 7 #include "platform/RuntimeEnabledFeatures.h" | 7 #include "platform/RuntimeEnabledFeatures.h" |
| 8 #include "platform/testing/FakeDisplayItemClient.h" | 8 #include "platform/testing/FakeDisplayItemClient.h" |
| 9 #include "platform/wtf/Optional.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "wtf/Optional.h" | |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 TEST(PaintChunkTest, matchesSame) { | 14 TEST(PaintChunkTest, matchesSame) { |
| 15 PaintChunkProperties properties; | 15 PaintChunkProperties properties; |
| 16 FakeDisplayItemClient client; | 16 FakeDisplayItemClient client; |
| 17 client.updateCacheGeneration(); | 17 client.updateCacheGeneration(); |
| 18 DisplayItem::Id id(client, DisplayItem::kDrawingFirst); | 18 DisplayItem::Id id(client, DisplayItem::kDrawingFirst); |
| 19 EXPECT_TRUE(PaintChunk(0, 1, &id, properties) | 19 EXPECT_TRUE(PaintChunk(0, 1, &id, properties) |
| 20 .matches(PaintChunk(0, 1, &id, properties))); | 20 .matches(PaintChunk(0, 1, &id, properties))); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 // Delete the current object and create a new object at the same address. | 87 // Delete the current object and create a new object at the same address. |
| 88 client = WTF::nullopt; | 88 client = WTF::nullopt; |
| 89 client.emplace(); | 89 client.emplace(); |
| 90 EXPECT_TRUE(client->isJustCreated()); | 90 EXPECT_TRUE(client->isJustCreated()); |
| 91 EXPECT_FALSE(PaintChunk(0, 1, &id, properties) | 91 EXPECT_FALSE(PaintChunk(0, 1, &id, properties) |
| 92 .matches(PaintChunk(0, 1, &id, properties))); | 92 .matches(PaintChunk(0, 1, &id, properties))); |
| 93 } | 93 } |
| 94 | 94 |
| 95 } // namespace blink | 95 } // namespace blink |
| OLD | NEW |