| 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/texture_layer.h" | 5 #include "cc/texture_layer.h" |
| 6 | 6 |
| 7 #include "cc/layer_tree_host.h" | 7 #include "cc/layer_tree_host.h" |
| 8 #include "cc/single_thread_proxy.h" | 8 #include "cc/single_thread_proxy.h" |
| 9 #include "cc/test/fake_impl_proxy.h" | 9 #include "cc/test/fake_impl_proxy.h" |
| 10 #include "cc/test/fake_layer_tree_host_client.h" | 10 #include "cc/test/fake_layer_tree_host_client.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 Mock::VerifyAndClearExpectations(m_layerTreeHost.get()); | 93 Mock::VerifyAndClearExpectations(m_layerTreeHost.get()); |
| 94 } | 94 } |
| 95 | 95 |
| 96 TEST_F(TextureLayerTest, syncImplWhenDrawing) | 96 TEST_F(TextureLayerTest, syncImplWhenDrawing) |
| 97 { | 97 { |
| 98 gfx::RectF dirtyRect(0, 0, 1, 1); | 98 gfx::RectF dirtyRect(0, 0, 1, 1); |
| 99 | 99 |
| 100 scoped_refptr<TextureLayer> testLayer = TextureLayer::create(0); | 100 scoped_refptr<TextureLayer> testLayer = TextureLayer::create(0); |
| 101 ASSERT_TRUE(testLayer); | 101 ASSERT_TRUE(testLayer); |
| 102 scoped_ptr<TextureLayerImpl> implLayer; | 102 scoped_ptr<TextureLayerImpl> implLayer; |
| 103 implLayer = TextureLayerImpl::create(&m_hostImpl, 1); | 103 implLayer = TextureLayerImpl::create(m_hostImpl.activeTree(), 1); |
| 104 ASSERT_TRUE(implLayer); | 104 ASSERT_TRUE(implLayer); |
| 105 | 105 |
| 106 EXPECT_CALL(*m_layerTreeHost, acquireLayerTextures()).Times(AnyNumber()); | 106 EXPECT_CALL(*m_layerTreeHost, acquireLayerTextures()).Times(AnyNumber()); |
| 107 EXPECT_CALL(*m_layerTreeHost, setNeedsCommit()).Times(AnyNumber()); | 107 EXPECT_CALL(*m_layerTreeHost, setNeedsCommit()).Times(AnyNumber()); |
| 108 m_layerTreeHost->setRootLayer(testLayer); | 108 m_layerTreeHost->setRootLayer(testLayer); |
| 109 testLayer->setTextureId(1); | 109 testLayer->setTextureId(1); |
| 110 testLayer->setIsDrawable(true); | 110 testLayer->setIsDrawable(true); |
| 111 Mock::VerifyAndClearExpectations(m_layerTreeHost.get()); | 111 Mock::VerifyAndClearExpectations(m_layerTreeHost.get()); |
| 112 EXPECT_EQ(testLayer->layerTreeHost(), m_layerTreeHost.get()); | 112 EXPECT_EQ(testLayer->layerTreeHost(), m_layerTreeHost.get()); |
| 113 | 113 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 Mock::VerifyAndClearExpectations(m_layerTreeHost.get()); | 179 Mock::VerifyAndClearExpectations(m_layerTreeHost.get()); |
| 180 | 180 |
| 181 EXPECT_CALL(*m_layerTreeHost, acquireLayerTextures()).Times(AtLeast(1)); | 181 EXPECT_CALL(*m_layerTreeHost, acquireLayerTextures()).Times(AtLeast(1)); |
| 182 EXPECT_CALL(*m_layerTreeHost, setNeedsCommit()).Times(AtLeast(1)); | 182 EXPECT_CALL(*m_layerTreeHost, setNeedsCommit()).Times(AtLeast(1)); |
| 183 testLayer->removeFromParent(); | 183 testLayer->removeFromParent(); |
| 184 Mock::VerifyAndClearExpectations(m_layerTreeHost.get()); | 184 Mock::VerifyAndClearExpectations(m_layerTreeHost.get()); |
| 185 } | 185 } |
| 186 | 186 |
| 187 } // namespace | 187 } // namespace |
| 188 } // namespace cc | 188 } // namespace cc |
| OLD | NEW |