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

Unified Diff: third_party/WebKit/Source/web/tests/HTMLImportSheetsTest.cpp

Issue 2882983002: Avoid synchronous stylesheet update on html import loaded. (Closed)
Patch Set: Created 3 years, 7 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 | « third_party/WebKit/Source/web/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
new file mode 100644
index 0000000000000000000000000000000000000000..386c25f15166edde940020af016bb7b5c2353fa8
--- /dev/null
+++ b/third_party/WebKit/Source/web/tests/HTMLImportSheetsTest.cpp
@@ -0,0 +1,29 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/dom/Document.h"
+#include "core/html/HTMLLinkElement.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "web/tests/sim/SimRequest.h"
+#include "web/tests/sim/SimTest.h"
+
+namespace blink {
+
+class HTMLImportSheetsTest : public SimTest {
+ protected:
+ HTMLImportSheetsTest() { WebView().Resize(WebSize(640, 480)); }
+};
+
+TEST_F(HTMLImportSheetsTest, NeedsActiveStyleUpdate) {
+ 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());
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/web/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698