OLD | NEW |
1 library ClientRectTest; | |
2 import 'package:unittest/unittest.dart'; | |
3 import 'package:unittest/html_config.dart'; | |
4 import 'dart:html'; | 1 import 'dart:html'; |
5 | 2 |
| 3 import 'package:minitest/minitest.dart'; |
| 4 |
6 main() { | 5 main() { |
7 | |
8 var isRectList = | 6 var isRectList = |
9 predicate((x) => x is List<Rectangle>, 'is a List<Rectangle>'); | 7 predicate((x) => x is List<Rectangle>, 'is a List<Rectangle>'); |
10 | 8 |
11 insertTestDiv() { | 9 insertTestDiv() { |
12 var element = new Element.tag('div'); | 10 var element = new Element.tag('div'); |
13 element.innerHtml = r''' | 11 element.innerHtml = r''' |
14 A large block of text should go here. Click this | 12 A large block of text should go here. Click this |
15 block of text multiple times to see each line | 13 block of text multiple times to see each line |
16 highlight with every click of the mouse button. | 14 highlight with every click of the mouse button. |
17 '''; | 15 '''; |
18 document.body.append(element); | 16 document.body.append(element); |
19 return element; | 17 return element; |
20 } | 18 } |
21 | 19 |
22 useHtmlConfiguration(); | 20 test("ClientRectList test", () { |
23 | |
24 test("ClientRectList test", () { | |
25 insertTestDiv(); | 21 insertTestDiv(); |
26 var range = new Range(); | 22 var range = new Range(); |
27 var rects = range.getClientRects(); | 23 var rects = range.getClientRects(); |
28 expect(rects, isRectList); | 24 expect(rects, isRectList); |
29 }); | 25 }); |
30 } | 26 } |
OLD | NEW |