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

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

Issue 1078583002: "Reverting 44988" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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/html.status ('k') | tools/dom/src/NodeValidatorBuilder.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 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 validator_test; 5 library validator_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'dart:svg' as svg; 9 import 'dart:svg' as svg;
10 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 validator, 333 validator,
334 '<div template repeat="{{}}"></div>'); 334 '<div template repeat="{{}}"></div>');
335 335
336 testHtml('blocks illegal template attribute', 336 testHtml('blocks illegal template attribute',
337 validator, 337 validator,
338 '<div template="foo" repeat="{{}}"></div>', 338 '<div template="foo" repeat="{{}}"></div>',
339 '<div></div>'); 339 '<div></div>');
340 }); 340 });
341 341
342 group('allowSvg', () { 342 group('allowSvg', () {
343 var validator = new NodeValidatorBuilder() 343 var validator = new NodeValidatorBuilder()..allowSvg();
344 ..allowSvg()
345 ..allowTextElements();
346 344
347 testHtml('allows basic SVG', 345 testHtml('allows basic SVG',
348 validator, 346 validator,
349 '<svg xmlns="http://www.w3.org/2000/svg' 347 '<svg xmlns="http://www.w3.org/2000/svg'
350 'xmlns:xlink="http://www.w3.org/1999/xlink">' 348 'xmlns:xlink="http://www.w3.org/1999/xlink">'
351 '<image xlink:href="foo" data-foo="bar"/>' 349 '<image xlink:href="foo" data-foo="bar"/>'
352 '</svg>'); 350 '</svg>');
353 351
354 testHtml('blocks script elements', 352 testHtml('blocks script elements',
355 validator, 353 validator,
(...skipping 14 matching lines...) Expand all
370 '</svg>'); 368 '</svg>');
371 369
372 testHtml('blocks foreignObject content', 370 testHtml('blocks foreignObject content',
373 validator, 371 validator,
374 '<svg xmlns="http://www.w3.org/2000/svg">' 372 '<svg xmlns="http://www.w3.org/2000/svg">'
375 '<foreignobject width="100" height="150">' 373 '<foreignobject width="100" height="150">'
376 '<body xmlns="http://www.w3.org/1999/xhtml">' 374 '<body xmlns="http://www.w3.org/1999/xhtml">'
377 '<div>Some content</div>' 375 '<div>Some content</div>'
378 '</body>' 376 '</body>'
379 '</foreignobject>' 377 '</foreignobject>'
380 '<b>42</b>' 378 '<number>42</number>'
381 '</svg>', 379 '</svg>',
382 '<svg xmlns="http://www.w3.org/2000/svg">' 380 '<svg xmlns="http://www.w3.org/2000/svg">'
383 '<b>42</b>' 381 '<number>42</number>'
384 '</svg>'); 382 '</svg>');
385 }); 383 });
386 384
387 group('allowInlineStyles', () { 385 group('allowInlineStyles', () {
388 var validator = new NodeValidatorBuilder() 386 var validator = new NodeValidatorBuilder()
389 ..allowTextElements() 387 ..allowTextElements()
390 ..allowInlineStyles(); 388 ..allowInlineStyles();
391 389
392 testHtml('allows inline styles', 390 testHtml('allows inline styles',
393 validator, 391 validator,
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 '<image xlink:href="foo" data-foo="bar"/>' 451 '<image xlink:href="foo" data-foo="bar"/>'
454 '</svg>'; 452 '</svg>';
455 453
456 var fragment = new DocumentFragment.svg(svgText); 454 var fragment = new DocumentFragment.svg(svgText);
457 var element = fragment.nodes.first; 455 var element = fragment.nodes.first;
458 expect(element is svg.SvgSvgElement, isTrue); 456 expect(element is svg.SvgSvgElement, isTrue);
459 expect(element.children[0] is svg.ImageElement, isTrue); 457 expect(element.children[0] is svg.ImageElement, isTrue);
460 }); 458 });
461 }); 459 });
462 } 460 }
OLDNEW
« no previous file with comments | « tests/html/html.status ('k') | tools/dom/src/NodeValidatorBuilder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698