| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "CCLayerTreeHost.h" | 7 #include "CCLayerTreeHost.h" |
| 8 | 8 |
| 9 #include "CCGeometryTestUtils.h" | 9 #include "CCGeometryTestUtils.h" |
| 10 #include "CCGraphicsContext.h" | 10 #include "CCGraphicsContext.h" |
| (...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 virtual void beginTest() OVERRIDE | 962 virtual void beginTest() OVERRIDE |
| 963 { | 963 { |
| 964 m_layerTreeHost->rootLayer()->setScrollable(true); | 964 m_layerTreeHost->rootLayer()->setScrollable(true); |
| 965 m_layerTreeHost->rootLayer()->setScrollPosition(m_initialScroll); | 965 m_layerTreeHost->rootLayer()->setScrollPosition(m_initialScroll); |
| 966 postSetNeedsCommitToMainThread(); | 966 postSetNeedsCommitToMainThread(); |
| 967 } | 967 } |
| 968 | 968 |
| 969 virtual void beginCommitOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE | 969 virtual void beginCommitOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE |
| 970 { | 970 { |
| 971 LayerChromium* root = m_layerTreeHost->rootLayer(); | 971 LayerChromium* root = m_layerTreeHost->rootLayer(); |
| 972 if (!impl->sourceFrameNumber()) | 972 if (!m_layerTreeHost->commitNumber()) |
| 973 EXPECT_EQ(root->scrollPosition(), m_initialScroll); | 973 EXPECT_EQ(root->scrollPosition(), m_initialScroll); |
| 974 else if (impl->sourceFrameNumber() == 1) | 974 else if (m_layerTreeHost->commitNumber() == 1) |
| 975 EXPECT_EQ(root->scrollPosition(), m_initialScroll + m_scrollAmount +
m_scrollAmount); | 975 EXPECT_EQ(root->scrollPosition(), m_initialScroll + m_scrollAmount +
m_scrollAmount); |
| 976 else if (impl->sourceFrameNumber() == 2) | 976 else if (m_layerTreeHost->commitNumber() == 2) |
| 977 EXPECT_EQ(root->scrollPosition(), m_initialScroll + m_scrollAmount +
m_scrollAmount); | 977 EXPECT_EQ(root->scrollPosition(), m_initialScroll + m_scrollAmount +
m_scrollAmount); |
| 978 } | 978 } |
| 979 | 979 |
| 980 virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE | 980 virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE |
| 981 { | 981 { |
| 982 CCLayerImpl* root = impl->rootLayer(); | 982 CCLayerImpl* root = impl->rootLayer(); |
| 983 root->setScrollable(true); | 983 root->setScrollable(true); |
| 984 root->setMaxScrollPosition(IntSize(100, 100)); | 984 root->setMaxScrollPosition(IntSize(100, 100)); |
| 985 | 985 |
| 986 if (!impl->sourceFrameNumber() && impl->sourceAnimationFrameNumber() ==
1) { | 986 if (!impl->sourceFrameNumber() && impl->sourceAnimationFrameNumber() ==
1) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1018 virtual void afterTest() OVERRIDE | 1018 virtual void afterTest() OVERRIDE |
| 1019 { | 1019 { |
| 1020 EXPECT_EQ(1, m_scrolls); | 1020 EXPECT_EQ(1, m_scrolls); |
| 1021 } | 1021 } |
| 1022 private: | 1022 private: |
| 1023 IntPoint m_initialScroll; | 1023 IntPoint m_initialScroll; |
| 1024 IntSize m_scrollAmount; | 1024 IntSize m_scrollAmount; |
| 1025 int m_scrolls; | 1025 int m_scrolls; |
| 1026 }; | 1026 }; |
| 1027 | 1027 |
| 1028 TEST_F(CCLayerTreeHostTestScrollMultipleRedraw, DISABLED_runMultiThread) | 1028 TEST_F(CCLayerTreeHostTestScrollMultipleRedraw, runMultiThread) |
| 1029 { | 1029 { |
| 1030 runTest(true); | 1030 runTest(true); |
| 1031 } | 1031 } |
| 1032 | 1032 |
| 1033 // This test verifies that properties on the layer tree host are commited to the
impl side. | 1033 // This test verifies that properties on the layer tree host are commited to the
impl side. |
| 1034 class CCLayerTreeHostTestCommit : public CCLayerTreeHostTest { | 1034 class CCLayerTreeHostTestCommit : public CCLayerTreeHostTest { |
| 1035 public: | 1035 public: |
| 1036 | 1036 |
| 1037 CCLayerTreeHostTestCommit() { } | 1037 CCLayerTreeHostTestCommit() { } |
| 1038 | 1038 |
| (...skipping 1949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2988 int m_numCommitComplete; | 2988 int m_numCommitComplete; |
| 2989 int m_numDrawLayers; | 2989 int m_numDrawLayers; |
| 2990 }; | 2990 }; |
| 2991 | 2991 |
| 2992 TEST_F(CCLayerTreeHostTestContinuousAnimate, runMultiThread) | 2992 TEST_F(CCLayerTreeHostTestContinuousAnimate, runMultiThread) |
| 2993 { | 2993 { |
| 2994 runTest(true); | 2994 runTest(true); |
| 2995 } | 2995 } |
| 2996 | 2996 |
| 2997 } // namespace | 2997 } // namespace |
| OLD | NEW |