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

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

Issue 2081893003: Mark stylesheet as having media queries at consume time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Back to marking at consume time Created 4 years, 6 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
Index: third_party/WebKit/Source/core/css/StyleSheetContentsTest.cpp
diff --git a/third_party/WebKit/Source/core/css/StyleSheetContentsTest.cpp b/third_party/WebKit/Source/core/css/StyleSheetContentsTest.cpp
index b8028f2bb7a34491649345fea1a8a016c8a10c8f..9792610a78e6dd75bc324ef449190066b1a16124 100644
--- a/third_party/WebKit/Source/core/css/StyleSheetContentsTest.cpp
+++ b/third_party/WebKit/Source/core/css/StyleSheetContentsTest.cpp
@@ -21,11 +21,29 @@ TEST(StyleSheetContentsTest, InsertMediaRule)
styleSheet->setMutable();
styleSheet->wrapperInsertRule(CSSParser::parseRule(context, styleSheet, "@media all { div { color: pink } }"), 0);
EXPECT_EQ(1U, styleSheet->ruleCount());
- EXPECT_FALSE(styleSheet->hasMediaQueries());
+ EXPECT_TRUE(styleSheet->hasMediaQueries());
styleSheet->wrapperInsertRule(CSSParser::parseRule(context, styleSheet, "@media all { div { color: green } }"), 1);
EXPECT_EQ(2U, styleSheet->ruleCount());
EXPECT_TRUE(styleSheet->hasMediaQueries());
}
+TEST(StyleSheetContentsTest, InsertFontFaceRule)
+{
+ CSSParserContext context(HTMLStandardMode, nullptr);
+
+ StyleSheetContents* styleSheet = StyleSheetContents::create(context);
+ styleSheet->parseString("@namespace ns url(test);");
+ EXPECT_EQ(1U, styleSheet->ruleCount());
+
+ styleSheet->setMutable();
+ styleSheet->wrapperInsertRule(CSSParser::parseRule(context, styleSheet, "@font-face { font-family: a }"), 0);
+ EXPECT_EQ(1U, styleSheet->ruleCount());
+ EXPECT_TRUE(styleSheet->hasFontFaceRule());
+
+ styleSheet->wrapperInsertRule(CSSParser::parseRule(context, styleSheet, "@font-face { font-family: b }"), 1);
+ EXPECT_EQ(2U, styleSheet->ruleCount());
+ EXPECT_TRUE(styleSheet->hasFontFaceRule());
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/css/StyleSheetContents.cpp ('k') | third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698