OLD | NEW |
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 virtual BaseTab* GetTabAt(BaseTab* tab, | 43 virtual BaseTab* GetTabAt(BaseTab* tab, |
44 const gfx::Point& tab_in_tab_coordinates) OVERRIDE { | 44 const gfx::Point& tab_in_tab_coordinates) OVERRIDE { |
45 return NULL; | 45 return NULL; |
46 } | 46 } |
47 virtual void ClickActiveTab(const BaseTab* tab) const OVERRIDE {} | 47 virtual void ClickActiveTab(const BaseTab* tab) const OVERRIDE {} |
48 virtual void OnMouseEventInTab(views::View* source, | 48 virtual void OnMouseEventInTab(views::View* source, |
49 const views::MouseEvent& event) OVERRIDE {} | 49 const views::MouseEvent& event) OVERRIDE {} |
50 virtual bool ShouldPaintTab(const BaseTab* tab, gfx::Rect* clip) OVERRIDE { | 50 virtual bool ShouldPaintTab(const BaseTab* tab, gfx::Rect* clip) OVERRIDE { |
51 return true; | 51 return true; |
52 } | 52 } |
| 53 virtual bool IsInstantExtendedAPIEnabled() OVERRIDE { |
| 54 return false; |
| 55 } |
53 | 56 |
54 private: | 57 private: |
55 TabStripSelectionModel selection_model_; | 58 TabStripSelectionModel selection_model_; |
56 | 59 |
57 DISALLOW_COPY_AND_ASSIGN(FakeTabController); | 60 DISALLOW_COPY_AND_ASSIGN(FakeTabController); |
58 }; | 61 }; |
59 | 62 |
60 typedef views::ViewsTestBase TabTest; | 63 typedef views::ViewsTestBase TabTest; |
61 | 64 |
62 TEST_F(TabTest, HitTestTopPixel) { | 65 TEST_F(TabTest, HitTestTopPixel) { |
(...skipping 18 matching lines...) Expand all Loading... |
81 | 84 |
82 // If the window is maximized, however, we want clicks in the top edge to | 85 // If the window is maximized, however, we want clicks in the top edge to |
83 // select the tab. | 86 // select the tab. |
84 widget.Maximize(); | 87 widget.Maximize(); |
85 EXPECT_TRUE(tab.HitTest(gfx::Point(middle_x, 0))); | 88 EXPECT_TRUE(tab.HitTest(gfx::Point(middle_x, 0))); |
86 | 89 |
87 // But clicks in the area above the slanted sides should still miss. | 90 // But clicks in the area above the slanted sides should still miss. |
88 EXPECT_FALSE(tab.HitTest(gfx::Point(0, 0))); | 91 EXPECT_FALSE(tab.HitTest(gfx::Point(0, 0))); |
89 EXPECT_FALSE(tab.HitTest(gfx::Point(tab.width() - 1, 0))); | 92 EXPECT_FALSE(tab.HitTest(gfx::Point(tab.width() - 1, 0))); |
90 } | 93 } |
OLD | NEW |