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

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

Issue 10996010: Update tests/html to use r'' strings (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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
« no previous file with comments | « tests/html/htmlcollection_test.dart ('k') | tests/html/svg_2_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #library('SVG1Test'); 1 #library('SVG1Test');
2 #import('../../pkg/unittest/unittest.dart'); 2 #import('../../pkg/unittest/unittest.dart');
3 #import('../../pkg/unittest/html_config.dart'); 3 #import('../../pkg/unittest/html_config.dart');
4 #import('dart:html'); 4 #import('dart:html');
5 5
6 // Test that SVG is present in dart:html API 6 // Test that SVG is present in dart:html API
7 7
8 main() { 8 main() {
9 useHtmlConfiguration(); 9 useHtmlConfiguration();
10 10
11 test('simpleRect', () { 11 test('simpleRect', () {
12 var div = new Element.tag('div'); 12 var div = new Element.tag('div');
13 document.body.nodes.add(div); 13 document.body.nodes.add(div);
14 div.innerHTML = @''' 14 div.innerHTML = r'''
15 <svg id='svg1' width='200' height='100'> 15 <svg id='svg1' width='200' height='100'>
16 <rect id='rect1' x='10' y='20' width='130' height='40' rx='5'fill='blue'></rect> 16 <rect id='rect1' x='10' y='20' width='130' height='40' rx='5'fill='blue'></rect>
17 </svg> 17 </svg>
18 18
19 '''; 19 ''';
20 20
21 var e = document.query('#svg1'); 21 var e = document.query('#svg1');
22 Expect.isTrue(e != null); 22 Expect.isTrue(e != null);
23 23
24 SVGRectElement r = document.query('#rect1'); 24 SVGRectElement r = document.query('#rect1');
25 Expect.equals(10, r.x.baseVal.value); 25 Expect.equals(10, r.x.baseVal.value);
26 Expect.equals(20, r.y.baseVal.value); 26 Expect.equals(20, r.y.baseVal.value);
27 Expect.equals(40, r.height.baseVal.value); 27 Expect.equals(40, r.height.baseVal.value);
28 Expect.equals(130, r.width.baseVal.value); 28 Expect.equals(130, r.width.baseVal.value);
29 Expect.equals(5, r.rx.baseVal.value); 29 Expect.equals(5, r.rx.baseVal.value);
30 }); 30 });
31 31
32 test('trailing newline', () { 32 test('trailing newline', () {
33 // Ensures that we handle SVG with trailing newlines. 33 // Ensures that we handle SVG with trailing newlines.
34 var logo = new SVGElement.svg(""" 34 var logo = new SVGElement.svg("""
35 <svg xmlns="http://www.w3.org/2000/svg" version="1.1"> 35 <svg xmlns="http://www.w3.org/2000/svg" version="1.1">
36 <path/> 36 <path/>
37 </svg> 37 </svg>
38 """); 38 """);
39 39
40 expect(logo is SVGElement, true); 40 expect(logo is SVGElement, true);
41 41
42 }); 42 });
43 } 43 }
OLDNEW
« no previous file with comments | « tests/html/htmlcollection_test.dart ('k') | tests/html/svg_2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698