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

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

Issue 11293292: Add constructors for SVG elements and remove static factory providers for html elements. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 | « sdk/lib/svg/dartium/svg_dartium.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 '../../pkg/unittest/lib/unittest.dart'; 6 import '../../pkg/unittest/lib/unittest.dart';
7 import '../../pkg/unittest/lib/html_individual_config.dart'; 7 import '../../pkg/unittest/lib/html_individual_config.dart';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'dart:svg'; 9 import 'dart:svg';
10 10
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 testConstructor('text', (e) => e is SVGTextElement); 145 testConstructor('text', (e) => e is SVGTextElement);
146 testConstructor('textPath', (e) => e is SVGTextPathElement); 146 testConstructor('textPath', (e) => e is SVGTextPathElement);
147 testConstructor('title', (e) => e is SVGTitleElement); 147 testConstructor('title', (e) => e is SVGTitleElement);
148 testConstructor('use', (e) => e is SVGUseElement); 148 testConstructor('use', (e) => e is SVGUseElement);
149 testConstructor('view', (e) => e is SVGViewElement); 149 testConstructor('view', (e) => e is SVGViewElement);
150 }); 150 });
151 151
152 group('outerHTML', () { 152 group('outerHTML', () {
153 test('outerHTML', () { 153 test('outerHTML', () {
154 final el = new SVGSVGElement(); 154 final el = new SVGSVGElement();
155 el.elements.add(new SVGElement.tag("circle")); 155 el.elements.add(new SVGCircleElement());
156 el.elements.add(new SVGElement.tag("path")); 156 el.elements.add(new SVGPathElement());
157 expect(el.outerHTML, 157 expect(el.outerHTML,
158 '<svg version="1.1"><circle></circle><path></path></svg>'); 158 '<svg version="1.1"><circle></circle><path></path></svg>');
159 }); 159 });
160 }); 160 });
161 161
162 group('innerHTML', () { 162 group('innerHTML', () {
163 test('get', () { 163 test('get', () {
164 final el = new SVGSVGElement(); 164 final el = new SVGSVGElement();
165 el.elements.add(new SVGElement.tag("circle")); 165 el.elements.add(new SVGCircleElement());
166 el.elements.add(new SVGElement.tag("path")); 166 el.elements.add(new SVGPathElement());
167 expect(el.innerHTML, '<circle></circle><path></path>'); 167 expect(el.innerHTML, '<circle></circle><path></path>');
168 }); 168 });
169 169
170 test('set', () { 170 test('set', () {
171 final el = new SVGSVGElement(); 171 final el = new SVGSVGElement();
172 el.elements.add(new SVGElement.tag("circle")); 172 el.elements.add(new SVGCircleElement());
173 el.elements.add(new SVGElement.tag("path")); 173 el.elements.add(new SVGPathElement());
174 el.innerHTML = '<rect></rect><a></a>'; 174 el.innerHTML = '<rect></rect><a></a>';
175 expect(_nodeStrings(el.elements), ["rect", "a"]); 175 expect(_nodeStrings(el.elements), ["rect", "a"]);
176 }); 176 });
177 }); 177 });
178 178
179 group('elementget', () { 179 group('elementget', () {
180 test('get', () { 180 test('get', () {
181 final el = new SVGElement.svg(""" 181 final el = new SVGElement.svg("""
182 <svg version="1.1"> 182 <svg version="1.1">
183 <circle></circle> 183 <circle></circle>
184 <path></path> 184 <path></path>
185 text 185 text
186 </svg>"""); 186 </svg>""");
187 expect(_nodeStrings(el.elements), ["circle", "path"]); 187 expect(_nodeStrings(el.elements), ["circle", "path"]);
188 }); 188 });
189 }); 189 });
190 190
191 group('elementset', () { 191 group('elementset', () {
192 test('set', () { 192 test('set', () {
193 final el = new SVGSVGElement(); 193 final el = new SVGSVGElement();
194 el.elements = [new SVGElement.tag("circle"), new SVGElement.tag("path")]; 194 el.elements = [new SVGElement.tag("circle"), new SVGElement.tag("path")];
195 expect(el.innerHTML, '<circle></circle><path></path>'); 195 expect(el.innerHTML, '<circle></circle><path></path>');
196 }); 196 });
197 }); 197 });
198 } 198 }
OLDNEW
« no previous file with comments | « sdk/lib/svg/dartium/svg_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698