| 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 "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/ui/browser_commands.h" | 9 #include "chrome/browser/ui/browser_commands.h" |
| 10 #include "chrome/browser/ui/layout_constants.h" | 10 #include "chrome/browser/ui/layout_constants.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 EXPECT_EQ(top_container, bookmark_bar->parent()); | 154 EXPECT_EQ(top_container, bookmark_bar->parent()); |
| 155 // Top container is still second from front. | 155 // Top container is still second from front. |
| 156 EXPECT_EQ(browser_view()->child_count() - 2, | 156 EXPECT_EQ(browser_view()->child_count() - 2, |
| 157 browser_view()->GetIndexOf(top_container)); | 157 browser_view()->GetIndexOf(top_container)); |
| 158 | 158 |
| 159 BookmarkBarView::DisableAnimationsForTesting(false); | 159 BookmarkBarView::DisableAnimationsForTesting(false); |
| 160 } | 160 } |
| 161 | 161 |
| 162 class BrowserViewHostedAppTest : public TestWithBrowserView { | 162 class BrowserViewHostedAppTest : public TestWithBrowserView { |
| 163 public: | 163 public: |
| 164 BrowserViewHostedAppTest() | 164 BrowserViewHostedAppTest() : TestWithBrowserView(Browser::TYPE_POPUP, true) {} |
| 165 : TestWithBrowserView(Browser::TYPE_POPUP, | |
| 166 chrome::HOST_DESKTOP_TYPE_NATIVE, | |
| 167 true) { | |
| 168 } | |
| 169 ~BrowserViewHostedAppTest() override {} | 165 ~BrowserViewHostedAppTest() override {} |
| 170 | 166 |
| 171 private: | 167 private: |
| 172 DISALLOW_COPY_AND_ASSIGN(BrowserViewHostedAppTest); | 168 DISALLOW_COPY_AND_ASSIGN(BrowserViewHostedAppTest); |
| 173 }; | 169 }; |
| 174 | 170 |
| 175 // Test basic layout for hosted apps. | 171 // Test basic layout for hosted apps. |
| 176 TEST_F(BrowserViewHostedAppTest, Layout) { | 172 TEST_F(BrowserViewHostedAppTest, Layout) { |
| 177 // Add a tab because the browser starts out without any tabs at all. | 173 // Add a tab because the browser starts out without any tabs at all. |
| 178 AddTab(browser(), GURL("about:blank")); | 174 AddTab(browser(), GURL("about:blank")); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 198 header_offset.y(); | 194 header_offset.y(); |
| 199 | 195 |
| 200 // The web contents should be flush with the bottom of the header. | 196 // The web contents should be flush with the bottom of the header. |
| 201 EXPECT_EQ(bottom_of_header, contents_container->y()); | 197 EXPECT_EQ(bottom_of_header, contents_container->y()); |
| 202 | 198 |
| 203 // The find bar should overlap the 1px header/web-contents separator at the | 199 // The find bar should overlap the 1px header/web-contents separator at the |
| 204 // bottom of the header. | 200 // bottom of the header. |
| 205 EXPECT_LT(browser_view()->GetFindBarBoundingBox().y(), | 201 EXPECT_LT(browser_view()->GetFindBarBoundingBox().y(), |
| 206 browser_view()->frame()->GetTopInset(false)); | 202 browser_view()->frame()->GetTopInset(false)); |
| 207 } | 203 } |
| OLD | NEW |