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

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

Issue 10407110: Adds clipping to the tabs when stacked. This is necessary so we don't (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test Created 8 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 unified diff | Download patch | Annotate | Revision Log
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 "chrome/browser/ui/tabs/tab_strip_selection_model.h" 7 #include "chrome/browser/ui/tabs/tab_strip_selection_model.h"
8 #include "chrome/browser/ui/views/tabs/tab_controller.h" 8 #include "chrome/browser/ui/views/tabs/tab_controller.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "ui/views/test/views_test_base.h" 10 #include "ui/views/test/views_test_base.h"
(...skipping 29 matching lines...) Expand all
40 BaseTab* tab, 40 BaseTab* tab,
41 const views::MouseEvent& event, 41 const views::MouseEvent& event,
42 const TabStripSelectionModel& original_selection) OVERRIDE {} 42 const TabStripSelectionModel& original_selection) OVERRIDE {}
43 virtual void ContinueDrag(const views::MouseEvent& event) OVERRIDE {} 43 virtual void ContinueDrag(const views::MouseEvent& event) OVERRIDE {}
44 virtual bool EndDrag(bool canceled) OVERRIDE { return false; } 44 virtual bool EndDrag(bool canceled) OVERRIDE { return false; }
45 virtual BaseTab* GetTabAt(BaseTab* tab, 45 virtual BaseTab* GetTabAt(BaseTab* tab,
46 const gfx::Point& tab_in_tab_coordinates) OVERRIDE { 46 const gfx::Point& tab_in_tab_coordinates) OVERRIDE {
47 return NULL; 47 return NULL;
48 } 48 }
49 virtual void ClickActiveTab(const BaseTab* tab) const OVERRIDE {} 49 virtual void ClickActiveTab(const BaseTab* tab) const OVERRIDE {}
50 virtual bool ShouldPaintTab(const BaseTab* tab, gfx::Rect* clip) OVERRIDE {
51 return true;
52 }
50 53
51 private: 54 private:
52 TabStripSelectionModel selection_model_; 55 TabStripSelectionModel selection_model_;
53 56
54 DISALLOW_COPY_AND_ASSIGN(FakeTabController); 57 DISALLOW_COPY_AND_ASSIGN(FakeTabController);
55 }; 58 };
56 59
57 typedef views::ViewsTestBase TabTest; 60 typedef views::ViewsTestBase TabTest;
58 61
59 TEST_F(TabTest, HitTestTopPixel) { 62 TEST_F(TabTest, HitTestTopPixel) {
(...skipping 18 matching lines...) Expand all
78 81
79 // If the window is maximized, however, we want clicks in the top edge to 82 // If the window is maximized, however, we want clicks in the top edge to
80 // select the tab. 83 // select the tab.
81 widget.Maximize(); 84 widget.Maximize();
82 EXPECT_TRUE(tab.HitTest(gfx::Point(middle_x, 0))); 85 EXPECT_TRUE(tab.HitTest(gfx::Point(middle_x, 0)));
83 86
84 // But clicks in the area above the slanted sides should still miss. 87 // But clicks in the area above the slanted sides should still miss.
85 EXPECT_FALSE(tab.HitTest(gfx::Point(0, 0))); 88 EXPECT_FALSE(tab.HitTest(gfx::Point(0, 0)));
86 EXPECT_FALSE(tab.HitTest(gfx::Point(tab.width() - 1, 0))); 89 EXPECT_FALSE(tab.HitTest(gfx::Point(tab.width() - 1, 0)));
87 } 90 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.cc ('k') | chrome/browser/ui/views/tabs/touch_tab_strip_layout.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698