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

Side by Side Diff: cc/trees/property_tree_unittest.cc

Issue 1626513003: Add ScrollTree builder and unit test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with master Created 4 years, 11 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 | « cc/trees/property_tree_builder.cc ('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
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 "cc/trees/property_tree.h" 5 #include "cc/trees/property_tree.h"
6 6
7 #include "cc/proto/property_tree.pb.h" 7 #include "cc/proto/property_tree.pb.h"
8 #include "cc/test/geometry_test_utils.h" 8 #include "cc/test/geometry_test_utils.h"
9 #include "cc/trees/draw_property_utils.h" 9 #include "cc/trees/draw_property_utils.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 EffectTree result; 223 EffectTree result;
224 result.FromProtobuf(proto); 224 result.FromProtobuf(proto);
225 225
226 EXPECT_EQ(original, result); 226 EXPECT_EQ(original, result);
227 } 227 }
228 228
229 TEST(PropertyTreeSerializationTest, ScrollNodeDataSerialization) { 229 TEST(PropertyTreeSerializationTest, ScrollNodeDataSerialization) {
230 ScrollNodeData original; 230 ScrollNodeData original;
231 original.scrollable = true; 231 original.scrollable = true;
232 original.should_scroll_on_main_thread = false; 232 original.should_scroll_on_main_thread = false;
233 original.scroll_blocks_on = SCROLL_BLOCKS_ON_WHEEL_EVENT;
234 original.contains_non_fast_scrollable_region = false; 233 original.contains_non_fast_scrollable_region = false;
235 original.transform_id = 2; 234 original.transform_id = 2;
236 235
237 proto::TreeNode proto; 236 proto::TreeNode proto;
238 original.ToProtobuf(&proto); 237 original.ToProtobuf(&proto);
239 ScrollNodeData result; 238 ScrollNodeData result;
240 result.FromProtobuf(proto); 239 result.FromProtobuf(proto);
241 240
242 EXPECT_EQ(original, result); 241 EXPECT_EQ(original, result);
243 } 242 }
(...skipping 16 matching lines...) Expand all
260 ScrollTree original; 259 ScrollTree original;
261 ScrollNode& root = *original.Node(0); 260 ScrollNode& root = *original.Node(0);
262 root.data.transform_id = 2; 261 root.data.transform_id = 2;
263 ScrollNode second; 262 ScrollNode second;
264 second.data.transform_id = 4; 263 second.data.transform_id = 4;
265 second.data.scrollable = true; 264 second.data.scrollable = true;
266 ScrollNode third; 265 ScrollNode third;
267 third.data.transform_id = 5; 266 third.data.transform_id = 5;
268 third.data.contains_non_fast_scrollable_region = true; 267 third.data.contains_non_fast_scrollable_region = true;
269 268
269 original.Insert(second, 0);
270 original.Insert(third, 1);
271
270 proto::PropertyTree proto; 272 proto::PropertyTree proto;
271 original.ToProtobuf(&proto); 273 original.ToProtobuf(&proto);
272 ScrollTree result; 274 ScrollTree result;
273 result.FromProtobuf(proto); 275 result.FromProtobuf(proto);
274 276
275 EXPECT_EQ(original, result); 277 EXPECT_EQ(original, result);
276 } 278 }
277 279
278 TEST(PropertyTreeSerializationTest, PropertyTrees) { 280 TEST(PropertyTreeSerializationTest, PropertyTrees) {
279 PropertyTrees original; 281 PropertyTrees original;
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
1063 1065
1064 DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F( 1066 DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F(
1065 PropertyTreeTestSingularTransformSnapTest); 1067 PropertyTreeTestSingularTransformSnapTest);
1066 1068
1067 #undef DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F 1069 #undef DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F
1068 #undef SERIALIZED_PROPERTY_TREE_TEST_F 1070 #undef SERIALIZED_PROPERTY_TREE_TEST_F
1069 #undef DIRECT_PROPERTY_TREE_TEST_F 1071 #undef DIRECT_PROPERTY_TREE_TEST_F
1070 1072
1071 } // namespace 1073 } // namespace
1072 } // namespace cc 1074 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/property_tree_builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698