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

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

Issue 2528633003: Move MediaQueryResults to RuleFeatureSet. (Closed)
Patch Set: Removed members. Created 4 years, 1 month 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
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 e53d7e7c0cbd1c474a85ef36580c62584050c0bf..887ffbb0e1d12f7e7bb849e184a4b5a6967c7b08 100644
--- a/third_party/WebKit/Source/core/dom/StyleEngineTest.cpp
+++ b/third_party/WebKit/Source/core/dom/StyleEngineTest.cpp
@@ -297,4 +297,28 @@ TEST_F(StyleEngineTest, RuleSetInvalidationV0BoundaryCrossing) {
RuleSetInvalidationFullRecalc);
}
+TEST_F(StyleEngineTest, HasViewportDependentMediaQueries) {
+ document().body()->setInnerHTML(
+ "<style>div {}</style>"
+ "<style id='sheet' media='(min-width: 200px)'>"
+ " div {}"
+ "</style>");
+
+ Element* styleElement = document().getElementById("sheet");
+
+ for (unsigned i = 0; i < 10; i++) {
+ document().body()->removeChild(styleElement);
+ document().view()->updateAllLifecyclePhases();
+ document().body()->appendChild(styleElement);
+ document().view()->updateAllLifecyclePhases();
+ }
+
+ EXPECT_TRUE(document().styleEngine().hasViewportDependentMediaQueries());
+
+ document().body()->removeChild(styleElement);
+ document().view()->updateAllLifecyclePhases();
+
+ EXPECT_FALSE(document().styleEngine().hasViewportDependentMediaQueries());
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.cpp ('k') | third_party/WebKit/Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698