7ea539a4c5
Migrated multiple tests from unittest->test, fixed small strong mode issue in cross_frame_test. Bug: Change-Id: I1c504ab4ac45e487ff3d3d156416e579978adc20 Reviewed-on: https://dart-review.googlesource.com/4820 Reviewed-by: Terry Lucas <terry@google.com> Reviewed-by: Bob Nystrom <rnystrom@google.com>
33 lines
819 B
Dart
33 lines
819 B
Dart
import 'dart:html';
|
|
|
|
import 'package:expect/minitest.dart';
|
|
|
|
main() {
|
|
var isRectList =
|
|
predicate((x) => x is List<Rectangle>, 'is a List<Rectangle>');
|
|
|
|
insertTestDiv() {
|
|
var element = new Element.tag('div');
|
|
element.innerHtml = r'''
|
|
A large block of text should go here. Click this
|
|
block of text multiple times to see each line
|
|
highlight with every click of the mouse button.
|
|
''';
|
|
document.body.append(element);
|
|
return element;
|
|
}
|
|
|
|
test("ClientRectList test", () {
|
|
insertTestDiv();
|
|
var range = new Range();
|
|
var rects = range.getClientRects();
|
|
expect(rects, isRectList);
|
|
});
|
|
|
|
test("ClientRect ==", () {
|
|
var rect1 = document.body.getBoundingClientRect();
|
|
var rect2 = document.body.getBoundingClientRect();
|
|
expect(rect1, equals(rect2));
|
|
});
|
|
}
|