Index: third_party/WebKit/Source/web/tests/HTMLImportSheetsTest.cpp |
diff --git a/third_party/WebKit/Source/web/tests/HTMLImportSheetsTest.cpp b/third_party/WebKit/Source/web/tests/HTMLImportSheetsTest.cpp |
index b870d15cd0ef30ca98956f486914c6e57ca6c2b6..36c75d90f34c129c1e6a398de8e7c98025fd2d2d 100644 |
--- a/third_party/WebKit/Source/web/tests/HTMLImportSheetsTest.cpp |
+++ b/third_party/WebKit/Source/web/tests/HTMLImportSheetsTest.cpp |
@@ -35,4 +35,24 @@ TEST_F(HTMLImportSheetsTest, NeedsActiveStyleUpdate) { |
EXPECT_FALSE(import_doc->GetStyleEngine().NeedsActiveStyleUpdate()); |
} |
+TEST_F(HTMLImportSheetsTest, UpdateStyleSheetList) { |
+ SimRequest main_resource("https://example.com/", "text/html"); |
+ SimRequest import_resource("https://example.com/import.html", "text/html"); |
+ |
+ LoadURL("https://example.com/"); |
+ main_resource.Complete("<link id=link rel=import href=import.html>"); |
+ import_resource.Complete("<style>div{}</style>"); |
+ |
+ EXPECT_TRUE(GetDocument().GetStyleEngine().NeedsActiveStyleUpdate()); |
+ Document* import_doc = |
+ toHTMLLinkElement(GetDocument().getElementById("link"))->import(); |
+ ASSERT_TRUE(import_doc); |
+ EXPECT_TRUE(import_doc->GetStyleEngine().NeedsActiveStyleUpdate()); |
+ |
+ import_doc->GetStyleEngine().StyleSheetsForStyleSheetList(*import_doc); |
+ |
+ EXPECT_TRUE(GetDocument().GetStyleEngine().NeedsActiveStyleUpdate()); |
+ EXPECT_FALSE(import_doc->GetStyleEngine().NeedsActiveStyleUpdate()); |
+} |
+ |
} // namespace blink |