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/layers/ui_resource_layer.h" | 5 #include "cc/layers/ui_resource_layer.h" |
6 | 6 |
7 #include "cc/resources/prioritized_resource_manager.h" | 7 #include "cc/resources/prioritized_resource_manager.h" |
8 #include "cc/resources/resource_provider.h" | 8 #include "cc/resources/resource_provider.h" |
9 #include "cc/resources/resource_update_queue.h" | 9 #include "cc/resources/resource_update_queue.h" |
10 #include "cc/resources/scoped_ui_resource.h" | 10 #include "cc/resources/scoped_ui_resource.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 namespace cc { | 28 namespace cc { |
29 namespace { | 29 namespace { |
30 | 30 |
31 class UIResourceLayerTest : public testing::Test { | 31 class UIResourceLayerTest : public testing::Test { |
32 public: | 32 public: |
33 UIResourceLayerTest() : fake_client_(FakeLayerTreeHostClient::DIRECT_3D) {} | 33 UIResourceLayerTest() : fake_client_(FakeLayerTreeHostClient::DIRECT_3D) {} |
34 | 34 |
35 protected: | 35 protected: |
36 virtual void SetUp() { | 36 virtual void SetUp() { |
37 layer_tree_host_ = FakeLayerTreeHost::Create(); | 37 layer_tree_host_ = FakeLayerTreeHost::Create(); |
38 layer_tree_host_->InitializeSingleThreaded(&fake_client_); | 38 layer_tree_host_->InitializeSingleThreaded( |
| 39 &fake_client_, base::MessageLoopProxy::current()); |
39 } | 40 } |
40 | 41 |
41 virtual void TearDown() { | 42 virtual void TearDown() { |
42 Mock::VerifyAndClearExpectations(layer_tree_host_.get()); | 43 Mock::VerifyAndClearExpectations(layer_tree_host_.get()); |
43 } | 44 } |
44 | 45 |
45 scoped_ptr<FakeLayerTreeHost> layer_tree_host_; | 46 scoped_ptr<FakeLayerTreeHost> layer_tree_host_; |
46 FakeLayerTreeHostClient fake_client_; | 47 FakeLayerTreeHostClient fake_client_; |
47 }; | 48 }; |
48 | 49 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 scoped_ptr<ScopedUIResource> resource = ScopedUIResource::Create( | 97 scoped_ptr<ScopedUIResource> resource = ScopedUIResource::Create( |
97 layer_tree_host_.get(), UIResourceBitmap(gfx::Size(10, 10), is_opaque)); | 98 layer_tree_host_.get(), UIResourceBitmap(gfx::Size(10, 10), is_opaque)); |
98 test_layer->SetUIResourceId(resource->id()); | 99 test_layer->SetUIResourceId(resource->id()); |
99 test_layer->Update(&queue, &occlusion_tracker); | 100 test_layer->Update(&queue, &occlusion_tracker); |
100 | 101 |
101 EXPECT_TRUE(test_layer->DrawsContent()); | 102 EXPECT_TRUE(test_layer->DrawsContent()); |
102 } | 103 } |
103 | 104 |
104 } // namespace | 105 } // namespace |
105 } // namespace cc | 106 } // namespace cc |
OLD | NEW |