OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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/style/StyleDifference.h" |
| 6 |
| 7 #include <sstream> |
| 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 TEST(StyleDifferenceTest, StreamOutputDefault) { |
| 13 std::stringstream stringStream; |
| 14 StyleDifference diff; |
| 15 stringStream << diff; |
| 16 EXPECT_EQ( |
| 17 "StyleDifference{layoutType=NoLayout, " |
| 18 "paintInvalidationType=NoPaintInvalidation, recomputeOverflow=0, " |
| 19 "propertySpecificDifferences=, scrollAnchorDisablingPropertyChanged=0}", |
| 20 stringStream.str()); |
| 21 } |
| 22 |
| 23 TEST(StyleDifferenceTest, StreamOutputAllFieldsMutated) { |
| 24 std::stringstream stringStream; |
| 25 StyleDifference diff; |
| 26 diff.setNeedsPaintInvalidationObject(); |
| 27 diff.setNeedsPositionedMovementLayout(); |
| 28 diff.setNeedsRecomputeOverflow(); |
| 29 diff.setTransformChanged(); |
| 30 diff.setScrollAnchorDisablingPropertyChanged(); |
| 31 stringStream << diff; |
| 32 EXPECT_EQ( |
| 33 "StyleDifference{layoutType=PositionedMovement, " |
| 34 "paintInvalidationType=PaintInvalidationObject, recomputeOverflow=1, " |
| 35 "propertySpecificDifferences=TransformChanged, " |
| 36 "scrollAnchorDisablingPropertyChanged=1}", |
| 37 stringStream.str()); |
| 38 } |
| 39 |
| 40 TEST(StyleDifferenceTest, StreamOutputSetAllProperties) { |
| 41 std::stringstream stringStream; |
| 42 StyleDifference diff; |
| 43 diff.setTransformChanged(); |
| 44 diff.setOpacityChanged(); |
| 45 diff.setZIndexChanged(); |
| 46 diff.setFilterChanged(); |
| 47 diff.setBackdropFilterChanged(); |
| 48 diff.setCSSClipChanged(); |
| 49 diff.setTextDecorationOrColorChanged(); |
| 50 stringStream << diff; |
| 51 EXPECT_EQ( |
| 52 "StyleDifference{layoutType=NoLayout, " |
| 53 "paintInvalidationType=NoPaintInvalidation, recomputeOverflow=0, " |
| 54 "propertySpecificDifferences=TransformChanged|OpacityChanged|" |
| 55 "ZIndexChanged|FilterChanged|BackdropFilterChanged|CSSClipChanged|" |
| 56 "TextDecorationOrColorChanged, scrollAnchorDisablingPropertyChanged=0}", |
| 57 stringStream.str()); |
| 58 } |
| 59 |
| 60 } // namespace blink |
OLD | NEW |