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

Side by Side Diff: content/renderer/render_view_browsertest.cc

Issue 10828143: Zoom level limits must be set before setting a zoom level. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/renderer/render_view_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 6
7 #include "base/shared_memory.h" 7 #include "base/shared_memory.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "content/common/intents_messages.h" 10 #include "content/common/intents_messages.h"
(...skipping 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after
1691 ASSERT_EQ(utf16_length, bounds.size()); 1691 ASSERT_EQ(utf16_length, bounds.size());
1692 for (size_t i = 0; i < utf16_length; ++i) { 1692 for (size_t i = 0; i < utf16_length; ++i) {
1693 if (is_surrogate_pair_empty_rect[i]) { 1693 if (is_surrogate_pair_empty_rect[i]) {
1694 EXPECT_EQ(0, bounds[i].width()); 1694 EXPECT_EQ(0, bounds[i].width());
1695 } else { 1695 } else {
1696 EXPECT_LT(0, bounds[i].width()); 1696 EXPECT_LT(0, bounds[i].width());
1697 } 1697 }
1698 } 1698 }
1699 view()->OnImeConfirmComposition(empty_string, ui::Range::InvalidRange()); 1699 view()->OnImeConfirmComposition(empty_string, ui::Range::InvalidRange());
1700 } 1700 }
1701
1702 TEST_F(RenderViewImplTest, ZoomLimit) {
darin (slow to review) 2012/08/06 20:44:16 it is not clear to me how this test would have cau
kinaba 2012/08/06 23:39:23 See the inline comments below.
1703 const double kMinZoomLevel =
1704 WebKit::WebView::zoomFactorToZoomLevel(content::kMinimumZoomFactor);
1705 const double kMaxZoomLevel =
1706 WebKit::WebView::zoomFactorToZoomLevel(content::kMaximumZoomFactor);
1707
1708 ViewMsg_Navigate_Params params;
1709 params.page_id = -1;
1710 params.navigation_type = ViewMsg_Navigate_Type::NORMAL;
1711
1712 params.url = GURL("data:text/html,min_zoomlimit_test");
kinaba 2012/08/06 23:39:23 Here, RenderViewImpl stores zoom level setting (25
1713 view()->OnSetZoomLevelForLoadingURL(params.url, kMinZoomLevel);
kinaba 2012/08/06 23:39:23 Navigate to the URL. UndateURL is called and the s
1714 view()->OnNavigate(params);
1715 ProcessPendingMessages();
1716 EXPECT_DOUBLE_EQ(kMinZoomLevel, view()->GetWebView()->zoomLevel());
1717
1718 params.url = GURL("data:text/html,max_zoomlimit_test");
1719 view()->OnSetZoomLevelForLoadingURL(params.url, kMaxZoomLevel);
1720 view()->OnNavigate(params);
1721 ProcessPendingMessages();
1722 EXPECT_DOUBLE_EQ(kMaxZoomLevel, view()->GetWebView()->zoomLevel());
kinaba 2012/08/06 23:39:23 Ah, this "max" level part does not trigger the bug
1723 }
OLDNEW
« no previous file with comments | « no previous file | content/renderer/render_view_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698