Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: tests/html/svg_1_test.dart

Issue 12082122: Add supported checks to the SVG library, and library cleanup. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 library SVG1Test;
2 import '../../pkg/unittest/lib/unittest.dart';
3 import '../../pkg/unittest/lib/html_config.dart';
4 import 'dart:html';
5 import 'dart:svg' as svg;
6
7 // Test that SVG is present in dart:html API
8
9 main() {
10 useHtmlConfiguration();
11
12 var isSvgElement = predicate((x) => x is svg.SvgElement, 'is a SvgElement');
13
14 test('simpleRect', () {
15 var div = new Element.tag('div');
16 document.body.nodes.add(div);
17 div.innerHtml = r'''
18 <svg id='svg1' width='200' height='100'>
19 <rect id='rect1' x='10' y='20' width='130' height='40' rx='5'fill='blue'></rect>
20 </svg>
21
22 ''';
23
24 var e = document.query('#svg1');
25 expect(e, isNotNull);
26
27 svg.RectElement r = document.query('#rect1');
28 expect(r.x.baseVal.value, 10);
29 expect(r.y.baseVal.value, 20);
30 expect(r.height.baseVal.value, 40);
31 expect(r.width.baseVal.value, 130);
32 expect(r.rx.baseVal.value, 5);
33 });
34
35 test('trailing newline', () {
36 // Ensures that we handle SVG with trailing newlines.
37 var logo = new svg.SvgElement.svg("""
38 <svg xmlns="http://www.w3.org/2000/svg" version="1.1">
39 <path/>
40 </svg>
41 """);
42
43 expect(logo, isSvgElement);
44
45 });
46 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698