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/animation/animation_host.h" | 8 #include "cc/animation/animation_host.h" |
9 #include "cc/resources/ui_resource_bitmap.h" | 9 #include "cc/resources/ui_resource_bitmap.h" |
10 #include "cc/test/fake_layer_tree_host_client.h" | 10 #include "cc/test/fake_layer_tree_host_client.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 private: | 83 private: |
84 DISALLOW_COPY_AND_ASSIGN(MockLayerTreeHost); | 84 DISALLOW_COPY_AND_ASSIGN(MockLayerTreeHost); |
85 }; | 85 }; |
86 | 86 |
87 } // namespace | 87 } // namespace |
88 | 88 |
89 class ResourceManagerTest : public testing::Test { | 89 class ResourceManagerTest : public testing::Test { |
90 public: | 90 public: |
91 ResourceManagerTest() | 91 ResourceManagerTest() |
92 : window_android_(WindowAndroid::createForTesting()), | 92 : window_android_(WindowAndroid::createForTesting()), |
93 resource_manager_(window_android_), | 93 resource_manager_(window_android_) { |
94 fake_client_(cc::FakeLayerTreeHostClient::DIRECT_3D) { | |
95 cc::LayerTreeHost::InitParams params; | 94 cc::LayerTreeHost::InitParams params; |
96 cc::LayerTreeSettings settings; | 95 cc::LayerTreeSettings settings; |
97 params.client = &fake_client_; | 96 params.client = &fake_client_; |
98 params.settings = &settings; | 97 params.settings = &settings; |
99 params.task_graph_runner = &task_graph_runner_; | 98 params.task_graph_runner = &task_graph_runner_; |
100 params.animation_host = | 99 params.animation_host = |
101 cc::AnimationHost::CreateForTesting(cc::ThreadInstance::MAIN); | 100 cc::AnimationHost::CreateForTesting(cc::ThreadInstance::MAIN); |
102 host_.reset(new MockLayerTreeHost(¶ms, | 101 host_.reset(new MockLayerTreeHost(¶ms, |
103 cc::CompositorMode::SINGLE_THREADED)); | 102 cc::CompositorMode::SINGLE_THREADED)); |
104 resource_manager_.Init(host_.get()); | 103 resource_manager_.Init(host_.get()); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 EXPECT_EQ(kNumFrames, actual_rects.size()); | 180 EXPECT_EQ(kNumFrames, actual_rects.size()); |
182 for (size_t i = 0; i < kNumFrames; i++) { | 181 for (size_t i = 0; i < kNumFrames; i++) { |
183 EXPECT_EQ(expected_rects[i].size(), actual_rects[i].size()); | 182 EXPECT_EQ(expected_rects[i].size(), actual_rects[i].size()); |
184 for (size_t j = 0; j < actual_rects[i].size(); j++) { | 183 for (size_t j = 0; j < actual_rects[i].size(); j++) { |
185 EXPECT_EQ(expected_rects[i][j], actual_rects[i][j]); | 184 EXPECT_EQ(expected_rects[i][j], actual_rects[i][j]); |
186 } | 185 } |
187 } | 186 } |
188 } | 187 } |
189 | 188 |
190 } // namespace ui | 189 } // namespace ui |
OLD | NEW |