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

Side by Side Diff: cc/output/filter_operations_unittest.cc

Issue 2574713003: Add toString() for paint property node classes (Closed)
Patch Set: Update test Created 4 years 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "cc/output/filter_operations.h" 7 #include "cc/output/filter_operations.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "third_party/skia/include/effects/SkBlurImageFilter.h" 9 #include "third_party/skia/include/effects/SkBlurImageFilter.h"
10 #include "third_party/skia/include/effects/SkDropShadowImageFilter.h" 10 #include "third_party/skia/include/effects/SkDropShadowImageFilter.h"
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 from.Append(FilterOperation::CreateOpacityFilter(1.f)); 949 from.Append(FilterOperation::CreateOpacityFilter(1.f));
950 to.Append(FilterOperation::CreateOpacityFilter(1.f)); 950 to.Append(FilterOperation::CreateOpacityFilter(1.f));
951 blended = to.Blend(from, -0.75); 951 blended = to.Blend(from, -0.75);
952 EXPECT_EQ(to, blended); 952 EXPECT_EQ(to, blended);
953 blended = to.Blend(from, 0.75); 953 blended = to.Blend(from, 0.75);
954 EXPECT_EQ(to, blended); 954 EXPECT_EQ(to, blended);
955 blended = to.Blend(from, 1.5); 955 blended = to.Blend(from, 1.5);
956 EXPECT_EQ(to, blended); 956 EXPECT_EQ(to, blended);
957 } 957 }
958 958
959 TEST(FilterOperationsTest, ToString) {
960 FilterOperations filters;
961 EXPECT_EQ(std::string("{\"FilterOperations\":[]}"), filters.ToString());
962
963 filters.Append(FilterOperation::CreateSaturateFilter(3.f));
964 filters.Append(FilterOperation::CreateBlurFilter(2.f));
965 EXPECT_EQ(std::string("{\"FilterOperations\":[{\"amount\":3.0,\"type\":2},"
966 "{\"amount\":2.0,\"type\":8}]}"),
967 filters.ToString());
968 }
969
959 } // namespace 970 } // namespace
960 } // namespace cc 971 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/filter_operations.cc ('k') | third_party/WebKit/Source/core/paint/PaintPropertyTreePrinter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698