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

Side by Side 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 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <string> 5 #include <string>
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #if defined(OS_MACOSX) 9 #if defined(OS_MACOSX)
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
(...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after
1279 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_OPTIONS)); 1279 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_OPTIONS));
1280 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_IMPORT_SETTINGS)); 1280 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_IMPORT_SETTINGS));
1281 // Set Incognito to AVAILABLE. 1281 // Set Incognito to AVAILABLE.
1282 IncognitoModePrefs::SetAvailability(popup_browser->profile()->GetPrefs(), 1282 IncognitoModePrefs::SetAvailability(popup_browser->profile()->GetPrefs(),
1283 IncognitoModePrefs::ENABLED); 1283 IncognitoModePrefs::ENABLED);
1284 // OPTIONS and IMPORT_SETTINGS are still disabled since it is a non-normal UI. 1284 // OPTIONS and IMPORT_SETTINGS are still disabled since it is a non-normal UI.
1285 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_OPTIONS)); 1285 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_OPTIONS));
1286 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_IMPORT_SETTINGS)); 1286 EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_IMPORT_SETTINGS));
1287 } 1287 }
1288 1288
1289 IN_PROC_BROWSER_TEST_F(BrowserTest, PageZoom) {
1290 TabContents* contents = browser()->GetSelectedTabContents();
1291 bool enable_plus, enable_minus;
1292
1293 ui_test_utils::WindowedNotificationObserver zoom_in_observer(
1294 content::NOTIFICATION_ZOOM_LEVEL_CHANGED,
1295 content::NotificationService::AllSources());
1296 browser()->Zoom(content::PAGE_ZOOM_IN);
1297 zoom_in_observer.Wait();
1298 EXPECT_EQ(contents->GetZoomPercent(&enable_plus, &enable_minus), 110);
1299 EXPECT_TRUE(enable_plus);
1300 EXPECT_TRUE(enable_minus);
1301
1302 ui_test_utils::WindowedNotificationObserver zoom_reset_observer(
1303 content::NOTIFICATION_ZOOM_LEVEL_CHANGED,
1304 content::NotificationService::AllSources());
1305 browser()->Zoom(content::PAGE_ZOOM_RESET);
1306 zoom_reset_observer.Wait();
1307 EXPECT_EQ(contents->GetZoomPercent(&enable_plus, &enable_minus), 100);
1308 EXPECT_TRUE(enable_plus);
1309 EXPECT_TRUE(enable_minus);
1310
1311 ui_test_utils::WindowedNotificationObserver zoom_out_observer(
1312 content::NOTIFICATION_ZOOM_LEVEL_CHANGED,
1313 content::NotificationService::AllSources());
1314 browser()->Zoom(content::PAGE_ZOOM_OUT);
1315 zoom_out_observer.Wait();
1316 EXPECT_EQ(contents->GetZoomPercent(&enable_plus, &enable_minus), 90);
1317 EXPECT_TRUE(enable_plus);
1318 EXPECT_TRUE(enable_minus);
1319
1320 browser()->Zoom(content::PAGE_ZOOM_RESET);
1321 }
1322
1289 // TODO(ben): this test was never enabled. It has bit-rotted since being added. 1323 // TODO(ben): this test was never enabled. It has bit-rotted since being added.
1290 // It originally lived in browser_unittest.cc, but has been moved here to make 1324 // It originally lived in browser_unittest.cc, but has been moved here to make
1291 // room for real browser unit tests. 1325 // room for real browser unit tests.
1292 #if 0 1326 #if 0
1293 class BrowserTest2 : public InProcessBrowserTest { 1327 class BrowserTest2 : public InProcessBrowserTest {
1294 public: 1328 public:
1295 BrowserTest2() { 1329 BrowserTest2() {
1296 host_resolver_proc_ = new net::RuleBasedHostResolverProc(NULL); 1330 host_resolver_proc_ = new net::RuleBasedHostResolverProc(NULL);
1297 // Avoid making external DNS lookups. In this test we don't need this 1331 // Avoid making external DNS lookups. In this test we don't need this
1298 // to succeed. 1332 // to succeed.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1363 1397
1364 // The normal browser should now have four. 1398 // The normal browser should now have four.
1365 EXPECT_EQ(4, browser()->tab_count()); 1399 EXPECT_EQ(4, browser()->tab_count());
1366 1400
1367 // Close the additional browsers. 1401 // Close the additional browsers.
1368 popup_browser->CloseAllTabs(); 1402 popup_browser->CloseAllTabs();
1369 app_browser->CloseAllTabs(); 1403 app_browser->CloseAllTabs();
1370 app_popup_browser->CloseAllTabs(); 1404 app_popup_browser->CloseAllTabs();
1371 } 1405 }
1372 #endif 1406 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698