OLD | NEW |
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 "core/style/ComputedStyle.h" | 5 #include "core/style/ComputedStyle.h" |
6 | 6 |
7 #include "core/style/ClipPathOperation.h" | 7 #include "core/style/ClipPathOperation.h" |
8 #include "core/style/ShapeValue.h" | 8 #include "core/style/ShapeValue.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 TEST(ComputedStyleTest, | 95 TEST(ComputedStyleTest, |
96 UpdatePropertySpecificDifferencesRespectsTransformAnimation) { | 96 UpdatePropertySpecificDifferencesRespectsTransformAnimation) { |
97 RefPtr<ComputedStyle> style = ComputedStyle::Create(); | 97 RefPtr<ComputedStyle> style = ComputedStyle::Create(); |
98 RefPtr<ComputedStyle> other = ComputedStyle::Clone(*style); | 98 RefPtr<ComputedStyle> other = ComputedStyle::Clone(*style); |
99 other->SetHasCurrentTransformAnimation(); | 99 other->SetHasCurrentTransformAnimation(); |
100 StyleDifference diff; | 100 StyleDifference diff; |
101 style->UpdatePropertySpecificDifferences(*other, diff); | 101 style->UpdatePropertySpecificDifferences(*other, diff); |
102 EXPECT_TRUE(diff.TransformChanged()); | 102 EXPECT_TRUE(diff.TransformChanged()); |
103 } | 103 } |
104 | 104 |
| 105 TEST(CompuetedStyleTest, HasOutlineWithCurrentColor) { |
| 106 RefPtr<ComputedStyle> style = ComputedStyle::Create(); |
| 107 EXPECT_FALSE(style->HasOutline()); |
| 108 EXPECT_FALSE(style->HasOutlineWithCurrentColor()); |
| 109 style->SetOutlineColor(StyleColor::CurrentColor()); |
| 110 EXPECT_FALSE(style->HasOutlineWithCurrentColor()); |
| 111 style->SetOutlineWidth(5); |
| 112 EXPECT_FALSE(style->HasOutlineWithCurrentColor()); |
| 113 style->SetOutlineStyle(kBorderStyleSolid); |
| 114 EXPECT_TRUE(style->HasOutlineWithCurrentColor()); |
| 115 } |
| 116 |
| 117 TEST(CompuetedStyleTest, HasBorderColorReferencingCurrentColor) { |
| 118 RefPtr<ComputedStyle> style = ComputedStyle::Create(); |
| 119 EXPECT_FALSE(style->HasBorderColorReferencingCurrentColor()); |
| 120 style->SetBorderBottomColor(StyleColor::CurrentColor()); |
| 121 EXPECT_FALSE(style->HasBorderColorReferencingCurrentColor()); |
| 122 style->SetBorderBottomWidth(5); |
| 123 EXPECT_FALSE(style->HasBorderColorReferencingCurrentColor()); |
| 124 style->SetBorderBottomStyle(kBorderStyleSolid); |
| 125 EXPECT_TRUE(style->HasBorderColorReferencingCurrentColor()); |
| 126 } |
| 127 |
105 } // namespace blink | 128 } // namespace blink |
OLD | NEW |