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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "core/dom/StyleEngine.h"
6
7 #include "core/css/StyleSheetContents.h"
8 #include "core/dom/Document.h"
9 #include "core/frame/FrameView.h"
10 #include "core/testing/DummyPageHolder.h"
11 #include "testing/gtest/include/gtest/gtest.h"
12
13 namespace blink {
14
15 class StyleEngineTest : public ::testing::Test {
16 protected:
17 void SetUp() override;
18
19 Document& document() { return m_dummyPageHolder->document(); }
20 StyleEngine& styleEngine() { return document().styleEngine(); }
21
22 bool isDocumentStyleSheetCollectionClean() { return !styleEngine().shouldUpd ateDocumentStyleSheetCollection(AnalyzedStyleUpdate); }
23
24 private:
25 OwnPtr<DummyPageHolder> m_dummyPageHolder;
26 };
27
28 void StyleEngineTest::SetUp()
29 {
30 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600));
31 }
32
33 TEST_F(StyleEngineTest, DocumentDirtyAfterInject)
34 {
35 RefPtrWillBeRawPtr<StyleSheetContents> parsedSheet = StyleSheetContents::cre ate(CSSParserContext(document(), nullptr));
36 parsedSheet->parseString("div {}");
37 styleEngine().injectAuthorSheet(parsedSheet);
38 document().view()->updateAllLifecyclePhases();
39
40 EXPECT_TRUE(isDocumentStyleSheetCollectionClean());
41 }
42
43 } // namespace blink
OLDNEW
« 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