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

Unified Diff: chrome/browser/ui/browser_browsertest.cc

Issue 301733006: Zoom Extension API (chrome) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix javascript test function signature. Created 6 years, 5 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/browser_browsertest.cc
diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc
index a33a737996c29353507030cd69f8966295faddcf..ec906052132726856552c376eee3ed701d93365d 100644
--- a/chrome/browser/ui/browser_browsertest.cc
+++ b/chrome/browser/ui/browser_browsertest.cc
@@ -1807,6 +1807,20 @@ void OnZoomLevelChanged(const base::Closure& callback,
#else
#define MAYBE_PageZoom PageZoom
#endif
+
+namespace {
+
+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;
+}
+
+} // namespace
+
IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_PageZoom) {
WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents();
bool enable_plus, enable_minus;
@@ -1822,7 +1836,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);
}
@@ -1838,7 +1852,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);
}
@@ -1854,7 +1868,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);
}

Powered by Google App Engine
This is Rietveld 408576698