OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
6 | 6 |
7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
8 #include "chrome/browser/ui/browser_commands.h" | 8 #include "chrome/browser/ui/browser_commands.h" |
9 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" | 9 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" |
10 #include "chrome/browser/ui/views/frame/browser_view_layout.h" | 10 #include "chrome/browser/ui/views/frame/browser_view_layout.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 // Test basic construction and initialization. | 40 // Test basic construction and initialization. |
41 TEST_F(BrowserViewTest, BrowserView) { | 41 TEST_F(BrowserViewTest, BrowserView) { |
42 // The window is owned by the native widget, not the test class. | 42 // The window is owned by the native widget, not the test class. |
43 EXPECT_FALSE(window()); | 43 EXPECT_FALSE(window()); |
44 | 44 |
45 EXPECT_TRUE(browser_view()->browser()); | 45 EXPECT_TRUE(browser_view()->browser()); |
46 | 46 |
47 // Test initial state. | 47 // Test initial state. |
48 EXPECT_TRUE(browser_view()->IsTabStripVisible()); | 48 EXPECT_TRUE(browser_view()->IsTabStripVisible()); |
49 EXPECT_FALSE(browser_view()->IsOffTheRecord()); | 49 EXPECT_FALSE(browser_view()->IsOffTheRecord()); |
50 EXPECT_EQ(IDR_OTR_ICON, browser_view()->GetOTRIconResourceID()); | |
51 EXPECT_FALSE(browser_view()->IsGuestSession()); | 50 EXPECT_FALSE(browser_view()->IsGuestSession()); |
52 EXPECT_FALSE(browser_view()->ShouldShowAvatar()); | 51 EXPECT_FALSE(browser_view()->ShouldShowAvatar()); |
53 EXPECT_TRUE(browser_view()->IsBrowserTypeNormal()); | 52 EXPECT_TRUE(browser_view()->IsBrowserTypeNormal()); |
54 EXPECT_FALSE(browser_view()->IsFullscreen()); | 53 EXPECT_FALSE(browser_view()->IsFullscreen()); |
55 EXPECT_FALSE(browser_view()->IsBookmarkBarVisible()); | 54 EXPECT_FALSE(browser_view()->IsBookmarkBarVisible()); |
56 EXPECT_FALSE(browser_view()->IsBookmarkBarAnimating()); | 55 EXPECT_FALSE(browser_view()->IsBookmarkBarAnimating()); |
57 } | 56 } |
58 | 57 |
59 // Test layout of the top-of-window UI. | 58 // Test layout of the top-of-window UI. |
60 TEST_F(BrowserViewTest, BrowserViewLayout) { | 59 TEST_F(BrowserViewTest, BrowserViewLayout) { |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 header_offset.y(); | 204 header_offset.y(); |
206 | 205 |
207 // The web contents should be flush with the bottom of the header. | 206 // The web contents should be flush with the bottom of the header. |
208 EXPECT_EQ(bottom_of_header, contents_container->y()); | 207 EXPECT_EQ(bottom_of_header, contents_container->y()); |
209 | 208 |
210 // The find bar should overlap the 1px header/web-contents separator at the | 209 // The find bar should overlap the 1px header/web-contents separator at the |
211 // bottom of the header. | 210 // bottom of the header. |
212 EXPECT_EQ(browser_view()->frame()->GetTopInset() - 1, | 211 EXPECT_EQ(browser_view()->frame()->GetTopInset() - 1, |
213 browser_view()->GetFindBarBoundingBox().y()); | 212 browser_view()->GetFindBarBoundingBox().y()); |
214 } | 213 } |
OLD | NEW |