diff options
author | sunxd <sunxd@chromium.org> | 2016-03-09 13:13:42 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-09 21:14:58 +0000 |
commit | b7e79438b4ba2ccba51235a0fc2bf13b7f173709 (patch) | |
tree | 5e6c21f7822428dd9c95ae6b1d2ce0e13dbfa04b /cc/test | |
parent | 3afd79a945a33ba887c01a2935798cdbb1dd0496 (diff) | |
download | chromium_src-b7e79438b4ba2ccba51235a0fc2bf13b7f173709.zip chromium_src-b7e79438b4ba2ccba51235a0fc2bf13b7f173709.tar.gz chromium_src-b7e79438b4ba2ccba51235a0fc2bf13b7f173709.tar.bz2 |
Clean LayerImpl's scroll offset callers in unit tests.
The getter ScrollDelta is left because it is called by
property tree builder.
LayerImpl is now not aware of the internal logic of synced
property.
BUG=568830
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1766053002
Cr-Commit-Position: refs/heads/master@{#380217}
Diffstat (limited to 'cc/test')
-rw-r--r-- | cc/test/layer_tree_host_common_test.h | 8 | ||||
-rw-r--r-- | cc/test/layer_tree_test.h | 10 |
2 files changed, 18 insertions, 0 deletions
diff --git a/cc/test/layer_tree_host_common_test.h b/cc/test/layer_tree_host_common_test.h index 2a66715..1717d13 100644 --- a/cc/test/layer_tree_host_common_test.h +++ b/cc/test/layer_tree_host_common_test.h @@ -159,6 +159,14 @@ class LayerTreeHostCommonTest : public LayerTreeHostCommonTestBase, public: LayerTreeHostCommonTest(); explicit LayerTreeHostCommonTest(const LayerTreeSettings& settings); + + protected: + static void SetScrollOffsetDelta(LayerImpl* layer_impl, + const gfx::Vector2dF& delta) { + layer_impl->SetCurrentScrollOffset( + layer_impl->synced_scroll_offset()->ActiveBase() + + gfx::ScrollOffset(delta)); + } }; } // namespace cc diff --git a/cc/test/layer_tree_test.h b/cc/test/layer_tree_test.h index 5a7f111..2b9a91a 100644 --- a/cc/test/layer_tree_test.h +++ b/cc/test/layer_tree_test.h @@ -191,6 +191,16 @@ class LayerTreeTest : public testing::Test, public TestHooks { bool IsRemoteTest() const; + static gfx::Vector2dF ScrollDelta(LayerImpl* layer_impl) { + if (layer_impl->IsActive()) + return gfx::Vector2dF(layer_impl->synced_scroll_offset()->Delta().x(), + layer_impl->synced_scroll_offset()->Delta().y()); + else + return gfx::Vector2dF( + layer_impl->synced_scroll_offset()->PendingDelta().get().x(), + layer_impl->synced_scroll_offset()->PendingDelta().get().y()); + } + private: LayerTreeSettings settings_; LayerSettings layer_settings_; |