| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library SvgElementTest; | 5 library SvgElementTest; |
| 6 import "package:expect/expect.dart"; | 6 import "package:expect/expect.dart"; |
| 7 import '../../pkg/unittest/lib/unittest.dart'; | 7 import '../../pkg/unittest/lib/unittest.dart'; |
| 8 import '../../pkg/unittest/lib/html_individual_config.dart'; | 8 import '../../pkg/unittest/lib/html_individual_config.dart'; |
| 9 import 'dart:html'; | 9 import 'dart:html'; |
| 10 import 'dart:svg' as svg; | 10 import 'dart:svg' as svg; |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 test('classes', () { | 415 test('classes', () { |
| 416 var el = new svg.CircleElement(); | 416 var el = new svg.CircleElement(); |
| 417 var classes = el.classes; | 417 var classes = el.classes; |
| 418 expect(el.classes.length, 0); | 418 expect(el.classes.length, 0); |
| 419 classes.toggle('foo'); | 419 classes.toggle('foo'); |
| 420 expect(el.classes.length, 1); | 420 expect(el.classes.length, 1); |
| 421 classes.toggle('foo'); | 421 classes.toggle('foo'); |
| 422 expect(el.classes.length, 0); | 422 expect(el.classes.length, 0); |
| 423 }); | 423 }); |
| 424 }); | 424 }); |
| 425 |
| 426 group('getBoundingClientRect', () { |
| 427 test('is a Rect', () { |
| 428 var element = new svg.RectElement(); |
| 429 element.attributes['width'] = '100'; |
| 430 element.attributes['height'] = '100'; |
| 431 var root = new svg.SvgSvgElement(); |
| 432 root.append(element); |
| 433 |
| 434 document.body.append(root); |
| 435 |
| 436 var rect = element.getBoundingClientRect(); |
| 437 expect(rect is Rect, isTrue); |
| 438 expect(rect.width, 100); |
| 439 expect(rect.height, 100); |
| 440 }); |
| 441 }); |
| 425 } | 442 } |
| OLD | NEW |