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

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

Issue 9314008: Migrate all LayoutTests/dart/dom to main repo. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update config file Created 8 years, 11 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
« no previous file with comments | « client/tests/client/dom/AudioContextTest.dart ('k') | client/tests/client/dom/CacheTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/tests/client/dom/CSSTest.dart
diff --git a/client/tests/client/dom/CSSTest.dart b/client/tests/client/dom/CSSTest.dart
new file mode 100644
index 0000000000000000000000000000000000000000..d4951441526f19bef8d9765fdfd03b4fbd3d4c02
--- /dev/null
+++ b/client/tests/client/dom/CSSTest.dart
@@ -0,0 +1,42 @@
+#library('CSSTest');
+#import('../../../testing/unittest/unittest.dart');
+#import('dart:dom');
+
+main() {
+ forLayoutTests();
+ test('WebKitCSSMatrix', () {
+ WebKitCSSMatrix matrix1 = new WebKitCSSMatrix();
+ Expect.equals(1, matrix1.m11.round());
+ Expect.equals(0, matrix1.m12.round());
+
+ WebKitCSSMatrix matrix2 = new WebKitCSSMatrix('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',
+ '''
+ position: absolute;
+ width: 60px;
+ height: 100px;
+ left: 0px;
+ top: 0px;
+ background-color: red;
+ -webkit-transform: translate3d(250px, 100px, 0px) perspective(500px) rotateX(30deg);
+ ''');
+ document.body.appendChild(element);
+
+ WebKitPoint point = new WebKitPoint(5, 2);
+ checkPoint(5, 2, point);
+ checkPoint(256, 110, window.webkitConvertPointFromNodeToPage(element, point));
+ point.y = 100;
+ checkPoint(5, 100, point);
+ checkPoint(254, 196, window.webkitConvertPointFromNodeToPage(element, point));
+ });
+}
+
+void checkPoint(expectedX, expectedY, WebKitPoint point) {
+ Expect.equals(expectedX, point.x.round(), 'Wrong point.x');
+ Expect.equals(expectedY, point.y.round(), 'Wrong point.y');
+}
« no previous file with comments | « client/tests/client/dom/AudioContextTest.dart ('k') | client/tests/client/dom/CacheTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698