| Index: Source/web/tests/WebFrameTest.cpp
|
| diff --git a/Source/web/tests/WebFrameTest.cpp b/Source/web/tests/WebFrameTest.cpp
|
| index 32ecf1a46c2d059dc8b599180a729e3ebee284dd..afb9590b8d0b94040c2161c204529ec4a7062991 100644
|
| --- a/Source/web/tests/WebFrameTest.cpp
|
| +++ b/Source/web/tests/WebFrameTest.cpp
|
| @@ -5887,38 +5887,16 @@ TEST_P(ParameterizedWebFrameTest, ReloadIframe)
|
| EXPECT_EQ(childClient.cachePolicy(), WebURLRequest::ReloadIgnoringCacheData);
|
| }
|
|
|
| -class TestSameDocumentWebFrameClient : public FrameTestHelpers::TestWebFrameClient {
|
| -public:
|
| - TestSameDocumentWebFrameClient()
|
| - : m_frameLoadTypeSameSeen(false)
|
| - {
|
| - }
|
| -
|
| - virtual void willSendRequest(WebLocalFrame* frame, unsigned, WebURLRequest&, const WebURLResponse&)
|
| - {
|
| - if (toWebLocalFrameImpl(frame)->frame()->loader().loadType() == FrameLoadTypeSame)
|
| - m_frameLoadTypeSameSeen = true;
|
| - }
|
| -
|
| - bool frameLoadTypeSameSeen() const { return m_frameLoadTypeSameSeen; }
|
| -
|
| -private:
|
| - bool m_frameLoadTypeSameSeen;
|
| -};
|
| -
|
| TEST_P(ParameterizedWebFrameTest, NavigateToSame)
|
| {
|
| - registerMockedHttpURLLoad("navigate_to_same.html");
|
| - TestSameDocumentWebFrameClient client;
|
| + URLTestHelpers::registerMockedURLLoad(toKURL(m_baseURL + "navigate_to_same.html#"), WebString::fromUTF8("navigate_to_same.html"));
|
| + TestCachePolicyWebFrameClient client(nullptr);
|
| FrameTestHelpers::WebViewHelper webViewHelper(this);
|
| - webViewHelper.initializeAndLoad(m_baseURL + "navigate_to_same.html", true, &client);
|
| - EXPECT_FALSE(client.frameLoadTypeSameSeen());
|
| -
|
| - FrameLoadRequest frameRequest(0, ResourceRequest(toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->document()->url()));
|
| - toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->loader().load(frameRequest);
|
| - FrameTestHelpers::pumpPendingRequestsDoNotUse(webViewHelper.webView()->mainFrame());
|
| + webViewHelper.initializeAndLoad(m_baseURL + "navigate_to_same.html#", true, &client);
|
| + EXPECT_EQ(1, client.willSendRequestCallCount());
|
|
|
| - EXPECT_TRUE(client.frameLoadTypeSameSeen());
|
| + FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), m_baseURL + "navigate_to_same.html#");
|
| + EXPECT_EQ(2, client.willSendRequestCallCount());
|
| }
|
|
|
| class TestSameDocumentWithImageWebFrameClient : public FrameTestHelpers::TestWebFrameClient {
|
|
|