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