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

Side by Side Diff: pkg/third_party/html5lib/test/dom_test.dart

Issue 158083002: introduce web_components pkg for consolidated polyfills (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
1 /** Additional feature tests that aren't based on test data. */ 1 /** Additional feature tests that aren't based on test data. */
2 library dom_test; 2 library dom_test;
3 3
4 import 'package:unittest/unittest.dart'; 4 import 'package:unittest/unittest.dart';
5 import 'package:html5lib/parser.dart'; 5 import 'package:html5lib/parser.dart';
6 import 'package:html5lib/dom.dart'; 6 import 'package:html5lib/dom.dart';
7 7
8 main() { 8 main() {
9 group('Node.query type selectors', () { 9 group('Node.querySelector type selectors', () {
10 test('x-foo', () { 10 test('x-foo', () {
11 expect(parse('<x-foo>').body.query('x-foo'), isNotNull); 11 expect(parse('<x-foo>').body.querySelector('x-foo'), isNotNull);
12 }); 12 });
13 13
14 test('-x-foo', () { 14 test('-x-foo', () {
15 var doc = parse('<body><-x-foo>'); 15 var doc = parse('<body><-x-foo>');
16 expect(doc.body.outerHtml, equals('<body>&lt;-x-foo&gt;</body>')); 16 expect(doc.body.outerHtml, equals('<body>&lt;-x-foo&gt;</body>'));
17 expect(doc.body.query('-x-foo'), isNull); 17 expect(doc.body.querySelector('-x-foo'), isNull);
18 }); 18 });
19 19
20 test('foo123', () { 20 test('foo123', () {
21 expect(parse('<foo123>').body.query('foo123'), isNotNull); 21 expect(parse('<foo123>').body.querySelector('foo123'), isNotNull);
22 }); 22 });
23 23
24 test('123 - invalid', () { 24 test('123 - invalid', () {
25 var doc = parse('<123>'); 25 var doc = parse('<123>');
26 expect(() => doc.body.query('123'), throwsUnimplementedError); 26 expect(() => doc.body.querySelector('123'), throwsUnimplementedError);
27 }); 27 });
28 28
29 test('x\\ny - not implemented', () { 29 test('x\\ny - not implemented', () {
30 var doc = parse('<x\\ny>'); 30 var doc = parse('<x\\ny>');
31 expect(() => doc.body.query('x\\ny'), throwsUnimplementedError); 31 expect(() => doc.body.querySelector('x\\ny'), throwsUnimplementedError);
32 }); 32 });
33 }); 33 });
34 } 34 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698