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

Unified Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

Issue 2898423002: Reset scroll and scale while toggling "Request desktop site" (Closed)
Patch Set: WebView bug Created 3 years, 6 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 | « third_party/WebKit/Source/web/WebViewImpl.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/tests/WebFrameTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
index d05dbe796c0609a1ca6d20b3f816cab2a61505b8..5fc4ba667bbe3a88d8572d902826af4d70e732c4 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -4273,20 +4273,15 @@ TEST_F(WebFrameTest, ReloadWithOverrideURLPreservesState) {
WebSize(kPageWidth / 4, kPageHeight / 4));
web_view_helper.WebView()->SetPageScaleFactor(kPageScaleFactor);
- WebSize previous_offset =
- web_view_helper.WebView()->MainFrame()->GetScrollOffset();
- float previous_scale = web_view_helper.WebView()->PageScaleFactor();
-
- // Reload the page and end up at the same url. State should be propagated.
+ // Reload the page and end up at the same url. State should not be propagated.
web_view_helper.WebView()->MainFrame()->ReloadWithOverrideURL(
ToKURL(base_url_ + first_url), WebFrameLoadType::kReload);
FrameTestHelpers::PumpPendingRequestsForFrameToLoad(
web_view_helper.WebView()->MainFrame());
- EXPECT_EQ(previous_offset.width,
- web_view_helper.WebView()->MainFrame()->GetScrollOffset().width);
- EXPECT_EQ(previous_offset.height,
+ EXPECT_EQ(0, web_view_helper.WebView()->MainFrame()->GetScrollOffset().width);
+ EXPECT_EQ(0,
web_view_helper.WebView()->MainFrame()->GetScrollOffset().height);
- EXPECT_EQ(previous_scale, web_view_helper.WebView()->PageScaleFactor());
+ EXPECT_EQ(1.0f, web_view_helper.WebView()->PageScaleFactor());
// Reload the page using the cache. State should not be propagated.
web_view_helper.WebView()->MainFrame()->ReloadWithOverrideURL(
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698