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

Unified Diff: cc/trees/layer_tree_host_unittest_scroll.cc

Issue 1015273002: Add back the truncation of scroll_delta (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove blank line Created 5 years, 9 months 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/trees/layer_tree_host_impl_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest_scroll.cc
diff --git a/cc/trees/layer_tree_host_unittest_scroll.cc b/cc/trees/layer_tree_host_unittest_scroll.cc
index 547ece77c2094128d56a6513eab8a54d588b0fe8..fce09d4e146f68b97ec07f5cca2b32a55daefde3 100644
--- a/cc/trees/layer_tree_host_unittest_scroll.cc
+++ b/cc/trees/layer_tree_host_unittest_scroll.cc
@@ -429,14 +429,19 @@ class LayerTreeHostScrollTestFractionalScroll : public LayerTreeHostScrollTest {
PostSetNeedsCommitToMainThread();
break;
case 1:
- EXPECT_VECTOR_EQ(scroll_layer->BaseScrollOffset(), scroll_amount_);
- EXPECT_VECTOR_EQ(scroll_layer->ScrollDelta(), gfx::Vector2dF());
+ EXPECT_VECTOR_EQ(scroll_layer->BaseScrollOffset(),
+ gfx::ToFlooredVector2d(scroll_amount_));
+ EXPECT_VECTOR_EQ(scroll_layer->ScrollDelta(),
+ gfx::Vector2dF(fmod(scroll_amount_.x(), 1.0f), 0.0f));
PostSetNeedsCommitToMainThread();
break;
case 2:
- EXPECT_VECTOR_EQ(scroll_layer->BaseScrollOffset(),
- (scroll_amount_ + scroll_amount_));
- EXPECT_VECTOR_EQ(scroll_layer->ScrollDelta(), gfx::Vector2dF());
+ EXPECT_VECTOR_EQ(
+ scroll_layer->BaseScrollOffset(),
+ gfx::ToFlooredVector2d(scroll_amount_ + scroll_amount_));
+ EXPECT_VECTOR_EQ(
+ scroll_layer->ScrollDelta(),
+ gfx::Vector2dF(fmod(2.0f * scroll_amount_.x(), 1.0f), 0.0f));
EndTest();
break;
}
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698