OLD | NEW |
1 <html> | 1 <html> |
2 | 2 |
3 <style media="(max-width: 0px)"> | 3 <style media="(max-width: 0px)"> |
4 #test { color: rgb(255, 0, 0); } | 4 #test { color: rgb(255, 0, 0); } |
5 </style> | 5 </style> |
6 <div id="does-not-match">Should not be red.</div> | 6 <div id="does-not-match">Should not be red.</div> |
7 | 7 |
8 <style media="(max-width: 10000px)"> | 8 <style media="(max-width: 10000px)"> |
9 #matches { color: rgb(255, 0, 0); } | 9 #matches { color: rgb(255, 0, 0); } |
10 </style> | 10 </style> |
11 | 11 |
12 <div id="matches">Should be red.</div> | 12 <div id="matches">Should be red.</div> |
13 | 13 |
14 <script> | 14 <script> |
15 import "../resources/third_party/unittest/unittest.dart"; | 15 import "../resources/third_party/unittest/unittest.dart"; |
16 import "../resources/unit.dart"; | 16 import "../resources/unit.dart"; |
17 | 17 |
18 import "dart:sky"; | 18 import "dart:sky"; |
19 | 19 |
20 void main() { | 20 void main() { |
21 initUnit(); | 21 initUnit(); |
22 | 22 |
23 test('should allow sheets to apply when they match', () { | 23 test('should allow sheets to apply when they match', () { |
24 var element = document.getElementById('matches'); | 24 var element = document.getElementById('matches'); |
25 expect(window.getComputedStyle(element).getPropertyValue("color"), | 25 expect(window.getComputedStyle(element)["color"], equals("rgb(255, 0, 0)")); |
26 equals("rgb(255, 0, 0)")); | |
27 }); | 26 }); |
28 | 27 |
29 test('should cause sheets to be skipped when they do not match', () { | 28 test('should cause sheets to be skipped when they do not match', () { |
30 var element = document.getElementById('does-not-match'); | 29 var element = document.getElementById('does-not-match'); |
31 expect(window.getComputedStyle(element).getPropertyValue("color"), | 30 expect(window.getComputedStyle(element)["color"], equals("rgb(0, 0, 0)")); |
32 "rgb(0, 0, 0)"); | |
33 }); | 31 }); |
34 } | 32 } |
35 </script> | 33 </script> |
36 </html> | 34 </html> |
OLD | NEW |