| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library CssStyleDeclarationTest; | 5 library CssStyleDeclarationTest; |
| 6 import 'package:unittest/unittest.dart'; | 6 import 'package:unittest/unittest.dart'; |
| 7 import 'package:unittest/html_config.dart'; | 7 import 'package:unittest/html_config.dart'; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 import 'dart:async'; | 9 import 'dart:async'; |
| 10 import 'utils.dart'; | 10 import 'utils.dart'; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 equals("color: blue;")); | 48 equals("color: blue;")); |
| 49 }); | 49 }); |
| 50 | 50 |
| 51 test('CSS property empty getters and setters', () { | 51 test('CSS property empty getters and setters', () { |
| 52 var style = createTestStyle(); | 52 var style = createTestStyle(); |
| 53 expect(style.border, equals("")); | 53 expect(style.border, equals("")); |
| 54 | 54 |
| 55 style.border = "1px solid blue"; | 55 style.border = "1px solid blue"; |
| 56 style.border = ""; | 56 style.border = ""; |
| 57 expect(style.border, equals("")); | 57 expect(style.border, equals("")); |
| 58 |
| 59 style.border = "1px solid blue"; |
| 60 style.border = null; |
| 61 expect(style.border, equals("")); |
| 58 }); | 62 }); |
| 59 | 63 |
| 60 test('CSS property getters and setters', () { | 64 test('CSS property getters and setters', () { |
| 61 var style = createTestStyle(); | 65 var style = createTestStyle(); |
| 62 expect(style.color, equals("blue")); | 66 expect(style.color, equals("blue")); |
| 63 expect(style.width, equals("2px")); | 67 expect(style.width, equals("2px")); |
| 64 | 68 |
| 65 style.color = "red"; | 69 style.color = "red"; |
| 66 style.transform = "translate(10px, 20px)"; | 70 style.transform = "translate(10px, 20px)"; |
| 67 | 71 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 expect(elements.style.backgroundColor, equals('green')); | 144 expect(elements.style.backgroundColor, equals('green')); |
| 141 elements = document.queryAll('#wat'); | 145 elements = document.queryAll('#wat'); |
| 142 expect(elements.style.backgroundColor, equals('yellow')); | 146 expect(elements.style.backgroundColor, equals('yellow')); |
| 143 | 147 |
| 144 elements.style.borderLeftWidth = '18px'; | 148 elements.style.borderLeftWidth = '18px'; |
| 145 expect(elements.style.borderLeftWidth, equals('18px')); | 149 expect(elements.style.borderLeftWidth, equals('18px')); |
| 146 elements = document.queryAll('li'); | 150 elements = document.queryAll('li'); |
| 147 expect(elements.style.borderLeftWidth, equals('10px')); | 151 expect(elements.style.borderLeftWidth, equals('10px')); |
| 148 }); | 152 }); |
| 149 } | 153 } |
| OLD | NEW |