| Index: tests/html/rect_test.dart
|
| diff --git a/tests/html/rect_test.dart b/tests/html/rect_test.dart
|
| index 369b44719497781f7f47638f97cb8c34205a5bcc..4606e989b556237caa3df4d56f3d69e7d28899c1 100644
|
| --- a/tests/html/rect_test.dart
|
| +++ b/tests/html/rect_test.dart
|
| @@ -15,6 +15,17 @@ main() {
|
| return a != null ? new Rect(a[0], a[1], a[2] - a[0], a[3] - a[1]) : null;
|
| }
|
|
|
| + Rect createClientRect(List<num> a) {
|
| + var element = new DivElement();
|
| + element.style.left = '${a[0]}px';
|
| + element.style.top = '${a[1]}px';
|
| + element.style.width = '${a[2] - a[0]}px';
|
| + element.style.height = '${a[3] - a[1]}px';
|
| + element.style.position = 'absolute';
|
| + document.body.append(element);
|
| + return element.getBoundingClientRect();
|
| + }
|
| +
|
| test('construction', () {
|
| var r0 = new Rect(10, 20, 30, 40);
|
| expect(r0.toString(), '(10, 20, 30, 40)');
|
| @@ -42,6 +53,12 @@ main() {
|
|
|
| expect(r0.intersection(r1), expected);
|
| expect(r1.intersection(r0), expected);
|
| +
|
| + var r2 = createClientRect(test[0]);
|
| + var r3 = createClientRect(test[1]);
|
| +
|
| + expect(r2.intersection(r3), expected);
|
| + expect(r3.intersection(r2), expected);
|
| }
|
| });
|
|
|
| @@ -71,6 +88,12 @@ main() {
|
|
|
| expect(r0.union(r1), expected);
|
| expect(r1.union(r0), expected);
|
| +
|
| + var r2 = createClientRect(test[0]);
|
| + var r3 = createClientRect(test[1]);
|
| +
|
| + expect(r2.union(r3), expected);
|
| + expect(r3.union(r2), expected);
|
| }
|
| });
|
|
|
|
|