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

Unified Diff: tests/html/css_test.dart

Issue 12049097: Adding supported checks for CssMatrix and Point. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « sdk/lib/html/dartium/html_dartium.dart ('k') | tests/html/html.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/css_test.dart
diff --git a/tests/html/css_test.dart b/tests/html/css_test.dart
index d827ab38b929ecc277ba6bfcc687ef5ccc8bdc08..13418f3fb5ce45a79c47b634b7d88ea4291102e5 100644
--- a/tests/html/css_test.dart
+++ b/tests/html/css_test.dart
@@ -1,43 +1,64 @@
library CssTest;
import '../../pkg/unittest/lib/unittest.dart';
-import '../../pkg/unittest/lib/html_config.dart';
+import '../../pkg/unittest/lib/html_individual_config.dart';
import 'dart:html';
main() {
- useHtmlConfiguration();
- test('CssMatrix', () {
- CssMatrix matrix1 = new CssMatrix();
- expect(matrix1.m11.round(), equals(1));
- expect(matrix1.m12.round(), isZero);
+ useHtmlIndividualConfiguration();
- CssMatrix matrix2 = new CssMatrix('matrix(1, 0, 0, 1, -835, 0)');
- expect(matrix2.a.round(), equals(1));
- expect(matrix2.e.round(), equals(-835));
+ group('supported_CssMatrix', () {
+ test('supported', () {
+ expect(CssMatrix.supported, true);
+ });
});
- test('Point', () {
- Element element = new Element.tag('div');
- element.attributes['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.nodes.add(element);
- Point point = new Point(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));
+ group('supported_DomPoint', () {
+ test('supported', () {
+ expect(DomPoint.supported, true);
+ });
+ });
+
+ group('functional', () {
+ test('CssMatrix', () {
+ var expectation = CssMatrix.supported ? returnsNormally : throws;
+ expect(() {
+ CssMatrix matrix1 = new CssMatrix();
+ expect(matrix1.m11.round(), equals(1));
+ expect(matrix1.m12.round(), isZero);
+
+ CssMatrix matrix2 = new CssMatrix('matrix(1, 0, 0, 1, -835, 0)');
+ expect(matrix2.a.round(), equals(1));
+ expect(matrix2.e.round(), equals(-835));
+ }, expectation);
+ });
+ test('DomPoint', () {
+ var expectation = DomPoint.supported ? returnsNormally : throws;
+ expect(() {
+ Element element = new Element.tag('div');
+ element.attributes['style'] =
+ '''
+ position: absolute;
+ width: 60px;
+ height: 100px;
+ left: 0px;
+ top: 0px;
+ background-color: red;
+ -webkit-transform: translate3d(250px, 100px, 0px);
+ ''';
+ document.body.nodes.add(element);
+
+ DomPoint point = new DomPoint(5, 2);
+ checkPoint(5, 2, point);
+ checkPoint(255, 102, window.convertPointFromNodeToPage(element, point));
+ point.y = 100;
+ checkPoint(5, 100, point);
+ checkPoint(255, 200, window.convertPointFromNodeToPage(element, point));
+ }, expectation);
+ });
});
}
-void checkPoint(expectedX, expectedY, Point point) {
+void checkPoint(expectedX, expectedY, DomPoint point) {
expect(point.x.round(), equals(expectedX), reason: 'Wrong point.x');
expect(point.y.round(), equals(expectedY), reason: 'Wrong point.y');
}
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698