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

Unified Diff: test/codegen/lib/html/custom_tags_test.dart

Issue 1930043002: Add all dart:html tests from the sdk to test/codegen. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: ptal Created 4 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 side-by-side diff with in-line comments
Download patch
Index: test/codegen/lib/html/custom_tags_test.dart
diff --git a/test/codegen/lib/html/custom_tags_test.dart b/test/codegen/lib/html/custom_tags_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..5f5457b5f27d20b41e1ab4fac95e6dbe51155b30
--- /dev/null
+++ b/test/codegen/lib/html/custom_tags_test.dart
@@ -0,0 +1,49 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library custom_tags_test;
+import 'package:unittest/unittest.dart';
+import 'package:unittest/html_config.dart';
+import 'dart:html';
+import 'utils.dart';
+
+main() {
+ useHtmlConfiguration();
+
+ test('create via custom tag', () {
+ var element = new Element.tag('x-basic1')..id = 'basic1';
+ document.body.nodes.add(element);
+
+ var queryById = query('#basic1');
+ expect(queryById, equals(element));
+
+ var queryByTag = queryAll('x-basic1');
+ expect(queryByTag.length, equals(1));
+ expect(queryByTag[0], equals(element));
+ });
+
+ test('custom inner html', () {
+ var element = new DivElement();
+ element.setInnerHtml("<x-basic2 id='basic2'></x-basic2>",
+ treeSanitizer: new NullTreeSanitizer());
+ document.body.nodes.add(element);
+
+ var queryById = query('#basic2');
+ expect(queryById is Element, isTrue);
+
+ var queryByTag = queryAll('x-basic2');
+ expect(queryByTag.length, equals(1));
+ expect(queryByTag[0], equals(queryById));
+ });
+
+ test('type extension inner html', () {
+ var element = new DivElement();
+ element.setInnerHtml("<div is='x-basic3' id='basic3'></div>",
+ treeSanitizer: new NullTreeSanitizer());
+ document.body.nodes.add(element);
+
+ var queryById = query('#basic3');
+ expect(queryById is DivElement, isTrue);
+ });
+}
« no previous file with comments | « test/codegen/lib/html/custom_elements_test.html ('k') | test/codegen/lib/html/dart_object_local_storage_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698