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

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

Issue 8528011: Page zoom improvements (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: One last(?) tweak. Created 9 years, 1 month 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
===================================================================
--- chrome/browser/ui/browser_browsertest.cc (revision 110998)
+++ chrome/browser/ui/browser_browsertest.cc (working copy)
@@ -1286,6 +1286,40 @@
EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_IMPORT_SETTINGS));
}
+IN_PROC_BROWSER_TEST_F(BrowserTest, PageZoom) {
+ TabContents* contents = browser()->GetSelectedTabContents();
+ bool enable_plus, enable_minus;
+
+ ui_test_utils::WindowedNotificationObserver zoom_in_observer(
+ content::NOTIFICATION_ZOOM_LEVEL_CHANGED,
+ content::NotificationService::AllSources());
+ browser()->Zoom(content::PAGE_ZOOM_IN);
+ zoom_in_observer.Wait();
+ EXPECT_EQ(contents->GetZoomPercent(&enable_plus, &enable_minus), 110);
+ EXPECT_TRUE(enable_plus);
+ EXPECT_TRUE(enable_minus);
+
+ ui_test_utils::WindowedNotificationObserver zoom_reset_observer(
+ content::NOTIFICATION_ZOOM_LEVEL_CHANGED,
+ content::NotificationService::AllSources());
+ browser()->Zoom(content::PAGE_ZOOM_RESET);
+ zoom_reset_observer.Wait();
+ EXPECT_EQ(contents->GetZoomPercent(&enable_plus, &enable_minus), 100);
+ EXPECT_TRUE(enable_plus);
+ EXPECT_TRUE(enable_minus);
+
+ ui_test_utils::WindowedNotificationObserver zoom_out_observer(
+ content::NOTIFICATION_ZOOM_LEVEL_CHANGED,
+ content::NotificationService::AllSources());
+ browser()->Zoom(content::PAGE_ZOOM_OUT);
+ zoom_out_observer.Wait();
+ EXPECT_EQ(contents->GetZoomPercent(&enable_plus, &enable_minus), 90);
+ EXPECT_TRUE(enable_plus);
+ EXPECT_TRUE(enable_minus);
+
+ browser()->Zoom(content::PAGE_ZOOM_RESET);
+}
+
// TODO(ben): this test was never enabled. It has bit-rotted since being added.
// It originally lived in browser_unittest.cc, but has been moved here to make
// room for real browser unit tests.

Powered by Google App Engine
This is Rietveld 408576698