| 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 #include "platform/graphics/paint/DisplayItemClient.h" | 5 #include "platform/graphics/paint/DisplayItemClient.h" |
| 6 | 6 |
| 7 #include "platform/testing/FakeDisplayItemClient.h" | 7 #include "platform/testing/FakeDisplayItemClient.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 namespace { | 11 namespace { |
| 12 | 12 |
| 13 #if ENABLE(ASSERT) && !defined(UNDEFINED_SANITIZER) | 13 #if DCHECK_IS_ON() && !defined(UNDEFINED_SANITIZER) |
| 14 | 14 |
| 15 TEST(DisplayItemClientTest, IsAlive) { | 15 TEST(DisplayItemClientTest, IsAlive) { |
| 16 EXPECT_FALSE(reinterpret_cast<DisplayItemClient*>(0x12345678)->isAlive()); | 16 EXPECT_FALSE(reinterpret_cast<DisplayItemClient*>(0x12345678)->isAlive()); |
| 17 FakeDisplayItemClient* testClient = new FakeDisplayItemClient; | 17 FakeDisplayItemClient* testClient = new FakeDisplayItemClient; |
| 18 EXPECT_TRUE(testClient->isAlive()); | 18 EXPECT_TRUE(testClient->isAlive()); |
| 19 delete testClient; | 19 delete testClient; |
| 20 EXPECT_FALSE(testClient->isAlive()); | 20 EXPECT_FALSE(testClient->isAlive()); |
| 21 } | 21 } |
| 22 | 22 |
| 23 #endif // ENABLE(ASSERT) | 23 #endif |
| 24 | 24 |
| 25 } // namespace | 25 } // namespace |
| 26 } // namespace blink | 26 } // namespace blink |
| OLD | NEW |