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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 ResourceManagerTest() | 90 ResourceManagerTest() |
91 : window_android_(WindowAndroid::createForTesting()), | 91 : window_android_(WindowAndroid::createForTesting()), |
92 resource_manager_(window_android_), | 92 resource_manager_(window_android_), |
93 fake_client_(cc::FakeLayerTreeHostClient::DIRECT_3D) { | 93 fake_client_(cc::FakeLayerTreeHostClient::DIRECT_3D) { |
94 cc::LayerTreeHost::InitParams params; | 94 cc::LayerTreeHost::InitParams params; |
95 cc::LayerTreeSettings settings; | 95 cc::LayerTreeSettings settings; |
96 params.client = &fake_client_; | 96 params.client = &fake_client_; |
97 params.settings = &settings; | 97 params.settings = &settings; |
98 params.task_graph_runner = &task_graph_runner_; | 98 params.task_graph_runner = &task_graph_runner_; |
99 host_.reset(new MockLayerTreeHost(¶ms, | 99 host_.reset(new MockLayerTreeHost(¶ms, |
100 cc::CompositorMode::SingleThreaded)); | 100 cc::CompositorMode::SINGLE_THREADED)); |
101 resource_manager_.Init(host_.get()); | 101 resource_manager_.Init(host_.get()); |
102 } | 102 } |
103 | 103 |
104 ~ResourceManagerTest() override { window_android_->Destroy(NULL, NULL); } | 104 ~ResourceManagerTest() override { window_android_->Destroy(NULL, NULL); } |
105 | 105 |
106 void PreloadResource(ui::SystemUIResourceType type) { | 106 void PreloadResource(ui::SystemUIResourceType type) { |
107 resource_manager_.PreloadResource(ui::ANDROID_RESOURCE_TYPE_SYSTEM, type); | 107 resource_manager_.PreloadResource(ui::ANDROID_RESOURCE_TYPE_SYSTEM, type); |
108 } | 108 } |
109 | 109 |
110 cc::UIResourceId GetUIResourceId(ui::SystemUIResourceType type) { | 110 cc::UIResourceId GetUIResourceId(ui::SystemUIResourceType type) { |
(...skipping 67 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 |