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