Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(352)

Side by Side Diff: cc/texture_layer_unittest.cc

Issue 11344004: Remove WebKit::Platform dependencies from cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix webkit_compositor_bindings_unittests Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/test/web_compositor_initializer.h ('k') | cc/thread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "config.h" 5 #include "config.h"
6 6
7 #include "cc/texture_layer.h" 7 #include "cc/texture_layer.h"
8 8
9 #include "cc/layer_tree_host.h" 9 #include "cc/layer_tree_host.h"
10 #include "cc/single_thread_proxy.h" 10 #include "cc/single_thread_proxy.h"
11 #include "cc/texture_layer_impl.h" 11 #include "cc/texture_layer_impl.h"
12 #include "cc/test/fake_layer_tree_host_client.h" 12 #include "cc/test/fake_layer_tree_host_client.h"
13 #include "cc/test/web_compositor_initializer.h"
14 #include "testing/gmock/include/gmock/gmock.h" 13 #include "testing/gmock/include/gmock/gmock.h"
15 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
16 15
17 using namespace cc; 16 using namespace cc;
18 using ::testing::Mock; 17 using ::testing::Mock;
19 using ::testing::_; 18 using ::testing::_;
20 using ::testing::AtLeast; 19 using ::testing::AtLeast;
21 using ::testing::AnyNumber; 20 using ::testing::AnyNumber;
22 21
23 namespace { 22 namespace {
(...skipping 10 matching lines...) Expand all
34 MOCK_METHOD0(setNeedsCommit, void()); 33 MOCK_METHOD0(setNeedsCommit, void());
35 34
36 private: 35 private:
37 FakeLayerImplTreeHostClient m_fakeClient; 36 FakeLayerImplTreeHostClient m_fakeClient;
38 }; 37 };
39 38
40 39
41 class TextureLayerTest : public testing::Test { 40 class TextureLayerTest : public testing::Test {
42 public: 41 public:
43 TextureLayerTest() 42 TextureLayerTest()
44 : m_compositorInitializer(0)
45 { 43 {
46 } 44 }
47 45
48 protected: 46 protected:
49 virtual void SetUp() 47 virtual void SetUp()
50 { 48 {
51 m_layerTreeHost.reset(new MockLayerImplTreeHost); 49 m_layerTreeHost.reset(new MockLayerImplTreeHost);
52 } 50 }
53 51
54 virtual void TearDown() 52 virtual void TearDown()
55 { 53 {
56 Mock::VerifyAndClearExpectations(m_layerTreeHost.get()); 54 Mock::VerifyAndClearExpectations(m_layerTreeHost.get());
57 EXPECT_CALL(*m_layerTreeHost, acquireLayerTextures()).Times(AnyNumber()) ; 55 EXPECT_CALL(*m_layerTreeHost, acquireLayerTextures()).Times(AnyNumber()) ;
58 EXPECT_CALL(*m_layerTreeHost, setNeedsCommit()).Times(AnyNumber()); 56 EXPECT_CALL(*m_layerTreeHost, setNeedsCommit()).Times(AnyNumber());
59 57
60 m_layerTreeHost->setRootLayer(0); 58 m_layerTreeHost->setRootLayer(0);
61 m_layerTreeHost.reset(); 59 m_layerTreeHost.reset();
62 } 60 }
63 61
64 scoped_ptr<MockLayerImplTreeHost> m_layerTreeHost; 62 scoped_ptr<MockLayerImplTreeHost> m_layerTreeHost;
65 private: 63 private:
66 WebKitTests::WebCompositorInitializer m_compositorInitializer;
67 }; 64 };
68 65
69 TEST_F(TextureLayerTest, syncImplWhenChangingTextureId) 66 TEST_F(TextureLayerTest, syncImplWhenChangingTextureId)
70 { 67 {
71 scoped_refptr<TextureLayer> testLayer = TextureLayer::create(0); 68 scoped_refptr<TextureLayer> testLayer = TextureLayer::create(0);
72 ASSERT_TRUE(testLayer); 69 ASSERT_TRUE(testLayer);
73 70
74 EXPECT_CALL(*m_layerTreeHost, acquireLayerTextures()).Times(AnyNumber()); 71 EXPECT_CALL(*m_layerTreeHost, acquireLayerTextures()).Times(AnyNumber());
75 EXPECT_CALL(*m_layerTreeHost, setNeedsCommit()).Times(AnyNumber()); 72 EXPECT_CALL(*m_layerTreeHost, setNeedsCommit()).Times(AnyNumber());
76 m_layerTreeHost->setRootLayer(testLayer); 73 m_layerTreeHost->setRootLayer(testLayer);
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 testLayer->setTextureId(1); 183 testLayer->setTextureId(1);
187 Mock::VerifyAndClearExpectations(m_layerTreeHost.get()); 184 Mock::VerifyAndClearExpectations(m_layerTreeHost.get());
188 185
189 EXPECT_CALL(*m_layerTreeHost, acquireLayerTextures()).Times(AtLeast(1)); 186 EXPECT_CALL(*m_layerTreeHost, acquireLayerTextures()).Times(AtLeast(1));
190 EXPECT_CALL(*m_layerTreeHost, setNeedsCommit()).Times(AtLeast(1)); 187 EXPECT_CALL(*m_layerTreeHost, setNeedsCommit()).Times(AtLeast(1));
191 testLayer->removeFromParent(); 188 testLayer->removeFromParent();
192 Mock::VerifyAndClearExpectations(m_layerTreeHost.get()); 189 Mock::VerifyAndClearExpectations(m_layerTreeHost.get());
193 } 190 }
194 191
195 } // anonymous namespace 192 } // anonymous namespace
OLDNEW
« no previous file with comments | « cc/test/web_compositor_initializer.h ('k') | cc/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698