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

Unified Diff: sky/tests/styles/media-queries.sky

Issue 858423002: Don't store a RuleFeatureSet on ScopedStyleResolver. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: better test names. Created 5 years, 11 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 | « sky/engine/core/dom/StyleEngine.cpp ('k') | sky/tests/styles/media-queries-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tests/styles/media-queries.sky
diff --git a/sky/tests/styles/media-queries.sky b/sky/tests/styles/media-queries.sky
new file mode 100644
index 0000000000000000000000000000000000000000..4b220b94777206e8076037404b675729253bed72
--- /dev/null
+++ b/sky/tests/styles/media-queries.sky
@@ -0,0 +1,29 @@
+<html>
+<import src="../resources/chai.sky" />
+<import src="../resources/mocha.sky" />
+
+<style media="(max-width: 0px)">
+ #test { color: rgb(255, 0, 0); }
+</style>
+<div id="does-not-match">Should not be red.</div>
+
+<style media="(max-width: 10000px)">
+ #matches { color: rgb(255, 0, 0); }
+</style>
+
+<div id="matches">Should be red.</div>
+
+<script>
+describe('Media queries', function() {
+ it('should allow sheets to apply when they match', function() {
+ var element = document.getElementById('matches');
+ assert.equal(getComputedStyle(element).color, "rgb(255, 0, 0)");
+ });
+
+ it('should cause sheets to be skipped when they do not match', function() {
+ var element = document.getElementById('does-not-match');
+ assert.equal(getComputedStyle(element).color, "rgb(0, 0, 0)");
+ });
+});
+</script>
+</html>
« no previous file with comments | « sky/engine/core/dom/StyleEngine.cpp ('k') | sky/tests/styles/media-queries-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698