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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "cc/resources/ui_resource_bitmap.h" | 8 #include "cc/resources/ui_resource_bitmap.h" |
9 #include "cc/test/fake_layer_tree_host_client.h" | 9 #include "cc/test/fake_layer_tree_host_client.h" |
10 #include "cc/test/test_task_graph_runner.h" | 10 #include "cc/test/test_task_graph_runner.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 void SetResourceAsLoaded(ui::SystemUIResourceType type) { | 115 void SetResourceAsLoaded(ui::SystemUIResourceType type) { |
116 resource_manager_.SetResourceAsLoaded(ui::ANDROID_RESOURCE_TYPE_SYSTEM, | 116 resource_manager_.SetResourceAsLoaded(ui::ANDROID_RESOURCE_TYPE_SYSTEM, |
117 type); | 117 type); |
118 } | 118 } |
119 | 119 |
120 private: | 120 private: |
121 WindowAndroid* window_android_; | 121 WindowAndroid* window_android_; |
122 | 122 |
123 protected: | 123 protected: |
124 scoped_ptr<MockLayerTreeHost> host_; | 124 std::unique_ptr<MockLayerTreeHost> host_; |
125 TestResourceManagerImpl resource_manager_; | 125 TestResourceManagerImpl resource_manager_; |
126 cc::TestTaskGraphRunner task_graph_runner_; | 126 cc::TestTaskGraphRunner task_graph_runner_; |
127 cc::FakeLayerTreeHostClient fake_client_; | 127 cc::FakeLayerTreeHostClient fake_client_; |
128 }; | 128 }; |
129 | 129 |
130 TEST_F(ResourceManagerTest, GetResource) { | 130 TEST_F(ResourceManagerTest, GetResource) { |
131 const cc::UIResourceId kResourceId = 99; | 131 const cc::UIResourceId kResourceId = 99; |
132 EXPECT_CALL(*host_.get(), CreateUIResource(_)) | 132 EXPECT_CALL(*host_.get(), CreateUIResource(_)) |
133 .WillOnce(Return(kResourceId)) | 133 .WillOnce(Return(kResourceId)) |
134 .RetiresOnSaturation(); | 134 .RetiresOnSaturation(); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 EXPECT_EQ(kNumFrames, actual_rects.size()); | 178 EXPECT_EQ(kNumFrames, actual_rects.size()); |
179 for (size_t i = 0; i < kNumFrames; i++) { | 179 for (size_t i = 0; i < kNumFrames; i++) { |
180 EXPECT_EQ(expected_rects[i].size(), actual_rects[i].size()); | 180 EXPECT_EQ(expected_rects[i].size(), actual_rects[i].size()); |
181 for (size_t j = 0; j < actual_rects[i].size(); j++) { | 181 for (size_t j = 0; j < actual_rects[i].size(); j++) { |
182 EXPECT_EQ(expected_rects[i][j], actual_rects[i][j]); | 182 EXPECT_EQ(expected_rects[i][j], actual_rects[i][j]); |
183 } | 183 } |
184 } | 184 } |
185 } | 185 } |
186 | 186 |
187 } // namespace ui | 187 } // namespace ui |
OLD | NEW |