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

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

Issue 2107603002: Makes the pinned tab title change indicator hide correctly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback 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 | « chrome/browser/ui/views/tabs/tab_strip.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/tab_strip_unittest.cc
diff --git a/chrome/browser/ui/views/tabs/tab_strip_unittest.cc b/chrome/browser/ui/views/tabs/tab_strip_unittest.cc
index 8ab4a56f9da325ca789e7396b9d8cb1232b5ad46..e4c6cd0529a97e169b29169972475cbb7f32629d 100644
--- a/chrome/browser/ui/views/tabs/tab_strip_unittest.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip_unittest.cc
@@ -8,6 +8,7 @@
#include "base/message_loop/message_loop.h"
#include "chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.h"
#include "chrome/browser/ui/views/tabs/tab.h"
+#include "chrome/browser/ui/views/tabs/tab_renderer_data.h"
#include "chrome/browser/ui/views/tabs/tab_strip.h"
#include "chrome/browser/ui/views/tabs/tab_strip_controller.h"
#include "chrome/browser/ui/views/tabs/tab_strip_observer.h"
@@ -127,6 +128,11 @@ class TabStripTest : public views::ViewsTestBase {
}
protected:
+ bool IsShowingPinnedTabTitleChangedIndicator(int model_index) {
+ return tab_strip_->tab_at(model_index)
+ ->showing_pinned_tab_title_changed_indicator_;
+ }
+
// Returns the rectangular hit test region of |tab| in |tab|'s local
// coordinate space.
gfx::Rect GetTabHitTestMask(Tab* tab) {
@@ -635,3 +641,26 @@ TEST_F(TabStripTest, NewTabButtonStaysVisible) {
EXPECT_LE(tab_strip_->GetNewTabButtonBounds().right(), kTabStripWidth);
}
+
+TEST_F(TabStripTest, PinnedTabTitleChangedIndicatorHidesOnSelect) {
+ for (int i = 0; i < 2; ++i)
+ controller_->AddTab(i, (i == 0));
+
+ // Two tabs, both pinned.
+ TabRendererData pinned_data;
+ pinned_data.pinned = true;
+ tab_strip_->SetTabData(0, pinned_data);
+ tab_strip_->SetTabData(1, pinned_data);
+
+ EXPECT_FALSE(IsShowingPinnedTabTitleChangedIndicator(0));
+ EXPECT_FALSE(IsShowingPinnedTabTitleChangedIndicator(1));
+
+ // Change the title of the second tab (first tab is selected).
+ tab_strip_->TabTitleChangedNotLoading(1);
+ // Indicator should be shown.
+ EXPECT_TRUE(IsShowingPinnedTabTitleChangedIndicator(1));
+ // Select the second tab.
+ controller_->SelectTab(1);
+ // Indicator should hide.
+ EXPECT_FALSE(IsShowingPinnedTabTitleChangedIndicator(1));
+}
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698