| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/texture_layer.h" | 5 #include "cc/layers/texture_layer.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "cc/base/thread.h" | |
| 11 #include "cc/layers/texture_layer_client.h" | 10 #include "cc/layers/texture_layer_client.h" |
| 12 #include "cc/layers/texture_layer_impl.h" | 11 #include "cc/layers/texture_layer_impl.h" |
| 13 #include "cc/test/fake_impl_proxy.h" | 12 #include "cc/test/fake_impl_proxy.h" |
| 14 #include "cc/test/fake_layer_tree_host_client.h" | 13 #include "cc/test/fake_layer_tree_host_client.h" |
| 15 #include "cc/test/fake_layer_tree_host_impl.h" | 14 #include "cc/test/fake_layer_tree_host_impl.h" |
| 16 #include "cc/test/layer_test_common.h" | 15 #include "cc/test/layer_test_common.h" |
| 17 #include "cc/test/layer_tree_test.h" | 16 #include "cc/test/layer_tree_test.h" |
| 18 #include "cc/trees/layer_tree_host.h" | 17 #include "cc/trees/layer_tree_host.h" |
| 19 #include "cc/trees/layer_tree_impl.h" | 18 #include "cc/trees/layer_tree_impl.h" |
| 20 #include "cc/trees/single_thread_proxy.h" | 19 #include "cc/trees/single_thread_proxy.h" |
| 21 #include "testing/gmock/include/gmock/gmock.h" | 20 #include "testing/gmock/include/gmock/gmock.h" |
| 22 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 23 | 22 |
| 24 using ::testing::Mock; | 23 using ::testing::Mock; |
| 25 using ::testing::_; | 24 using ::testing::_; |
| 26 using ::testing::AtLeast; | 25 using ::testing::AtLeast; |
| 27 using ::testing::AnyNumber; | 26 using ::testing::AnyNumber; |
| 28 | 27 |
| 29 namespace cc { | 28 namespace cc { |
| 30 namespace { | 29 namespace { |
| 31 | 30 |
| 32 class MockLayerTreeHost : public LayerTreeHost { | 31 class MockLayerTreeHost : public LayerTreeHost { |
| 33 public: | 32 public: |
| 34 explicit MockLayerTreeHost(LayerTreeHostClient* client) | 33 explicit MockLayerTreeHost(LayerTreeHostClient* client) |
| 35 : LayerTreeHost(client, LayerTreeSettings()) { | 34 : LayerTreeHost(client, LayerTreeSettings()) { |
| 36 Initialize(scoped_ptr<Thread>()); | 35 Initialize(scoped_refptr<base::SingleThreadTaskRunner>()); |
| 37 } | 36 } |
| 38 | 37 |
| 39 MOCK_METHOD0(AcquireLayerTextures, void()); | 38 MOCK_METHOD0(AcquireLayerTextures, void()); |
| 40 MOCK_METHOD0(SetNeedsCommit, void()); | 39 MOCK_METHOD0(SetNeedsCommit, void()); |
| 41 }; | 40 }; |
| 42 | 41 |
| 43 class TextureLayerTest : public testing::Test { | 42 class TextureLayerTest : public testing::Test { |
| 44 public: | 43 public: |
| 45 TextureLayerTest() | 44 TextureLayerTest() |
| 46 : fake_client_( | 45 : fake_client_( |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 base::Lock lock_; | 716 base::Lock lock_; |
| 718 unsigned expected_used_textures_on_commit_; | 717 unsigned expected_used_textures_on_commit_; |
| 719 }; | 718 }; |
| 720 | 719 |
| 721 // The TextureLayerClient does not use mailboxes, so can't use a delegating | 720 // The TextureLayerClient does not use mailboxes, so can't use a delegating |
| 722 // renderer. | 721 // renderer. |
| 723 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TextureLayerClientTest); | 722 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TextureLayerClientTest); |
| 724 | 723 |
| 725 } // namespace | 724 } // namespace |
| 726 } // namespace cc | 725 } // namespace cc |
| OLD | NEW |