OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "core/dom/ElementRareData.h" |
| 6 |
| 7 #include "core/layout/LayoutInline.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 TEST(ElementRareDataTest, ComputedStyleStorage) |
| 13 { |
| 14 // Without LayoutObject |
| 15 ElementRareData* rareData = ElementRareData::create(nullptr); |
| 16 RefPtr<ComputedStyle> style = ComputedStyle::create(); |
| 17 rareData->setComputedStyle(style); |
| 18 EXPECT_EQ(style.get(), rareData->computedStyle()); |
| 19 |
| 20 // With LayoutObject |
| 21 LayoutObject* layoutObject = new LayoutInline(nullptr); |
| 22 rareData = ElementRareData::create(layoutObject); |
| 23 rareData->setComputedStyle(style); |
| 24 EXPECT_EQ(style.get(), rareData->computedStyle()); |
| 25 |
| 26 rareData->setLayoutObject(nullptr); |
| 27 delete layoutObject; |
| 28 } |
| 29 |
| 30 } // namespace blink |
OLD | NEW |