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

Unified Diff: third_party/WebKit/Source/web/tests/TopControlsTest.cpp

Issue 2105523002: Don't set shownRatio in main thread top controls on animated state change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Improved test a bit Created 4 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 | « third_party/WebKit/Source/web/WebViewImpl.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/tests/TopControlsTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/TopControlsTest.cpp b/third_party/WebKit/Source/web/tests/TopControlsTest.cpp
index a179c520e1466633709cfc736c74f20afa421c3e..42af87a8b541ac9aac38d108d18d2ca511fb962d 100644
--- a/third_party/WebKit/Source/web/tests/TopControlsTest.cpp
+++ b/third_party/WebKit/Source/web/tests/TopControlsTest.cpp
@@ -559,6 +559,21 @@ TEST_F(TopControlsTest, MAYBE(StateConstraints))
EXPECT_FLOAT_EQ(20, webView->topControls().contentOffset());
webView->updateTopControlsState(WebTopControlsBoth, WebTopControlsBoth, false);
EXPECT_FLOAT_EQ(20, webView->topControls().contentOffset());
+
+ // An animated state change shouldn't cause a change to the content offset
+ // since it'll be driven from the compositor.
+ webView->updateTopControlsState(WebTopControlsHidden, WebTopControlsHidden, true);
+ EXPECT_FLOAT_EQ(20, webView->topControls().contentOffset());
+
+ webView->updateTopControlsState(WebTopControlsShown, WebTopControlsShown, true);
+ EXPECT_FLOAT_EQ(20, webView->topControls().contentOffset());
+
+ // Setting just the constraint should affect the content offset.
+ webView->updateTopControlsState(WebTopControlsHidden, WebTopControlsBoth, false);
+ EXPECT_FLOAT_EQ(0, webView->topControls().contentOffset());
+
+ webView->updateTopControlsState(WebTopControlsShown, WebTopControlsBoth, false);
+ EXPECT_FLOAT_EQ(50, webView->topControls().contentOffset());
}
// Ensure that top controls do not affect the layout by showing and hiding
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698