| OLD | NEW |
| 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/input/main_thread_scrolling_reason.h" | 7 #include "cc/input/main_thread_scrolling_reason.h" |
| 8 #include "cc/proto/property_tree.pb.h" | 8 #include "cc/proto/property_tree.pb.h" |
| 9 #include "cc/test/geometry_test_utils.h" | 9 #include "cc/test/geometry_test_utils.h" |
| 10 #include "cc/trees/draw_property_utils.h" | 10 #include "cc/trees/draw_property_utils.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 | 253 |
| 254 proto::TreeNode proto; | 254 proto::TreeNode proto; |
| 255 original.ToProtobuf(&proto); | 255 original.ToProtobuf(&proto); |
| 256 ScrollNode result; | 256 ScrollNode result; |
| 257 result.FromProtobuf(proto); | 257 result.FromProtobuf(proto); |
| 258 | 258 |
| 259 EXPECT_EQ(original, result); | 259 EXPECT_EQ(original, result); |
| 260 } | 260 } |
| 261 | 261 |
| 262 TEST(PropertyTreeSerializationTest, ScrollTreeSerialization) { | 262 TEST(PropertyTreeSerializationTest, ScrollTreeSerialization) { |
| 263 ScrollTree original; | 263 PropertyTrees property_trees; |
| 264 property_trees.is_main_thread = true; |
| 265 ScrollTree& original = property_trees.scroll_tree; |
| 264 ScrollNode second; | 266 ScrollNode second; |
| 265 second.data.scrollable = true; | 267 second.data.scrollable = true; |
| 266 second.data.bounds = gfx::Size(15, 15); | 268 second.data.bounds = gfx::Size(15, 15); |
| 267 ScrollNode third; | 269 ScrollNode third; |
| 268 third.data.contains_non_fast_scrollable_region = true; | 270 third.data.contains_non_fast_scrollable_region = true; |
| 269 | 271 |
| 270 original.Insert(second, 0); | 272 original.Insert(second, 0); |
| 271 original.Insert(third, 1); | 273 original.Insert(third, 1); |
| 272 | 274 |
| 275 original.set_currently_scrolling_node(1); |
| 276 original.synced_scroll_offset(1)->PushFromMainThread(gfx::ScrollOffset(1, 2)); |
| 277 |
| 273 proto::PropertyTree proto; | 278 proto::PropertyTree proto; |
| 274 original.ToProtobuf(&proto); | 279 original.ToProtobuf(&proto); |
| 275 ScrollTree result; | 280 ScrollTree result; |
| 276 result.FromProtobuf(proto); | 281 result.FromProtobuf(proto); |
| 277 | 282 |
| 278 EXPECT_EQ(original, result); | 283 EXPECT_EQ(original, result); |
| 279 } | 284 } |
| 280 | 285 |
| 281 TEST(PropertyTreeSerializationTest, PropertyTrees) { | 286 TEST(PropertyTreeSerializationTest, PropertyTrees) { |
| 282 PropertyTrees original; | 287 PropertyTrees original; |
| (...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1080 | 1085 |
| 1081 DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F( | 1086 DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F( |
| 1082 PropertyTreeTestSingularTransformSnapTest); | 1087 PropertyTreeTestSingularTransformSnapTest); |
| 1083 | 1088 |
| 1084 #undef DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F | 1089 #undef DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F |
| 1085 #undef SERIALIZED_PROPERTY_TREE_TEST_F | 1090 #undef SERIALIZED_PROPERTY_TREE_TEST_F |
| 1086 #undef DIRECT_PROPERTY_TREE_TEST_F | 1091 #undef DIRECT_PROPERTY_TREE_TEST_F |
| 1087 | 1092 |
| 1088 } // namespace | 1093 } // namespace |
| 1089 } // namespace cc | 1094 } // namespace cc |
| OLD | NEW |