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

Unified Diff: third_party/WebKit/Source/core/dom/StyleEngineTest.cpp

Issue 1684193003: markDocumentDirty() before styleResolverChanged(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/core/dom/StyleEngine.cpp ('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/core/dom/StyleEngineTest.cpp
diff --git a/third_party/WebKit/Source/core/dom/StyleEngineTest.cpp b/third_party/WebKit/Source/core/dom/StyleEngineTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..59348fd59c0160ffdbb484604c97221173f0f0e0
--- /dev/null
+++ b/third_party/WebKit/Source/core/dom/StyleEngineTest.cpp
@@ -0,0 +1,43 @@
+// Copyright 2016 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/StyleEngine.h"
+
+#include "core/css/StyleSheetContents.h"
+#include "core/dom/Document.h"
+#include "core/frame/FrameView.h"
+#include "core/testing/DummyPageHolder.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace blink {
+
+class StyleEngineTest : public ::testing::Test {
+protected:
+ void SetUp() override;
+
+ Document& document() { return m_dummyPageHolder->document(); }
+ StyleEngine& styleEngine() { return document().styleEngine(); }
+
+ bool isDocumentStyleSheetCollectionClean() { return !styleEngine().shouldUpdateDocumentStyleSheetCollection(AnalyzedStyleUpdate); }
+
+private:
+ OwnPtr<DummyPageHolder> m_dummyPageHolder;
+};
+
+void StyleEngineTest::SetUp()
+{
+ m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600));
+}
+
+TEST_F(StyleEngineTest, DocumentDirtyAfterInject)
+{
+ RefPtrWillBeRawPtr<StyleSheetContents> parsedSheet = StyleSheetContents::create(CSSParserContext(document(), nullptr));
+ parsedSheet->parseString("div {}");
+ styleEngine().injectAuthorSheet(parsedSheet);
+ document().view()->updateAllLifecyclePhases();
+
+ EXPECT_TRUE(isDocumentStyleSheetCollectionClean());
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698