OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1783 #else | 1783 #else |
1784 #define MAYBE_PageZoom PageZoom | 1784 #define MAYBE_PageZoom PageZoom |
1785 #endif | 1785 #endif |
1786 | 1786 |
1787 namespace { | 1787 namespace { |
1788 | 1788 |
1789 int GetZoomPercent(const content::WebContents* contents, | 1789 int GetZoomPercent(const content::WebContents* contents, |
1790 bool* enable_plus, | 1790 bool* enable_plus, |
1791 bool* enable_minus) { | 1791 bool* enable_minus) { |
1792 int percent = | 1792 int percent = |
1793 ui_zoom::ZoomController::FromWebContents(contents)->GetZoomPercent(); | 1793 zoom::ZoomController::FromWebContents(contents)->GetZoomPercent(); |
1794 *enable_plus = percent < contents->GetMaximumZoomPercent(); | 1794 *enable_plus = percent < contents->GetMaximumZoomPercent(); |
1795 *enable_minus = percent > contents->GetMinimumZoomPercent(); | 1795 *enable_minus = percent > contents->GetMinimumZoomPercent(); |
1796 return percent; | 1796 return percent; |
1797 } | 1797 } |
1798 | 1798 |
1799 } // namespace | 1799 } // namespace |
1800 | 1800 |
1801 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_PageZoom) { | 1801 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_PageZoom) { |
1802 WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); | 1802 WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); |
1803 bool enable_plus, enable_minus; | 1803 bool enable_plus, enable_minus; |
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2844 Browser* browser = new Browser(params); | 2844 Browser* browser = new Browser(params); |
2845 gfx::Rect bounds = browser->window()->GetBounds(); | 2845 gfx::Rect bounds = browser->window()->GetBounds(); |
2846 | 2846 |
2847 // Should be EXPECT_EQ, but this width is inconsistent across platforms. | 2847 // Should be EXPECT_EQ, but this width is inconsistent across platforms. |
2848 // See https://crbug.com/567925. | 2848 // See https://crbug.com/567925. |
2849 EXPECT_GE(bounds.width(), 100); | 2849 EXPECT_GE(bounds.width(), 100); |
2850 EXPECT_EQ(122, bounds.height()); | 2850 EXPECT_EQ(122, bounds.height()); |
2851 browser->window()->Close(); | 2851 browser->window()->Close(); |
2852 } | 2852 } |
2853 } | 2853 } |
OLD | NEW |