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

Unified Diff: pkg/third_party/html5lib/test/dom_test.dart

Issue 22375011: move html5lib code into dart svn repo (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: change location of html5lib to pkg/third_party/html5lib Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: pkg/third_party/html5lib/test/dom_test.dart
diff --git a/pkg/third_party/html5lib/test/dom_test.dart b/pkg/third_party/html5lib/test/dom_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..8b339f0da61425b10177960d6478338263db6680
--- /dev/null
+++ b/pkg/third_party/html5lib/test/dom_test.dart
@@ -0,0 +1,34 @@
+/** Additional feature tests that aren't based on test data. */
+library dom_test;
+
+import 'package:unittest/unittest.dart';
+import 'package:html5lib/parser.dart';
+import 'package:html5lib/dom.dart';
+
+main() {
+ group('Node.query type selectors', () {
+ test('x-foo', () {
+ expect(parse('<x-foo>').body.query('x-foo'), isNotNull);
+ });
+
+ test('-x-foo', () {
+ var doc = parse('<body><-x-foo>');
+ expect(doc.body.outerHtml, equals('<body>&lt;-x-foo&gt;</body>'));
+ expect(doc.body.query('-x-foo'), isNull);
+ });
+
+ test('foo123', () {
+ expect(parse('<foo123>').body.query('foo123'), isNotNull);
+ });
+
+ test('123 - invalid', () {
+ var doc = parse('<123>');
+ expect(() => doc.body.query('123'), throwsUnimplementedError);
+ });
+
+ test('x\\ny - not implemented', () {
+ var doc = parse('<x\\ny>');
+ expect(() => doc.body.query('x\\ny'), throwsUnimplementedError);
+ });
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698