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

Unified Diff: cc/layers/layer_impl_unittest.cc

Issue 665233004: Make aborted commits inform the scroll delegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add early return and update comment Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl_unittest.cc
diff --git a/cc/layers/layer_impl_unittest.cc b/cc/layers/layer_impl_unittest.cc
index 99673f6146b7495e83cbf4279c58cf2308d6698f..725573d514c378d72ecfa27698575a48d8698602 100644
--- a/cc/layers/layer_impl_unittest.cc
+++ b/cc/layers/layer_impl_unittest.cc
@@ -497,7 +497,13 @@ TEST_F(LayerImplScrollTest, ScrollByWithNonZeroOffset) {
class ScrollDelegateIgnore : public LayerImpl::ScrollOffsetDelegate {
public:
- void SetTotalScrollOffset(const gfx::ScrollOffset& new_value) override {}
+ void SetTotalScrollOffset(const gfx::ScrollOffset& new_value) override {
+ last_attempted_set_offset_ = new_value;
+ }
+ gfx::ScrollOffset last_attempted_set_offset() const {
+ return last_attempted_set_offset_;
+ }
+
gfx::ScrollOffset GetTotalScrollOffset() override {
return gfx::ScrollOffset(fixed_offset_);
}
@@ -509,6 +515,7 @@ class ScrollDelegateIgnore : public LayerImpl::ScrollOffsetDelegate {
}
private:
+ gfx::ScrollOffset last_attempted_set_offset_;
gfx::Vector2dF fixed_offset_;
};
@@ -632,6 +639,8 @@ TEST_F(LayerImplScrollTest, ApplySentScrollsWithIgnoringDelegate) {
layer()->ApplySentScrollDeltasFromAbortedCommit();
+ EXPECT_VECTOR_EQ(fixed_offset, delegate.last_attempted_set_offset());
+
EXPECT_VECTOR_EQ(fixed_offset, layer()->TotalScrollOffset());
EXPECT_VECTOR_EQ(gfx::ScrollOffsetWithDelta(scroll_offset, sent_scroll_delta),
layer()->scroll_offset());
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698