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

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

Issue 2703643003: Schedule a type selector invalidation set for RuleSet invalidations. (Closed)
Patch Set: Corrected expectation text. Created 3 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
index e62026ec9a2d63c9b05fdea6e2d35cd0caf23a9e..7859ffbcbf2c8ee884d29ac5d0bac47a02d38134 100644
--- a/third_party/WebKit/Source/core/dom/StyleEngineTest.cpp
+++ b/third_party/WebKit/Source/core/dom/StyleEngineTest.cpp
@@ -144,29 +144,44 @@ TEST_F(StyleEngineTest, RuleSetInvalidationTypeSelectors) {
"<div>"
" <span></span>"
" <div></div>"
- "</div>");
+ "</div>"
+ "<b></b><b></b><b></b><b></b>"
+ "<i id=i>"
+ " <i>"
+ " <b></b>"
+ " </i>"
+ "</i>");
document().view()->updateAllLifecyclePhases();
unsigned beforeCount = styleEngine().styleForElementCount();
EXPECT_EQ(
- scheduleInvalidationsForRules(document(), "span { background: green}"),
- RuleSetInvalidationsScheduled);
+ RuleSetInvalidationsScheduled,
+ scheduleInvalidationsForRules(document(), "span { background: green}"));
document().view()->updateAllLifecyclePhases();
unsigned afterCount = styleEngine().styleForElementCount();
EXPECT_EQ(1u, afterCount - beforeCount);
beforeCount = afterCount;
- EXPECT_EQ(scheduleInvalidationsForRules(document(),
- "body div { background: green}"),
- RuleSetInvalidationsScheduled);
+ EXPECT_EQ(RuleSetInvalidationsScheduled,
+ scheduleInvalidationsForRules(document(),
+ "body div { background: green}"));
document().view()->updateAllLifecyclePhases();
afterCount = styleEngine().styleForElementCount();
EXPECT_EQ(2u, afterCount - beforeCount);
EXPECT_EQ(
- scheduleInvalidationsForRules(document(), "div * { background: green}"),
- RuleSetInvalidationFullRecalc);
+ RuleSetInvalidationFullRecalc,
+ scheduleInvalidationsForRules(document(), "div * { background: green}"));
+ document().view()->updateAllLifecyclePhases();
+
+ beforeCount = styleEngine().styleForElementCount();
+ EXPECT_EQ(
+ RuleSetInvalidationsScheduled,
+ scheduleInvalidationsForRules(document(), "#i b { background: green}"));
+ document().view()->updateAllLifecyclePhases();
+ afterCount = styleEngine().styleForElementCount();
+ EXPECT_EQ(1u, afterCount - beforeCount);
}
TEST_F(StyleEngineTest, RuleSetInvalidationHost) {
« 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