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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 274323004: NOT FOR LANDING - [WebView] Allow fling animation via the LayerScrollOffsetDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test Created 5 years, 10 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') | content/browser/android/in_process/synchronous_compositor_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 110bee999392e7e66db813e375deca2ff781de9b..bf5da96d4a249b62b943aa380b44e9e84681d7a5 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -3897,7 +3897,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 {}
@@ -3907,6 +3908,10 @@ class TestScrollOffsetDelegate : public LayerScrollOffsetDelegate {
bool IsExternalFlingActive() 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,
const gfx::SizeF& scrollable_size,
@@ -3925,6 +3930,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_;
}
@@ -3961,8 +3972,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') | content/browser/android/in_process/synchronous_compositor_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698