| <sky> |
| <style> |
| div { width: 100px; height: 100px; background-color: red; } |
| div.wide { width: 200px; } |
| div#high { height: 200px; } |
| </style> |
| <div></div> |
| <div></div> |
| <script> |
| import "../resources/third_party/unittest/unittest.dart"; |
| import "../resources/unit.dart"; |
| |
| import "dart:sky"; |
| |
| void main() { |
| initUnit(); |
| |
| test("should grow width to 200px", () { |
| var target = document.querySelector('div'); |
| |
| target.classList.add("wide"); |
| expect(window.getComputedStyle(target)["width"], |
| equals("200px")); |
| }); |
| |
| test("should grow height to 200px", () { |
| var target = document.querySelectorAll('div')[1]; |
| |
| target.setAttribute("id", "high"); |
| expect(window.getComputedStyle(target)["height"], |
| equals("200px")); |
| }); |
| } |
| </script> |
| </sky> |