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

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

Issue 2497373003: Add tab status to accessibility labels (Closed)
Patch Set: Fix unit tests Created 4 years 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
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 override {
85 base::string16 title;
86 return title;
dmazzoni 2016/12/12 18:26:01 Same: just return base::string16();
edwardjung 2016/12/12 19:16:20 Done.
87 };
sky 2016/12/12 17:25:09 no ;
edwardjung 2016/12/12 19:16:20 Done.
84 88
85 private: 89 private:
86 ui::ListSelectionModel selection_model_; 90 ui::ListSelectionModel selection_model_;
87 bool immersive_style_ = false; 91 bool immersive_style_ = false;
88 bool active_tab_ = false; 92 bool active_tab_ = false;
89 bool paint_throbber_to_layer_ = true; 93 bool paint_throbber_to_layer_ = true;
90 94
91 DISALLOW_COPY_AND_ASSIGN(FakeTabController); 95 DISALLOW_COPY_AND_ASSIGN(FakeTabController);
92 }; 96 };
93 97
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 } 492 }
489 493
490 TEST_F(TabTest, TitleHiddenWhenSmall) { 494 TEST_F(TabTest, TitleHiddenWhenSmall) {
491 FakeTabController tab_controller; 495 FakeTabController tab_controller;
492 Tab tab(&tab_controller, nullptr); 496 Tab tab(&tab_controller, nullptr);
493 tab.SetBounds(0, 0, 100, 50); 497 tab.SetBounds(0, 0, 100, 50);
494 EXPECT_GT(GetTitleWidth(tab), 0); 498 EXPECT_GT(GetTitleWidth(tab), 0);
495 tab.SetBounds(0, 0, 0, 50); 499 tab.SetBounds(0, 0, 0, 50);
496 EXPECT_EQ(0, GetTitleWidth(tab)); 500 EXPECT_EQ(0, GetTitleWidth(tab));
497 } 501 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698