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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 1063853005: Unify Android Webview and Chrome's fling (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: add proguard Created 5 years, 6 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.cc ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl_unittest.cc
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index 5e9fcce85e532d4f28a34cfe5fb6f357e6bb9afa..41d9d0012d8b6cc2f860cf36a24066cd6897814b 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -3950,7 +3950,8 @@ class TestScrollOffsetDelegate : public LayerScrollOffsetDelegate {
TestScrollOffsetDelegate()
: page_scale_factor_(0.f),
min_page_scale_factor_(-1.f),
- max_page_scale_factor_(-1.f) {}
+ max_page_scale_factor_(-1.f),
+ needs_animate_(false) {}
~TestScrollOffsetDelegate() override {}
@@ -3958,7 +3959,11 @@ class TestScrollOffsetDelegate : public LayerScrollOffsetDelegate {
return getter_return_value_;
}
- bool IsExternalFlingActive() const override { return false; }
+ bool IsExternalScrollActive() const override { return false; }
+
+ void SetNeedsAnimate(const AnimationCallback&) override {
+ needs_animate_ = true;
+ }
void UpdateRootLayerState(const gfx::ScrollOffset& total_scroll_offset,
const gfx::ScrollOffset& max_scroll_offset,
@@ -3978,6 +3983,12 @@ class TestScrollOffsetDelegate : public LayerScrollOffsetDelegate {
set_getter_return_value(last_set_scroll_offset_);
}
+ bool GetAndResetNeedsAnimate() {
+ bool needs_animate = needs_animate_;
+ needs_animate_ = false;
+ return needs_animate;
+ }
+
gfx::ScrollOffset last_set_scroll_offset() {
return last_set_scroll_offset_;
}
@@ -4014,8 +4025,10 @@ class TestScrollOffsetDelegate : public LayerScrollOffsetDelegate {
float page_scale_factor_;
float min_page_scale_factor_;
float max_page_scale_factor_;
+ bool needs_animate_;
};
+// TODO(jdduke): Test root fling animation.
TEST_F(LayerTreeHostImplTest, RootLayerScrollOffsetDelegation) {
TestScrollOffsetDelegate scroll_delegate;
host_impl_->SetViewportSize(gfx::Size(10, 20));
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698