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

Unified Diff: third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp

Issue 2563423004: Always send a fail or finish notification for each navigation. (Closed)
Patch Set: Rebase Created 4 years 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
Index: third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
index 9384bb5bf72f96ed55c2f067761f06f4f620fd12..a83fe4bfeef423cccdb3848567fa5529d360c190 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
@@ -86,25 +86,16 @@ class FrameFetchContextTest : public ::testing::Test {
void SetUp() override {
dummyPageHolder = DummyPageHolder::create(IntSize(500, 500));
dummyPageHolder->page().setDeviceScaleFactor(1.0);
- documentLoader = DocumentLoader::create(
- &dummyPageHolder->frame(), ResourceRequest("http://www.example.com"),
- SubstituteData(), ClientRedirectPolicy::NotClientRedirect);
document = &dummyPageHolder->document();
fetchContext =
- static_cast<FrameFetchContext*>(&documentLoader->fetcher()->context());
+ static_cast<FrameFetchContext*>(&document->fetcher()->context());
owner = DummyFrameOwner::create();
FrameFetchContext::provideDocumentToContext(*fetchContext, document.get());
}
void TearDown() override {
- documentLoader->detachFromFrame();
- documentLoader.clear();
-
- if (childFrame) {
- childDocumentLoader->detachFromFrame();
- childDocumentLoader.clear();
+ if (childFrame)
childFrame->detach(FrameDetachType::Remove);
- }
}
FrameFetchContext* createChildFrame() {
@@ -113,12 +104,9 @@ class FrameFetchContextTest : public ::testing::Test {
document->frame()->host(), owner.get());
childFrame->setView(FrameView::create(*childFrame, IntSize(500, 500)));
childFrame->init();
- childDocumentLoader = DocumentLoader::create(
- childFrame.get(), ResourceRequest("http://www.example.com"),
- SubstituteData(), ClientRedirectPolicy::NotClientRedirect);
childDocument = childFrame->document();
FrameFetchContext* childFetchContext = static_cast<FrameFetchContext*>(
- &childDocumentLoader->fetcher()->context());
+ &childFrame->loader().documentLoader()->fetcher()->context());
FrameFetchContext::provideDocumentToContext(*childFetchContext,
childDocument.get());
return childFetchContext;
@@ -128,13 +116,11 @@ class FrameFetchContextTest : public ::testing::Test {
// We don't use the DocumentLoader directly in any tests, but need to keep it
// around as long as the ResourceFetcher and Document live due to indirect
// usage.
- Persistent<DocumentLoader> documentLoader;
Persistent<Document> document;
Persistent<FrameFetchContext> fetchContext;
Persistent<StubFrameLoaderClientWithParent> childClient;
Persistent<LocalFrame> childFrame;
- Persistent<DocumentLoader> childDocumentLoader;
Persistent<Document> childDocument;
Persistent<DummyFrameOwner> owner;
};
@@ -150,13 +136,10 @@ class FrameFetchContextMockedFrameLoaderClientTest
dummyPageHolder =
DummyPageHolder::create(IntSize(500, 500), nullptr, client);
dummyPageHolder->page().setDeviceScaleFactor(1.0);
- documentLoader = DocumentLoader::create(
- &dummyPageHolder->frame(), ResourceRequest(mainResourceUrl),
- SubstituteData(), ClientRedirectPolicy::NotClientRedirect);
document = &dummyPageHolder->document();
document->setURL(mainResourceUrl);
fetchContext =
- static_cast<FrameFetchContext*>(&documentLoader->fetcher()->context());
+ static_cast<FrameFetchContext*>(&document->fetcher()->context());
owner = DummyFrameOwner::create();
FrameFetchContext::provideDocumentToContext(*fetchContext, document.get());
}
« no previous file with comments | « third_party/WebKit/Source/core/loader/DocumentLoader.cpp ('k') | third_party/WebKit/Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698