| Index: Source/web/tests/WebViewTest.cpp
|
| diff --git a/Source/web/tests/WebViewTest.cpp b/Source/web/tests/WebViewTest.cpp
|
| index af0a0e0c9f7c912a4cf02f699a16b904cc5661a4..2c6337cf5e2269a72d47dd1ba99f167a5556b204 100644
|
| --- a/Source/web/tests/WebViewTest.cpp
|
| +++ b/Source/web/tests/WebViewTest.cpp
|
| @@ -1195,17 +1195,32 @@ TEST_F(WebViewTest, BackForwardRestoreScroll)
|
| RefPtrWillBePersistent<HistoryItem> item2 = mainFrameLocal->loader().currentItem();
|
|
|
| // Go back, then forward, then back again.
|
| - mainFrameLocal->loader().loadHistoryItem(item1.get(), FrameLoadTypeBackForward, HistorySameDocumentLoad);
|
| - mainFrameLocal->loader().loadHistoryItem(item2.get(), FrameLoadTypeBackForward, HistorySameDocumentLoad);
|
| - mainFrameLocal->loader().loadHistoryItem(item1.get(), FrameLoadTypeBackForward, HistorySameDocumentLoad);
|
| + mainFrameLocal->loader().load(
|
| + FrameLoadRequest(nullptr, FrameLoader::resourceRequestFromHistoryItem(
|
| + item1.get(), UseProtocolCachePolicy)),
|
| + FrameLoadTypeBackForward, item1.get(), HistorySameDocumentLoad);
|
| + mainFrameLocal->loader().load(
|
| + FrameLoadRequest(nullptr, FrameLoader::resourceRequestFromHistoryItem(
|
| + item2.get(), UseProtocolCachePolicy)),
|
| + FrameLoadTypeBackForward, item2.get(), HistorySameDocumentLoad);
|
| + mainFrameLocal->loader().load(
|
| + FrameLoadRequest(nullptr, FrameLoader::resourceRequestFromHistoryItem(
|
| + item1.get(), UseProtocolCachePolicy)),
|
| + FrameLoadTypeBackForward, item1.get(), HistorySameDocumentLoad);
|
|
|
| // Click a different anchor
|
| mainFrameLocal->loader().load(FrameLoadRequest(mainFrameLocal->document(), ResourceRequest(mainFrameLocal->document()->completeURL("#b"))));
|
| RefPtrWillBePersistent<HistoryItem> item3 = mainFrameLocal->loader().currentItem();
|
|
|
| // Go back, then forward. The scroll position should be properly set on the forward navigation.
|
| - mainFrameLocal->loader().loadHistoryItem(item1.get(), FrameLoadTypeBackForward, HistorySameDocumentLoad);
|
| - mainFrameLocal->loader().loadHistoryItem(item3.get(), FrameLoadTypeBackForward, HistorySameDocumentLoad);
|
| + mainFrameLocal->loader().load(
|
| + FrameLoadRequest(nullptr, FrameLoader::resourceRequestFromHistoryItem(
|
| + item1.get(), UseProtocolCachePolicy)),
|
| + FrameLoadTypeBackForward, item1.get(), HistorySameDocumentLoad);
|
| + mainFrameLocal->loader().load(
|
| + FrameLoadRequest(nullptr, FrameLoader::resourceRequestFromHistoryItem(
|
| + item3.get(), UseProtocolCachePolicy)),
|
| + FrameLoadTypeBackForward, item3.get(), HistorySameDocumentLoad);
|
| EXPECT_EQ(0, webViewImpl->mainFrame()->scrollOffset().width);
|
| EXPECT_GT(webViewImpl->mainFrame()->scrollOffset().height, 2000);
|
| }
|
|
|