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

Unified Diff: third_party/WebKit/Source/core/css/CSSStyleSheetResourceTest.cpp

Issue 1941733002: Don't cache parsed stylesheet if it wasn't added to the memory cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/CSSStyleSheetResourceTest.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSStyleSheetResourceTest.cpp b/third_party/WebKit/Source/core/css/CSSStyleSheetResourceTest.cpp
index 8ee2ea54cf450aa244e7d7fcbf8905883991d589..439cf17d303e5fc484b578a155251b9d20c0dbcf 100644
--- a/third_party/WebKit/Source/core/css/CSSStyleSheetResourceTest.cpp
+++ b/third_party/WebKit/Source/core/css/CSSStyleSheetResourceTest.cpp
@@ -134,7 +134,8 @@ TEST_F(CSSStyleSheetResourceTest, DuplicateResourceNotCached)
cssResource->responseReceived(ResourceResponse(cssURL, "style/css", 0, nullAtom, String()), nullptr);
cssResource->finish();
- StyleSheetContents* contents = StyleSheetContents::create(CSSParserContext(HTMLStandardMode, nullptr));
+ CSSParserContext parserContext(HTMLStandardMode, nullptr);
+ StyleSheetContents* contents = StyleSheetContents::create(parserContext);
CSSStyleSheet* sheet = CSSStyleSheet::create(contents, document());
EXPECT_TRUE(sheet);
@@ -144,9 +145,10 @@ TEST_F(CSSStyleSheetResourceTest, DuplicateResourceNotCached)
// Verify that the cache will have a mapping for |imageResource| at |url|.
// The underlying |contents| for the stylesheet resource must have a
// matching cache status.
- ASSERT_TRUE(memoryCache()->contains(imageResource));
- ASSERT_FALSE(memoryCache()->contains(cssResource));
- ASSERT_FALSE(contents->isInMemoryCache());
+ EXPECT_TRUE(memoryCache()->contains(imageResource));
+ EXPECT_FALSE(memoryCache()->contains(cssResource));
+ EXPECT_FALSE(contents->isInMemoryCache());
+ EXPECT_FALSE(cssResource->restoreParsedStyleSheet(parserContext));
}
} // namespace
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698