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

Unified Diff: chrome/browser/ui/zoom/zoom_controller_browsertest.cc

Issue 580133002: Update entry page type to include error pages when appropriate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Set page type, fix tests. Created 6 years, 3 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
« no previous file with comments | « chrome/browser/ui/zoom/zoom_controller.cc ('k') | chrome/browser/ui/zoom/zoom_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/zoom/zoom_controller_browsertest.cc
diff --git a/chrome/browser/ui/zoom/zoom_controller_browsertest.cc b/chrome/browser/ui/zoom/zoom_controller_browsertest.cc
index 1fcd782a8a3f551f2c4b6447bb55041b1e4f7250..1b594c51f6fb176966aefbff7fb2c5bd6dfd9ee5 100644
--- a/chrome/browser/ui/zoom/zoom_controller_browsertest.cc
+++ b/chrome/browser/ui/zoom/zoom_controller_browsertest.cc
@@ -12,9 +12,11 @@
#include "chrome/common/pref_names.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
+#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/common/page_type.h"
#include "content/public/test/browser_test_utils.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -111,3 +113,20 @@ IN_PROC_BROWSER_TEST_F(ZoomControllerBrowserTest, OnPreferenceChanged) {
// we need to wait for it to propagate.
zoom_change_watcher.Wait();
}
+
+IN_PROC_BROWSER_TEST_F(ZoomControllerBrowserTest, ErrorPagesDoNotZoom) {
+ ui_test_utils::NavigateToURL(browser(), GURL("http://kjfhkjsdf.com"));
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
+
+ ZoomController* zoom_controller =
+ ZoomController::FromWebContents(web_contents);
+
wjmaclean 2014/09/23 19:08:42 I should put the page-type check back in place her
+ double old_zoom_level = zoom_controller->GetZoomLevel();
+ double new_zoom_level = old_zoom_level + 0.5;
+
+ // The following attempt to change the zoom level for an error page should
+ // fail.
+ zoom_controller->SetZoomLevel(new_zoom_level);
+ EXPECT_FLOAT_EQ(old_zoom_level, zoom_controller->GetZoomLevel());
+}
« no previous file with comments | « chrome/browser/ui/zoom/zoom_controller.cc ('k') | chrome/browser/ui/zoom/zoom_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698