| 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 "core/css/CSSStyleDeclaration.h" | 5 #include "core/css/CSSStyleDeclaration.h" |
| 6 | 6 |
| 7 #include "core/css/CSSRuleList.h" | 7 #include "core/css/CSSRuleList.h" |
| 8 #include "core/css/CSSStyleRule.h" | 8 #include "core/css/CSSStyleRule.h" |
| 9 #include "core/css/CSSTestHelper.h" | 9 #include "core/css/CSSTestHelper.h" |
| 10 | 10 |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 TEST(CSSStyleDeclarationTest, getPropertyShorthand) | 15 TEST(CSSStyleDeclarationTest, getPropertyShorthand) |
| 16 { | 16 { |
| 17 CSSTestHelper helper; | 17 CSSTestHelper helper; |
| 18 | 18 |
| 19 helper.addCSSRules("div { padding: var(--p); }"); | 19 helper.addCSSRules("div { padding: var(--p); }"); |
| 20 ASSERT_TRUE(helper.cssRules()); | 20 ASSERT_TRUE(helper.cssRules()); |
| 21 ASSERT_EQ(1u, helper.cssRules()->length()); | 21 ASSERT_EQ(1u, helper.cssRules()->length()); |
| 22 ASSERT_EQ(CSSRule::STYLE_RULE, helper.cssRules()->item(0)->type()); | 22 ASSERT_EQ(CSSRule::kStyleRule, helper.cssRules()->item(0)->type()); |
| 23 CSSStyleRule* styleRule = toCSSStyleRule(helper.cssRules()->item(0)); | 23 CSSStyleRule* styleRule = toCSSStyleRule(helper.cssRules()->item(0)); |
| 24 CSSStyleDeclaration* style = styleRule->style(); | 24 CSSStyleDeclaration* style = styleRule->style(); |
| 25 ASSERT_TRUE(style); | 25 ASSERT_TRUE(style); |
| 26 EXPECT_EQ(AtomicString(), style->getPropertyShorthand("padding")); | 26 EXPECT_EQ(AtomicString(), style->getPropertyShorthand("padding")); |
| 27 } | 27 } |
| 28 | 28 |
| 29 } // namespace blink | 29 } // namespace blink |
| OLD | NEW |