Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(436)

Side by Side Diff: third_party/WebKit/Source/core/style/StyleDifferenceTest.cpp

Issue 2779353002: Add operator<< to StyleDifference for debug logging. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/style/StyleDifference.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/StyleDifference.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698