2dcd56ef43
There are far too many files here to review everyone carefully. Spot checking most of the diffs look good as test code is generally written with less care than application code so lots of ugly formatting get through. If people notice files where the automated formatting bothers them feel free to comment indicating file names and I'll move spaces within comments to make the formatting cleaner and use comments to force block formatting as I have done for other case where formatting looked bad. BUG= R=efortuna@google.com Review-Url: https://codereview.chromium.org/2771453003 .
47 lines
1.3 KiB
Dart
47 lines
1.3 KiB
Dart
library CssTest;
|
|
|
|
import 'package:unittest/unittest.dart';
|
|
import 'package:unittest/html_individual_config.dart';
|
|
import 'dart:html';
|
|
|
|
main() {
|
|
useHtmlIndividualConfiguration();
|
|
|
|
group('supportsPointConversions', () {
|
|
test('supported', () {
|
|
expect(Window.supportsPointConversions, true);
|
|
});
|
|
});
|
|
|
|
group('functional', () {
|
|
test('DomPoint', () {
|
|
var expectation =
|
|
Window.supportsPointConversions ? 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);
|
|
-moz-transform: translate3d(250px, 100px, 0px);
|
|
''';
|
|
document.body.append(element);
|
|
|
|
var elemRect = element.getBoundingClientRect();
|
|
|
|
checkPoint(250, 100, new Point(elemRect.left, elemRect.top));
|
|
checkPoint(310, 200, new Point(elemRect.right, elemRect.bottom));
|
|
}, expectation);
|
|
});
|
|
});
|
|
}
|
|
|
|
void checkPoint(expectedX, expectedY, Point point) {
|
|
expect(point.x.round(), equals(expectedX), reason: 'Wrong point.x');
|
|
expect(point.y.round(), equals(expectedY), reason: 'Wrong point.y');
|
|
}
|