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

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

Issue 2963023002: [stacked tabs] Fix stacking logic with 'open link in new tab' (Closed)
Patch Set: Created 3 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
Index: chrome/browser/ui/views/tabs/stacked_tab_strip_layout_unittest.cc
diff --git a/chrome/browser/ui/views/tabs/stacked_tab_strip_layout_unittest.cc b/chrome/browser/ui/views/tabs/stacked_tab_strip_layout_unittest.cc
index 470d5cb34d2aff6a84fe52e2118db8f8cd79faa3..f69fb5cfefbc8a18993f3c665265ecf4ff4fa7e4 100644
--- a/chrome/browser/ui/views/tabs/stacked_tab_strip_layout_unittest.cc
+++ b/chrome/browser/ui/views/tabs/stacked_tab_strip_layout_unittest.cc
@@ -322,15 +322,38 @@ TEST_F(StackedTabStripLayoutTest, AddTab) {
bool add_active;
bool add_pinned;
} test_data[] = {
- // Adding a background tab test cases.
{ { 0, 300, 100, 10, 2, 0, 1, "0 90 180 198 200", "0 16 106 196 198 200"},
3, false, false },
+
+ // If the active tab is in its leftmost position and it is not possible
+ // for all of the tabs between the active tab and the newly-added tab
+ // (inclusive) to be shown, then a stack should form to the right of
+ // the active tab.
+ { { 0, 284, 100, 10, 2, 0, 2, "0 2 4 94 184", "0 2 4 6 94 184"},
+ 5, false, false },
{ { 0, 300, 100, 10, 2, 0, 1, "0 90 180 198 200", "0 2 4 20 110 200"},
5, false, false },
+
{ { 0, 300, 100, 10, 2, 0, 1, "0 90 180 198 200", "0 90 180 196 198 200"},
2, false, false },
- { { 0, 300, 100, 10, 2, 0, 1, "0 90 180 198 200", "0 2 4 94 184 200"},
- 0, false, false },
+
+ // Add to the end of the tab strip. All tabs between the active tab and the
+ // newly-added tab (inclusive) should be fully visible (indices 3-5 in the
+ // resulting tab strip) and tabs to the left of the active tab should be
+ // stacked at the left side of the tab strip rather than immediately to the
+ // left of the active tab.
+ { { 0, 300, 100, 10, 2, 0, 3, "0 90 180 198 200", "0 2 4 20 110 200"},
+ 5, false, false },
+
+ // If it is possible for all of the tabs between the active tab and the
+ // newly-added tab (inclusive) to be fully visible without changing the
+ // position of the active tab, then do not do so.
+ { { 0, 378, 100, 10, 2, 0, 2, "0 2 4 94 184 274 276 278",
+ "0 2 4 94 184 272 274 276 278"},
+ 3, false, false },
+ { { 0, 378, 100, 10, 2, 0, 2, "0 2 4 94 184 274 276 278",
+ "0 2 4 94 184 272 274 276 278"},
+ 4, false, false },
{ { 4, 200, 100, 10, 2, 1, 2, "0 4 10 100", "0 0 8 10 100"},
1, false, true },

Powered by Google App Engine
This is Rietveld 408576698