| 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/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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 ScrollTree original; | 260 ScrollTree original; |
| 261 ScrollNode& root = *original.Node(0); | 261 ScrollNode& root = *original.Node(0); |
| 262 root.data.transform_id = 2; | 262 root.data.transform_id = 2; |
| 263 ScrollNode second; | 263 ScrollNode second; |
| 264 second.data.transform_id = 4; | 264 second.data.transform_id = 4; |
| 265 second.data.scrollable = true; | 265 second.data.scrollable = true; |
| 266 ScrollNode third; | 266 ScrollNode third; |
| 267 third.data.transform_id = 5; | 267 third.data.transform_id = 5; |
| 268 third.data.contains_non_fast_scrollable_region = true; | 268 third.data.contains_non_fast_scrollable_region = true; |
| 269 | 269 |
| 270 original.Insert(second, 0); |
| 271 original.Insert(third, 1); |
| 272 |
| 270 proto::PropertyTree proto; | 273 proto::PropertyTree proto; |
| 271 original.ToProtobuf(&proto); | 274 original.ToProtobuf(&proto); |
| 272 ScrollTree result; | 275 ScrollTree result; |
| 273 result.FromProtobuf(proto); | 276 result.FromProtobuf(proto); |
| 274 | 277 |
| 275 EXPECT_EQ(original, result); | 278 EXPECT_EQ(original, result); |
| 276 } | 279 } |
| 277 | 280 |
| 278 TEST(PropertyTreeSerializationTest, PropertyTrees) { | 281 TEST(PropertyTreeSerializationTest, PropertyTrees) { |
| 279 PropertyTrees original; | 282 PropertyTrees original; |
| (...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1063 | 1066 |
| 1064 DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F( | 1067 DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F( |
| 1065 PropertyTreeTestSingularTransformSnapTest); | 1068 PropertyTreeTestSingularTransformSnapTest); |
| 1066 | 1069 |
| 1067 #undef DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F | 1070 #undef DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F |
| 1068 #undef SERIALIZED_PROPERTY_TREE_TEST_F | 1071 #undef SERIALIZED_PROPERTY_TREE_TEST_F |
| 1069 #undef DIRECT_PROPERTY_TREE_TEST_F | 1072 #undef DIRECT_PROPERTY_TREE_TEST_F |
| 1070 | 1073 |
| 1071 } // namespace | 1074 } // namespace |
| 1072 } // namespace cc | 1075 } // namespace cc |
| OLD | NEW |