diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/core/css/style_sheet_contents_test.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/core/css/style_sheet_contents_test.cc | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/chromium/third_party/blink/renderer/core/css/style_sheet_contents_test.cc b/chromium/third_party/blink/renderer/core/css/style_sheet_contents_test.cc index c8f5bdd4eb1..2288523fb93 100644 --- a/chromium/third_party/blink/renderer/core/css/style_sheet_contents_test.cc +++ b/chromium/third_party/blink/renderer/core/css/style_sheet_contents_test.cc @@ -58,49 +58,4 @@ TEST(StyleSheetContentsTest, InsertFontFaceRule) { EXPECT_TRUE(style_sheet->HasFontFaceRule()); } -TEST(StyleSheetContentsTest, HasViewportRule) { - auto* context = MakeGarbageCollected<CSSParserContext>( - kHTMLStandardMode, SecureContextMode::kInsecureContext); - - auto* style_sheet = MakeGarbageCollected<StyleSheetContents>(context); - style_sheet->ParseString("@viewport { width: 200px}"); - EXPECT_EQ(1U, style_sheet->RuleCount()); - EXPECT_TRUE(style_sheet->HasViewportRule()); -} - -TEST(StyleSheetContentsTest, HasViewportRuleAfterInsertion) { - auto* context = MakeGarbageCollected<CSSParserContext>( - kHTMLStandardMode, SecureContextMode::kInsecureContext); - - auto* style_sheet = MakeGarbageCollected<StyleSheetContents>(context); - style_sheet->ParseString("body { color: pink }"); - EXPECT_EQ(1U, style_sheet->RuleCount()); - EXPECT_FALSE(style_sheet->HasViewportRule()); - - style_sheet->SetMutable(); - style_sheet->WrapperInsertRule( - CSSParser::ParseRule(context, style_sheet, "@viewport { width: 200px }"), - 0); - EXPECT_EQ(2U, style_sheet->RuleCount()); - EXPECT_TRUE(style_sheet->HasViewportRule()); -} - -TEST(StyleSheetContentsTest, HasViewportRuleAfterInsertionIntoMediaRule) { - auto* context = MakeGarbageCollected<CSSParserContext>( - kHTMLStandardMode, SecureContextMode::kInsecureContext); - - auto* style_sheet = MakeGarbageCollected<StyleSheetContents>(context); - style_sheet->ParseString("@media {}"); - ASSERT_EQ(1U, style_sheet->RuleCount()); - EXPECT_FALSE(style_sheet->HasViewportRule()); - - auto* media_rule = To<StyleRuleMedia>(style_sheet->RuleAt(0)); - style_sheet->SetMutable(); - media_rule->WrapperInsertRule( - 0, - CSSParser::ParseRule(context, style_sheet, "@viewport { width: 200px }")); - EXPECT_EQ(1U, media_rule->ChildRules().size()); - EXPECT_TRUE(style_sheet->HasViewportRule()); -} - } // namespace blink |