Chromium Code Reviews| Index: chrome/browser/ui/browser_browsertest.cc |
| diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc |
| index 456b8ff9950688e1488fcb7bb1ff34a2e0262ed0..788cd1e2bdef6732f203b5c42308987903d31e36 100644 |
| --- a/chrome/browser/ui/browser_browsertest.cc |
| +++ b/chrome/browser/ui/browser_browsertest.cc |
| @@ -1806,6 +1806,18 @@ void OnZoomLevelChanged(const base::Closure& callback, |
| #else |
| #define MAYBE_PageZoom PageZoom |
| #endif |
| + |
| +namespace { |
|
Devlin
2014/06/16 19:04:49
nit: The function is long enough that there should
wjmaclean
2014/06/18 19:03:54
Done.
|
| +int GetZoomPercent(const content::WebContents* contents, |
| + bool* enable_plus, |
| + bool* enable_minus) { |
| + int percent = ZoomController::FromWebContents(contents)->GetZoomPercent(); |
| + *enable_plus = percent < contents->GetMaximumZoomPercent(); |
| + *enable_minus = percent > contents->GetMinimumZoomPercent(); |
| + return percent; |
| + } |
|
Devlin
2014/06/16 19:04:49
bracket indentation is off.
wjmaclean
2014/06/18 19:03:54
Done.
|
| +} // namespace |
| + |
| IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_PageZoom) { |
| WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); |
| bool enable_plus, enable_minus; |
| @@ -1821,7 +1833,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_PageZoom) { |
| chrome::Zoom(browser(), content::PAGE_ZOOM_IN); |
| loop_runner->Run(); |
| sub.reset(); |
| - EXPECT_EQ(contents->GetZoomPercent(&enable_plus, &enable_minus), 110); |
| + EXPECT_EQ(GetZoomPercent(contents, &enable_plus, &enable_minus), 110); |
| EXPECT_TRUE(enable_plus); |
| EXPECT_TRUE(enable_minus); |
| } |
| @@ -1837,7 +1849,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_PageZoom) { |
| chrome::Zoom(browser(), content::PAGE_ZOOM_RESET); |
| loop_runner->Run(); |
| sub.reset(); |
| - EXPECT_EQ(contents->GetZoomPercent(&enable_plus, &enable_minus), 100); |
| + EXPECT_EQ(GetZoomPercent(contents, &enable_plus, &enable_minus), 100); |
| EXPECT_TRUE(enable_plus); |
| EXPECT_TRUE(enable_minus); |
| } |
| @@ -1853,7 +1865,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_PageZoom) { |
| chrome::Zoom(browser(), content::PAGE_ZOOM_OUT); |
| loop_runner->Run(); |
| sub.reset(); |
| - EXPECT_EQ(contents->GetZoomPercent(&enable_plus, &enable_minus), 90); |
| + EXPECT_EQ(GetZoomPercent(contents, &enable_plus, &enable_minus), 90); |
| EXPECT_TRUE(enable_plus); |
| EXPECT_TRUE(enable_minus); |
| } |