OLD | NEW |
1 <html> | |
2 <foo /> | |
3 <script> | |
4 import "../resources/third_party/unittest/unittest.dart"; | 1 import "../resources/third_party/unittest/unittest.dart"; |
5 import "../resources/unit.dart"; | 2 import "../resources/unit.dart"; |
6 | 3 |
7 import "dart:sky"; | 4 import "dart:sky"; |
8 | 5 |
9 void main() { | 6 void main() { |
10 initUnit(); | 7 initUnit(); |
11 | 8 |
12 test('should be settable using "style" attribute', () { | 9 test('should be settable using "style" attribute', () { |
13 var foo = document.querySelector('foo'); | 10 LayoutRoot layoutRoot = new LayoutRoot(); |
| 11 var document = new Document(); |
| 12 var foo = document.createElement('foo'); |
| 13 layoutRoot.rootElement = foo; |
| 14 |
14 foo.setAttribute('style', 'color: red'); | 15 foo.setAttribute('style', 'color: red'); |
15 | 16 |
16 | |
17 expect(foo.getAttribute('style'), equals('color: red')); | 17 expect(foo.getAttribute('style'), equals('color: red')); |
18 expect(foo.style["color"], equals('rgb(255, 0, 0)')); | 18 expect(foo.style["color"], equals('rgb(255, 0, 0)')); |
19 expect(window.getComputedStyle(foo)["color"], equals('rgb(255, 0, 0)')); | |
20 }); | 19 }); |
21 } | 20 } |
22 </script> | |
23 </html> | |
OLD | NEW |