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

Side by Side Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

Issue 2257743002: Restore user state on ReloadwithoutSubResourceCacheRevalidation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix webkit_unit_tests Created 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 3244 matching lines...) Expand 10 before | Expand all | Expand 10 after
3255 3255
3256 registerMockedHttpURLLoad(firstURL); 3256 registerMockedHttpURLLoad(firstURL);
3257 registerMockedHttpURLLoad(secondURL); 3257 registerMockedHttpURLLoad(secondURL);
3258 registerMockedHttpURLLoad(thirdURL); 3258 registerMockedHttpURLLoad(thirdURL);
3259 3259
3260 FrameTestHelpers::WebViewHelper webViewHelper; 3260 FrameTestHelpers::WebViewHelper webViewHelper;
3261 ClearScrollStateOnCommitWebFrameClient client; 3261 ClearScrollStateOnCommitWebFrameClient client;
3262 webViewHelper.initializeAndLoad(m_baseURL + firstURL, true, &client); 3262 webViewHelper.initializeAndLoad(m_baseURL + firstURL, true, &client);
3263 webViewHelper.resize(WebSize(pageWidth, pageHeight)); 3263 webViewHelper.resize(WebSize(pageWidth, pageHeight));
3264 webViewHelper.webView()->mainFrame()->setScrollOffset(WebSize(pageWidth / 4, pageHeight / 4)); 3264 webViewHelper.webView()->mainFrame()->setScrollOffset(WebSize(pageWidth / 4, pageHeight / 4));
3265 // Ensure overview mode is disabled. Otherwise scale factor may be reset on reloads.
3266 webViewHelper.webView()->settings()->setLoadWithOverviewMode(false);
3265 webViewHelper.webView()->setPageScaleFactor(pageScaleFactor); 3267 webViewHelper.webView()->setPageScaleFactor(pageScaleFactor);
3266 3268
3267 WebSize previousOffset = webViewHelper.webView()->mainFrame()->scrollOffset( ); 3269 WebSize previousOffset = webViewHelper.webView()->mainFrame()->scrollOffset( );
3268 float previousScale = webViewHelper.webView()->pageScaleFactor(); 3270 float previousScale = webViewHelper.webView()->pageScaleFactor();
3269 3271
3270 // Reload the page and end up at the same url. State should be propagated. 3272 // Reload the page and end up at the same url. State should be propagated.
3271 webViewHelper.webView()->mainFrame()->reloadWithOverrideURL(toKURL(m_baseURL + firstURL), WebFrameLoadType::Reload); 3273 webViewHelper.webView()->mainFrame()->reloadWithOverrideURL(toKURL(m_baseURL + firstURL), WebFrameLoadType::Reload);
3272 FrameTestHelpers::pumpPendingRequestsForFrameToLoad(webViewHelper.webView()- >mainFrame()); 3274 FrameTestHelpers::pumpPendingRequestsForFrameToLoad(webViewHelper.webView()- >mainFrame());
3273 EXPECT_EQ(previousOffset.width, webViewHelper.webView()->mainFrame()->scroll Offset().width); 3275 EXPECT_EQ(previousOffset.width, webViewHelper.webView()->mainFrame()->scroll Offset().width);
3274 EXPECT_EQ(previousOffset.height, webViewHelper.webView()->mainFrame()->scrol lOffset().height); 3276 EXPECT_EQ(previousOffset.height, webViewHelper.webView()->mainFrame()->scrol lOffset().height);
(...skipping 5642 matching lines...) Expand 10 before | Expand all | Expand 10 after
8917 client.addExpectedRequest(toKURL("http://internal.test/priorities/injected.j s"), WebURLRequest::PriorityLow); 8919 client.addExpectedRequest(toKURL("http://internal.test/priorities/injected.j s"), WebURLRequest::PriorityLow);
8918 client.addExpectedRequest(toKURL("http://internal.test/priorities/injected-a sync.js"), WebURLRequest::PriorityLow); 8920 client.addExpectedRequest(toKURL("http://internal.test/priorities/injected-a sync.js"), WebURLRequest::PriorityLow);
8919 client.addExpectedRequest(toKURL("http://internal.test/priorities/body.js"), WebURLRequest::PriorityHigh); 8921 client.addExpectedRequest(toKURL("http://internal.test/priorities/body.js"), WebURLRequest::PriorityHigh);
8920 8922
8921 FrameTestHelpers::WebViewHelper helper; 8923 FrameTestHelpers::WebViewHelper helper;
8922 helper.initializeAndLoad(m_baseURL + "script_priority.html", true, &client); 8924 helper.initializeAndLoad(m_baseURL + "script_priority.html", true, &client);
8923 client.verifyAllRequests(); 8925 client.verifyAllRequests();
8924 } 8926 }
8925 8927
8926 } // namespace blink 8928 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698