| 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 "visualRectUpdate=0, propertySpecificDifferences=}", |
| 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.setNeedsVisualRectUpdate(); |
| 30 diff.setTransformChanged(); |
| 31 diff.setScrollAnchorDisablingPropertyChanged(); |
| 32 stringStream << diff; |
| 33 EXPECT_EQ( |
| 34 "StyleDifference{layoutType=PositionedMovement, " |
| 35 "paintInvalidationType=PaintInvalidationObject, recomputeOverflow=1, " |
| 36 "visualRectUpdate=1, " |
| 37 "propertySpecificDifferences=TransformChanged|" |
| 38 "ScrollAnchorDisablingPropertyChanged|TransformChanged|" |
| 39 "ScrollAnchorDisablingPropertyChanged}", |
| 40 stringStream.str()); |
| 41 } |
| 42 |
| 43 TEST(StyleDifferenceTest, StreamOutputSetAllProperties) { |
| 44 std::stringstream stringStream; |
| 45 StyleDifference diff; |
| 46 diff.setTransformChanged(); |
| 47 diff.setOpacityChanged(); |
| 48 diff.setZIndexChanged(); |
| 49 diff.setFilterChanged(); |
| 50 diff.setBackdropFilterChanged(); |
| 51 diff.setCSSClipChanged(); |
| 52 diff.setTextDecorationOrColorChanged(); |
| 53 diff.setScrollAnchorDisablingPropertyChanged(); |
| 54 stringStream << diff; |
| 55 EXPECT_EQ( |
| 56 "StyleDifference{layoutType=NoLayout, " |
| 57 "paintInvalidationType=NoPaintInvalidation, recomputeOverflow=0, " |
| 58 "visualRectUpdate=0, " |
| 59 "propertySpecificDifferences=TransformChanged|OpacityChanged|" |
| 60 "ZIndexChanged|FilterChanged|BackdropFilterChanged|CSSClipChanged|" |
| 61 "TextDecorationOrColorChanged|ScrollAnchorDisablingPropertyChanged|" |
| 62 "TransformChanged|OpacityChanged|ZIndexChanged|FilterChanged|" |
| 63 "BackdropFilterChanged|CSSClipChanged|TextDecorationOrColorChanged|" |
| 64 "ScrollAnchorDisablingPropertyChanged}", |
| 65 stringStream.str()); |
| 66 } |
| 67 |
| 68 } // namespace blink |
| OLD | NEW |