| OLD | NEW |
| 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 "cc/test/layer_tree_json_parser.h" | 5 #include "cc/test/layer_tree_json_parser.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "cc/layers/layer.h" | 9 #include "cc/layers/layer.h" |
| 10 #include "cc/test/fake_impl_task_runner_provider.h" | 10 #include "cc/test/fake_impl_task_runner_provider.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 RETURN_IF_EXPECTATION_FAILS(EXPECT_EQ(layer_impl->scrollable(), | 40 RETURN_IF_EXPECTATION_FAILS(EXPECT_EQ(layer_impl->scrollable(), |
| 41 layer->scrollable())); | 41 layer->scrollable())); |
| 42 RETURN_IF_EXPECTATION_FAILS(EXPECT_FLOAT_EQ(layer_impl->opacity(), | 42 RETURN_IF_EXPECTATION_FAILS(EXPECT_FLOAT_EQ(layer_impl->opacity(), |
| 43 layer->opacity())); | 43 layer->opacity())); |
| 44 RETURN_IF_EXPECTATION_FAILS( | 44 RETURN_IF_EXPECTATION_FAILS( |
| 45 EXPECT_EQ(layer_impl->touch_event_handler_region(), | 45 EXPECT_EQ(layer_impl->touch_event_handler_region(), |
| 46 layer->touch_event_handler_region())); | 46 layer->touch_event_handler_region())); |
| 47 | 47 |
| 48 for (size_t i = 0; i < layer_impl->children().size(); ++i) { | 48 for (size_t i = 0; i < layer_impl->children().size(); ++i) { |
| 49 RETURN_IF_EXPECTATION_FAILS(EXPECT_TRUE(LayerTreesMatch( | 49 RETURN_IF_EXPECTATION_FAILS(EXPECT_TRUE(LayerTreesMatch( |
| 50 layer_impl->children()[i].get(), layer->children()[i].get()))); | 50 layer_impl->children()[i], layer->children()[i].get()))); |
| 51 } | 51 } |
| 52 | 52 |
| 53 return true; | 53 return true; |
| 54 #undef RETURN_IF_EXPECTATION_FAILS | 54 #undef RETURN_IF_EXPECTATION_FAILS |
| 55 } | 55 } |
| 56 | 56 |
| 57 } // namespace | 57 } // namespace |
| 58 | 58 |
| 59 class LayerTreeJsonParserSanityCheck : public testing::Test { | 59 class LayerTreeJsonParserSanityCheck : public testing::Test { |
| 60 }; | 60 }; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 root_impl->AddChild(std::move(touch_layer)); | 109 root_impl->AddChild(std::move(touch_layer)); |
| 110 tree->SetRootLayer(std::move(root_impl)); | 110 tree->SetRootLayer(std::move(root_impl)); |
| 111 | 111 |
| 112 std::string json = host_impl.LayerTreeAsJson(); | 112 std::string json = host_impl.LayerTreeAsJson(); |
| 113 scoped_refptr<Layer> root = ParseTreeFromJson(json, NULL); | 113 scoped_refptr<Layer> root = ParseTreeFromJson(json, NULL); |
| 114 ASSERT_TRUE(root.get()); | 114 ASSERT_TRUE(root.get()); |
| 115 EXPECT_TRUE(LayerTreesMatch(host_impl.RootLayer(), root.get())); | 115 EXPECT_TRUE(LayerTreesMatch(host_impl.RootLayer(), root.get())); |
| 116 } | 116 } |
| 117 | 117 |
| 118 } // namespace cc | 118 } // namespace cc |
| OLD | NEW |