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

Unified Diff: chrome/browser/ui/views/tabs/touch_tab_strip_layout_unittest.cc

Issue 10910005: Makes the tabstrip center the active tab when transitioning from (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | « chrome/browser/ui/views/tabs/touch_tab_strip_layout.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/touch_tab_strip_layout_unittest.cc
diff --git a/chrome/browser/ui/views/tabs/touch_tab_strip_layout_unittest.cc b/chrome/browser/ui/views/tabs/touch_tab_strip_layout_unittest.cc
index c990d8a06dfcb1c66c3ab3742c18cca3a5000f30..0bca7506f2227b49f793ca9253d8e815a6da49cf 100644
--- a/chrome/browser/ui/views/tabs/touch_tab_strip_layout_unittest.cc
+++ b/chrome/browser/ui/views/tabs/touch_tab_strip_layout_unittest.cc
@@ -471,3 +471,29 @@ TEST_F(TouchTabStripLayoutTest, SetXAndMiniCount) {
Reset(layout_.get(), 0, 400, 0, 0);
layout_->SetXAndMiniCount(0, 1);
}
+
+// Assertions around SetXAndMiniCount.
+TEST_F(TouchTabStripLayoutTest, SetActiveTabLocation) {
+ struct TestData {
+ struct CommonTestData common_data;
+ const int location;
+ } test_data[] = {
+ // Active tab is the first tab, can't be moved.
+ { { 0, 300, 100, -10, 2, 0, 0, "", "0 90 180 194 196 198 200" }, 50 },
+
+ // Active tab is pinned; should result in nothing.
+ { { 0, 300, 100, -10, 2, 2, 1, "", "0 0 0 90 180 198 200" }, 199 },
+
+ // Location is too far to the right, ends up being pushed in.
+ { { 0, 300, 100, -10, 2, 0, 3, "", "0 14 104 194 196 198 200" }, 199 },
+
+ // Location can be honored.
+ { { 0, 300, 100, -10, 2, 0, 3, "", "0 2 4 40 130 198 200" }, 40 },
+ };
+ for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_data); ++i) {
+ CreateLayout(test_data[i].common_data);
+ layout_->SetActiveTabLocation(test_data[i].location);
+ EXPECT_EQ(test_data[i].common_data.expected_bounds, BoundsString()) <<
+ " at " << i;
+ }
+}
« no previous file with comments | « chrome/browser/ui/views/tabs/touch_tab_strip_layout.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698