| 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 dcaacbcf8c23311905e408621585bb18e1b8140e..0e8facee18271f2d5fdd5701b2446ec1cbb0eb7f 100644
|
| --- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
|
| +++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
|
| @@ -2409,7 +2409,8 @@ TEST_P(ParameterizedWebFrameTest, pageScaleFactorWrittenToHistoryItem) {
|
| webViewHelper.webView()->setPageScaleFactor(3);
|
| EXPECT_EQ(3, toLocalFrame(webViewHelper.webView()->page()->mainFrame())
|
| ->loader()
|
| - .currentItem()
|
| + .documentLoader()
|
| + ->historyItem()
|
| ->pageScaleFactor());
|
| }
|
|
|
| @@ -2434,7 +2435,8 @@ TEST_P(ParameterizedWebFrameTest, initialScaleWrittenToHistoryItem) {
|
| EXPECT_EQ(minimumPageScaleFactor,
|
| toLocalFrame(webViewHelper.webView()->page()->mainFrame())
|
| ->loader()
|
| - .currentItem()
|
| + .documentLoader()
|
| + ->historyItem()
|
| ->pageScaleFactor());
|
| }
|
|
|
| @@ -6975,17 +6977,18 @@ TEST_P(ParameterizedWebFrameTest, BackToReload) {
|
| WebFrame* frame = webViewHelper.webView()->mainFrame();
|
| const FrameLoader& mainFrameLoader =
|
| webViewHelper.webView()->mainFrameImpl()->frame()->loader();
|
| - Persistent<HistoryItem> firstItem = mainFrameLoader.currentItem();
|
| + Persistent<HistoryItem> firstItem =
|
| + mainFrameLoader.documentLoader()->historyItem();
|
| EXPECT_TRUE(firstItem);
|
|
|
| registerMockedHttpURLLoad("white-1x1.png");
|
| FrameTestHelpers::loadFrame(frame, m_baseURL + "white-1x1.png");
|
| - EXPECT_NE(firstItem.get(), mainFrameLoader.currentItem());
|
| + EXPECT_NE(firstItem.get(), mainFrameLoader.documentLoader()->historyItem());
|
|
|
| FrameTestHelpers::loadHistoryItem(frame, WebHistoryItem(firstItem.get()),
|
| WebHistoryDifferentDocumentLoad,
|
| WebCachePolicy::UseProtocolCachePolicy);
|
| - EXPECT_EQ(firstItem.get(), mainFrameLoader.currentItem());
|
| + EXPECT_EQ(firstItem.get(), mainFrameLoader.documentLoader()->historyItem());
|
|
|
| FrameTestHelpers::reloadFrame(frame);
|
| EXPECT_EQ(WebCachePolicy::ValidatingCacheData,
|
| @@ -7019,8 +7022,9 @@ TEST_P(ParameterizedWebFrameTest, BackDuringChildFrameReload) {
|
|
|
| FrameTestHelpers::reloadFrame(childFrame);
|
| EXPECT_EQ(item.urlString(), mainFrame->document().url().string());
|
| - EXPECT_EQ(item.urlString(),
|
| - WebString(mainFrameLoader.currentItem()->urlString()));
|
| + EXPECT_EQ(
|
| + item.urlString(),
|
| + WebString(mainFrameLoader.documentLoader()->historyItem()->urlString()));
|
| }
|
|
|
| TEST_P(ParameterizedWebFrameTest, ReloadPost) {
|
| @@ -7053,18 +7057,19 @@ TEST_P(ParameterizedWebFrameTest, LoadHistoryItemReload) {
|
| WebFrame* frame = webViewHelper.webView()->mainFrame();
|
| const FrameLoader& mainFrameLoader =
|
| webViewHelper.webView()->mainFrameImpl()->frame()->loader();
|
| - Persistent<HistoryItem> firstItem = mainFrameLoader.currentItem();
|
| + Persistent<HistoryItem> firstItem =
|
| + mainFrameLoader.documentLoader()->historyItem();
|
| EXPECT_TRUE(firstItem);
|
|
|
| registerMockedHttpURLLoad("white-1x1.png");
|
| FrameTestHelpers::loadFrame(frame, m_baseURL + "white-1x1.png");
|
| - EXPECT_NE(firstItem.get(), mainFrameLoader.currentItem());
|
| + EXPECT_NE(firstItem.get(), mainFrameLoader.documentLoader()->historyItem());
|
|
|
| // Cache policy overrides should take.
|
| FrameTestHelpers::loadHistoryItem(frame, WebHistoryItem(firstItem),
|
| WebHistoryDifferentDocumentLoad,
|
| WebCachePolicy::ValidatingCacheData);
|
| - EXPECT_EQ(firstItem.get(), mainFrameLoader.currentItem());
|
| + EXPECT_EQ(firstItem.get(), mainFrameLoader.documentLoader()->historyItem());
|
| EXPECT_EQ(WebCachePolicy::ValidatingCacheData,
|
| frame->dataSource()->getRequest().getCachePolicy());
|
| }
|
| @@ -7345,17 +7350,18 @@ TEST_P(ParameterizedWebFrameTest, SameDocumentHistoryNavigationCommitType) {
|
| FrameTestHelpers::WebViewHelper webViewHelper;
|
| WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(
|
| m_baseURL + "push_state.html", true, &client);
|
| - Persistent<HistoryItem> item =
|
| - toLocalFrame(webViewImpl->page()->mainFrame())->loader().currentItem();
|
| + Persistent<HistoryItem> item = toLocalFrame(webViewImpl->page()->mainFrame())
|
| + ->loader()
|
| + .documentLoader()
|
| + ->historyItem();
|
| runPendingTasks();
|
|
|
| toLocalFrame(webViewImpl->page()->mainFrame())
|
| ->loader()
|
| - .load(
|
| - FrameLoadRequest(
|
| - nullptr, FrameLoader::resourceRequestFromHistoryItem(
|
| - item.get(), WebCachePolicy::UseProtocolCachePolicy)),
|
| - FrameLoadTypeBackForward, item.get(), HistorySameDocumentLoad);
|
| + .load(FrameLoadRequest(nullptr,
|
| + item->generateResourceRequest(
|
| + WebCachePolicy::UseProtocolCachePolicy)),
|
| + FrameLoadTypeBackForward, item.get(), HistorySameDocumentLoad);
|
| EXPECT_EQ(WebBackForwardCommit, client.lastCommitType());
|
| }
|
|
|
| @@ -7481,12 +7487,12 @@ TEST_P(ParameterizedWebFrameTest, CurrentHistoryItem) {
|
| frame->loadRequest(request);
|
|
|
| // Before commit, there is no history item.
|
| - EXPECT_FALSE(mainFrameLoader.currentItem());
|
| + EXPECT_FALSE(mainFrameLoader.documentLoader()->historyItem());
|
|
|
| FrameTestHelpers::pumpPendingRequestsForFrameToLoad(frame);
|
|
|
| // After commit, there is.
|
| - HistoryItem* item = mainFrameLoader.currentItem();
|
| + HistoryItem* item = mainFrameLoader.documentLoader()->historyItem();
|
| ASSERT_TRUE(item);
|
| EXPECT_EQ(WTF::String(url.data()), item->urlString());
|
| }
|
|
|