Chromium Code Reviews| Index: client/tests/client/html/CSSStyleDeclarationTests.dart |
| diff --git a/client/tests/client/html/CSSStyleDeclarationTests.dart b/client/tests/client/html/CSSStyleDeclarationTests.dart |
| index b04b727225de6769f749cbef23c10b605c552644..486222857b4d3e8288703f5b50c2044fd9747bd9 100644 |
| --- a/client/tests/client/html/CSSStyleDeclarationTests.dart |
| +++ b/client/tests/client/html/CSSStyleDeclarationTests.dart |
| @@ -2,63 +2,62 @@ |
| // for details. All rights reserved. Use of this source code is governed by a |
| // BSD-style license that can be found in the LICENSE file. |
| -class CSSStyleDeclarationTests extends UnitTestSuite { |
| - CSSStyleDeclarationTests(): super(); |
| - |
| - static void main() { |
| - new CSSStyleDeclarationTests().run(); |
| - } |
| +testCSSStyleDeclaration() { |
| + getStyle() { |
|
Jacob
2011/10/25 23:45:51
nit: rename to
createTestStyle
nweiz
2011/10/26 00:27:37
Done.
|
| + return new CSSStyleDeclaration.css(""" |
| + color: blue; |
| + width: 2px !important; |
| + -webkit-transform: rotate(90deg); |
| + """); |
| + }; |
| - void setUpTestSuite() { |
| - addTest(testCssText); |
| - addTest(testLength); |
| - addTest(testGetPropertyCSSValue); |
| - addTest(testGetPropertyPriority); |
| - addTest(testItem); |
| - addTest(testRemoveProperty); |
| - addTest(testGettersAndSetters); |
| - } |
| + test('default constructor is empty', () { |
| + var style = new CSSStyleDeclaration(); |
| + Expect.equals("", style.cssText); |
| + Expect.equals("", style.getPropertyPriority('color')); |
| + Expect.equals("", style.item(0)); |
| + Expect.equals(0, style.length); |
| + // Expect.isNull(style.parentRule); |
|
Jacob
2011/10/25 23:45:51
remove or note why they are commented out
nweiz
2011/10/26 00:27:37
Done.
|
| + // Expect.isNull(style.getPropertyCSSValue('color')); |
| + // Expect.isNull(style.getPropertyShorthand('color')); |
| + }); |
| - void testCssText() { |
| - var style = _style; |
| + test('cssText is wrapped', () { |
| + var style = getStyle(); |
| Expect.equals( |
| "color: blue; width: 2px !important; -webkit-transform: rotate(90deg); ", |
| style.cssText); |
| style.cssText = "color: red"; |
| Expect.equals("color: red; ", style.cssText); |
| - } |
| - |
| - void testLength() { |
| - Expect.equals(3, _style.length); |
| - } |
| + }); |
| - void testGetPropertyCSSValue() { |
| - Expect.equals("blue", _style.getPropertyCSSValue("color").cssText); |
| - } |
| + test('length is wrapped', () { |
|
Jacob
2011/10/25 23:45:51
i'm confused why these tests contain the text "is
nweiz
2011/10/26 00:27:37
The idea is that these tests just test that the pr
|
| + Expect.equals(3, getStyle().length); |
| + }); |
| - void testGetPropertyPriority() { |
| - var style = _style; |
| + test('getPropertyPriority is wrapped', () { |
| + var style = getStyle(); |
| Expect.equals("", style.getPropertyPriority("color")); |
| Expect.equals("important", style.getPropertyPriority("width")); |
| - } |
| + }); |
| - void testItem() { |
| - var style = _style; |
| + test('item is wrapped', () { |
| + var style = getStyle(); |
| Expect.equals("color", style.item(0)); |
| Expect.equals("width", style.item(1)); |
| Expect.equals("-webkit-transform", style.item(2)); |
| - } |
| + }); |
| - void testRemoveProperty() { |
| - var style = _style; |
| + test('removeProperty is wrapped', () { |
| + var style = getStyle(); |
| style.removeProperty("width"); |
| Expect.equals( |
| "color: blue; -webkit-transform: rotate(90deg); ", |
| style.cssText); |
| - } |
| + }); |
| - void testGettersAndSetters() { |
| - var style = _style; |
| + test('getters and setters are generated', () { |
|
Jacob
2011/10/25 23:45:51
nit: replace "getters and setters are generated" w
nweiz
2011/10/26 00:27:37
Done.
|
| + var style = getStyle(); |
| Expect.equals("blue", style.color); |
| Expect.equals("2px", style.width); |
| Expect.equals("rotate(90deg)", style.transform); |
| @@ -68,13 +67,5 @@ class CSSStyleDeclarationTests extends UnitTestSuite { |
| Expect.equals( |
| "width: 2px !important; color: red; -webkit-transform: translate(10px, 20px); ", |
| style.cssText); |
| - } |
| - |
| - CSSStyleDeclaration get _style() { |
| - return new Element.html("""<div style=' |
| - color: blue; |
| - width: 2px !important; |
| - -webkit-transform: rotate(90deg); |
| - '></div>""").style; |
| - } |
| + }); |
| } |