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

Unified Diff: ui/views/controls/scrollbar/scrollbar_unittest.cc

Issue 171423003: Update local BaseScrollBar::contents_scroll_offset_ on Update. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Keep disabled tests disabled. Created 6 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 | « ui/views/controls/scrollbar/native_scroll_bar.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/scrollbar/scrollbar_unittest.cc
diff --git a/ui/views/controls/scrollbar/scrollbar_unittest.cc b/ui/views/controls/scrollbar/scrollbar_unittest.cc
index cdf256a6207925b023a1a1874ff420604faf6e1e..c3c96df9b038dcf3115893f30d177cc3f0b46289 100644
--- a/ui/views/controls/scrollbar/scrollbar_unittest.cc
+++ b/ui/views/controls/scrollbar/scrollbar_unittest.cc
@@ -156,4 +156,15 @@ TEST_F(NativeScrollBarTest, MAYBE_ScrollBarFitsToBottom) {
scrollbar_->GetPosition());
}
+TEST_F(NativeScrollBarTest, ScrollToEndAfterShrinkAndExpand) {
+ // Scroll to the end of the content.
+ scrollbar_->Update(100, 101, 0);
+ EXPECT_TRUE(scrollbar_->ScrollByContentsOffset(-1));
+ // Shrink and then re-exapnd the content.
+ scrollbar_->Update(100, 100, 0);
+ scrollbar_->Update(100, 101, 0);
+ // Ensure the scrollbar allows scrolling to the end.
+ EXPECT_TRUE(scrollbar_->ScrollByContentsOffset(-1));
+}
+
} // namespace views
« no previous file with comments | « ui/views/controls/scrollbar/native_scroll_bar.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698