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

Side by Side Diff: chrome/browser/ui/views/tabs/tab_unittest.cc

Issue 2581023002: Add tab status to accessibility labels (Closed)
Patch Set: Return early if invalid tab index Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip_controller.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/tabs/tab.h" 5 #include "chrome/browser/ui/views/tabs/tab.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 return paint_throbber_to_layer_; 74 return paint_throbber_to_layer_;
75 } 75 }
76 bool IsImmersiveStyle() const override { return immersive_style_; } 76 bool IsImmersiveStyle() const override { return immersive_style_; }
77 SkColor GetToolbarTopSeparatorColor() const override { return SK_ColorBLACK; } 77 SkColor GetToolbarTopSeparatorColor() const override { return SK_ColorBLACK; }
78 int GetBackgroundResourceId(bool* custom_image) const override { 78 int GetBackgroundResourceId(bool* custom_image) const override {
79 *custom_image = false; 79 *custom_image = false;
80 return IDR_THEME_TAB_BACKGROUND; 80 return IDR_THEME_TAB_BACKGROUND;
81 } 81 }
82 void UpdateTabAccessibilityState(const Tab* tab, 82 void UpdateTabAccessibilityState(const Tab* tab,
83 ui::AXNodeData* node_data) override{}; 83 ui::AXNodeData* node_data) override{};
84 base::string16 GetAccessibleTabName(const Tab* tab) const override {
85 return base::string16();
86 }
84 87
85 private: 88 private:
86 ui::ListSelectionModel selection_model_; 89 ui::ListSelectionModel selection_model_;
87 bool immersive_style_ = false; 90 bool immersive_style_ = false;
88 bool active_tab_ = false; 91 bool active_tab_ = false;
89 bool paint_throbber_to_layer_ = true; 92 bool paint_throbber_to_layer_ = true;
90 93
91 DISALLOW_COPY_AND_ASSIGN(FakeTabController); 94 DISALLOW_COPY_AND_ASSIGN(FakeTabController);
92 }; 95 };
93 96
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 } 491 }
489 492
490 TEST_F(TabTest, TitleHiddenWhenSmall) { 493 TEST_F(TabTest, TitleHiddenWhenSmall) {
491 FakeTabController tab_controller; 494 FakeTabController tab_controller;
492 Tab tab(&tab_controller, nullptr); 495 Tab tab(&tab_controller, nullptr);
493 tab.SetBounds(0, 0, 100, 50); 496 tab.SetBounds(0, 0, 100, 50);
494 EXPECT_GT(GetTitleWidth(tab), 0); 497 EXPECT_GT(GetTitleWidth(tab), 0);
495 tab.SetBounds(0, 0, 0, 50); 498 tab.SetBounds(0, 0, 0, 50);
496 EXPECT_EQ(0, GetTitleWidth(tab)); 499 EXPECT_EQ(0, GetTitleWidth(tab));
497 } 500 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698