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

Unified Diff: chrome/browser/ui/tabs/tab_strip_model_unittest.cc

Issue 1131233004: Fixes regression when opening tabs in background with pinned tabs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 5 years, 7 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/tabs/tab_strip_model.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/tabs/tab_strip_model_unittest.cc
diff --git a/chrome/browser/ui/tabs/tab_strip_model_unittest.cc b/chrome/browser/ui/tabs/tab_strip_model_unittest.cc
index b7967ee2b38281ff959ac68dc73c37cb9cab4d66..ad466952576552fdf205aad70a67b525009b9212 100644
--- a/chrome/browser/ui/tabs/tab_strip_model_unittest.cc
+++ b/chrome/browser/ui/tabs/tab_strip_model_unittest.cc
@@ -2688,3 +2688,36 @@ TEST_F(TabStripModelTest, TabBlockedState) {
strip_dst.CloseAllTabs();
strip_src.CloseAllTabs();
}
+
+// Verifies ordering of tabs opened via link from a pinned tab with subsequent
Peter Kasting 2015/05/11 22:10:32 Nit: link -> a link, with -> with a
sky 2015/05/11 22:13:56 Done.
+// pinned tab.
+TEST_F(TabStripModelTest, LinkClicksWithPinnedTabOrdering) {
+ TabStripDummyDelegate delegate;
+ TabStripModel strip(&delegate, profile());
+
+ // Open two pages, pinned.
+ WebContents* page_a_contents = CreateWebContents();
+ strip.AddWebContents(page_a_contents, -1,
+ ui::PAGE_TRANSITION_AUTO_TOPLEVEL,
+ TabStripModel::ADD_ACTIVE | TabStripModel::ADD_PINNED);
+ WebContents* page_b_contents = CreateWebContents();
+ strip.AddWebContents(page_b_contents, -1,
+ ui::PAGE_TRANSITION_AUTO_TOPLEVEL,
+ TabStripModel::ADD_ACTIVE | TabStripModel::ADD_PINNED);
+
+ // Activate the first tab (a).
+ strip.ActivateTabAt(0, true);
+
+ // Open two more tabs as link clicks. The first tab (c) should appear after
+ // the pinned tabs followed by the second tab (d).
+ WebContents* page_c_contents = CreateWebContents();
+ WebContents* page_d_contents = CreateWebContents();
+ strip.AddWebContents(page_c_contents, -1, ui::PAGE_TRANSITION_LINK,
+ TabStripModel::ADD_NONE);
+ strip.AddWebContents(page_d_contents, -1, ui::PAGE_TRANSITION_LINK,
+ TabStripModel::ADD_NONE);
+
+ EXPECT_EQ(2, strip.GetIndexOfWebContents(page_c_contents));
+ EXPECT_EQ(3, strip.GetIndexOfWebContents(page_d_contents));
+ strip.CloseAllTabs();
+}
« no previous file with comments | « chrome/browser/ui/tabs/tab_strip_model.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698