Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(258)

Unified Diff: client/tests/client/dom/CSSTest.dart

Issue 10222026: Migrate dom tests to dart:html. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: client/tests/client/dom/CSSTest.dart
diff --git a/client/tests/client/dom/CSSTest.dart b/client/tests/client/dom/CSSTest.dart
index c2ed44b586d67cd2db0bb44a364f2f8359f8546b..d0db3f47f163f740feaf1fa6faf9da7a650e42e1 100644
--- a/client/tests/client/dom/CSSTest.dart
+++ b/client/tests/client/dom/CSSTest.dart
@@ -1,22 +1,22 @@
#library('CSSTest');
#import('../../../../lib/unittest/unittest.dart');
-#import('../../../../lib/unittest/dom_config.dart');
-#import('dart:dom');
+#import('../../../../lib/unittest/html_config.dart');
+#import('dart:html');
main() {
- useDomConfiguration();
- test('WebKitCSSMatrix', () {
- WebKitCSSMatrix matrix1 = new WebKitCSSMatrix();
+ useHtmlConfiguration();
+ test('CSSMatrix', () {
+ CSSMatrix matrix1 = new CSSMatrix();
Expect.equals(1, matrix1.m11.round());
Expect.equals(0, matrix1.m12.round());
- WebKitCSSMatrix matrix2 = new WebKitCSSMatrix('matrix(1, 0, 0, 1, -835, 0)');
+ CSSMatrix matrix2 = new CSSMatrix('matrix(1, 0, 0, 1, -835, 0)');
Expect.equals(1, matrix2.a.round());
Expect.equals(-835, matrix2.e.round());
});
- test('WebKitPoint', () {
- HTMLElement element = document.createElement('div');
- element.setAttribute('style',
+ test('Point', () {
+ Element element = new Element.tag('div');
+ element.attributes['style'] =
'''
position: absolute;
width: 60px;
@@ -25,10 +25,10 @@ main() {
top: 0px;
background-color: red;
-webkit-transform: translate3d(250px, 100px, 0px) perspective(500px) rotateX(30deg);
- ''');
- document.body.appendChild(element);
+ ''';
+ document.body.nodes.add(element);
- WebKitPoint point = new WebKitPoint(5, 2);
+ Point point = new Point(5, 2);
checkPoint(5, 2, point);
checkPoint(256, 110, window.webkitConvertPointFromNodeToPage(element, point));
point.y = 100;
@@ -37,7 +37,7 @@ main() {
});
}
-void checkPoint(expectedX, expectedY, WebKitPoint point) {
+void checkPoint(expectedX, expectedY, Point point) {
Expect.equals(expectedX, point.x.round(), 'Wrong point.x');
Expect.equals(expectedY, point.y.round(), 'Wrong point.y');
}

Powered by Google App Engine
This is Rietveld 408576698