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

Unified Diff: chrome/browser/ui/views/frame/browser_view_unittest.cc

Issue 160093006: Fix find bar positioning for hosted app windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/frame/browser_view_unittest.cc
diff --git a/chrome/browser/ui/views/frame/browser_view_unittest.cc b/chrome/browser/ui/views/frame/browser_view_unittest.cc
index 70a9fbf1d44634b78d4f84685797c133d62ff6dc..ccef538465c2870cd7fac73ec5f3cec88434d663 100644
--- a/chrome/browser/ui/views/frame/browser_view_unittest.cc
+++ b/chrome/browser/ui/views/frame/browser_view_unittest.cc
@@ -103,6 +103,7 @@ TEST_F(BrowserViewTest, BrowserViewLayout) {
toolbar->y());
EXPECT_EQ(0, contents_container->x());
EXPECT_EQ(toolbar->bounds().bottom(), contents_container->y());
+ EXPECT_EQ(top_container->bounds().bottom(), contents_container->y());
EXPECT_EQ(0, devtools_web_view->x());
EXPECT_EQ(0, devtools_web_view->y());
EXPECT_EQ(0, contents_web_view->x());
@@ -164,6 +165,54 @@ TEST_F(BrowserViewTest, BrowserViewLayout) {
BookmarkBarView::DisableAnimationsForTesting(false);
}
+class BrowserViewHostedAppTest : public TestWithBrowserView {
+ public:
+ BrowserViewHostedAppTest()
+ : TestWithBrowserView(Browser::TYPE_POPUP,
+ chrome::HOST_DESKTOP_TYPE_NATIVE,
+ true) {
+ }
+ virtual ~BrowserViewHostedAppTest() {
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BrowserViewHostedAppTest);
+};
+
+// Test basic layout for hosted apps.
+TEST_F(BrowserViewHostedAppTest, Layout) {
+ // Add a tab because the browser starts out without any tabs at all.
+ AddTab(browser(), GURL("about:blank"));
+
+ views::View* contents_container =
+ browser_view()->GetContentsContainerForTest();
+
+ // The tabstrip, toolbar and bookmark bar should not be visible for hosted
+ // apps.
+ EXPECT_FALSE(browser_view()->tabstrip()->visible());
+ EXPECT_FALSE(browser_view()->toolbar()->visible());
+ EXPECT_FALSE(browser_view()->IsBookmarkBarVisible());
+
+ gfx::Point header_offset;
+ views::View::ConvertPointToTarget(
+ browser_view(),
+ browser_view()->frame()->non_client_view()->frame_view(),
+ &header_offset);
+
+ // The position of the bottom of the header (the bar with the window
+ // controls) in the coordinates of BrowserView.
+ int bottom_of_header = browser_view()->frame()->GetTopInset() -
+ header_offset.y();
+
+ // The web contents should be flush with the bottom of the header.
+ EXPECT_EQ(bottom_of_header, contents_container->y());
+
+ // The find bar should overlap the 1px header/web-contents separator at the
+ // bottom of the header.
+ EXPECT_EQ(browser_view()->frame()->GetTopInset() - 1,
+ browser_view()->GetFindBarBoundingBox().y());
+}
+
#if defined(OS_WIN)
// This class provides functionality to test the incognito window/normal window
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view_layout.cc ('k') | chrome/browser/ui/views/frame/top_container_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698