Index: Source/core/loader/FrameFetchContextTest.cpp |
diff --git a/Source/core/loader/FrameFetchContextTest.cpp b/Source/core/loader/FrameFetchContextTest.cpp |
index d18df401db0925b019fbfc8cba363ac263c5025c..8c6a73c67049c28b3e87b3301870d3d9d32c857b 100644 |
--- a/Source/core/loader/FrameFetchContextTest.cpp |
+++ b/Source/core/loader/FrameFetchContextTest.cpp |
@@ -59,10 +59,16 @@ protected: |
dummyPageHolder->page().setDeviceScaleFactor(1.0); |
documentLoader = DocumentLoader::create(&dummyPageHolder->frame(), ResourceRequest("http://www.example.com"), SubstituteData()); |
document = toHTMLDocument(&dummyPageHolder->document()); |
- fetchContext = &documentLoader->fetcher()->context(); |
+ fetchContext = static_cast<FrameFetchContext*>(&documentLoader->fetcher()->context()); |
FrameFetchContext::provideDocumentToContext(*fetchContext, document.get()); |
} |
+ virtual void TearDown() |
+ { |
+ documentLoader->detachFromFrame(); |
+ documentLoader.clear(); |
+ } |
+ |
void expectUpgrade(const char* input, const char* expected) |
{ |
expectUpgrade(input, WebURLRequest::RequestContextScript, WebURLRequest::FrameTypeNone, expected); |
@@ -108,9 +114,9 @@ protected: |
OwnPtr<DummyPageHolder> dummyPageHolder; |
// 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. |
- RefPtr<DocumentLoader> documentLoader; |
+ RefPtrWillBePersistent<DocumentLoader> documentLoader; |
RefPtrWillBePersistent<Document> document; |
- FetchContext* fetchContext; |
+ Persistent<FrameFetchContext> fetchContext; |
}; |
TEST_F(FrameFetchContextUpgradeTest, UpgradeInsecureResourceRequests) |
@@ -226,10 +232,16 @@ protected: |
dummyPageHolder->page().setDeviceScaleFactor(1.0); |
documentLoader = DocumentLoader::create(&dummyPageHolder->frame(), ResourceRequest("http://www.example.com"), SubstituteData()); |
document = toHTMLDocument(&dummyPageHolder->document()); |
- fetchContext = &documentLoader->fetcher()->context(); |
+ fetchContext = static_cast<FrameFetchContext*>(&documentLoader->fetcher()->context()); |
FrameFetchContext::provideDocumentToContext(*fetchContext, document.get()); |
} |
+ virtual void TearDown() |
+ { |
+ documentLoader->detachFromFrame(); |
+ documentLoader.clear(); |
+ } |
+ |
void expectHeader(const char* input, const char* headerName, bool isPresent, const char* headerValue, float width = 0) |
{ |
KURL inputURL(ParsedURLString, input); |
@@ -249,9 +261,9 @@ protected: |
OwnPtr<DummyPageHolder> dummyPageHolder; |
// 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. |
- RefPtr<DocumentLoader> documentLoader; |
+ RefPtrWillBePersistent<DocumentLoader> documentLoader; |
RefPtrWillBePersistent<Document> document; |
- FetchContext* fetchContext; |
+ Persistent<FrameFetchContext> fetchContext; |
}; |
TEST_F(FrameFetchContextHintsTest, MonitorDPRHints) |
@@ -309,4 +321,3 @@ TEST_F(FrameFetchContextHintsTest, MonitorAllHints) |
} |
} // namespace |
- |