| 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..f98e27c690eb53456024da85faeb6fa6dfcc2712 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,23 @@ 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);
|
| + EXPECT_EQ(
|
| + content::PAGE_TYPE_ERROR,
|
| + web_contents->GetController().GetLastCommittedEntry()->GetPageType());
|
| +
|
| + 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());
|
| +}
|
|
|