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

Unified Diff: packages/web_components/test/custom_element_test.dart

Issue 2312183003: Removed Polymer from Observatory deps (Closed)
Patch Set: Created 4 years, 3 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: packages/web_components/test/custom_element_test.dart
diff --git a/packages/web_components/test/custom_element_test.dart b/packages/web_components/test/custom_element_test.dart
index 641c8c9b3028cebc0decd0a919b80a759d161617..b0b8cf80f52a2430b05c43b8c29b45424f4d9ad1 100644
--- a/packages/web_components/test/custom_element_test.dart
+++ b/packages/web_components/test/custom_element_test.dart
@@ -1,12 +1,12 @@
// Copyright (c) 2015, 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.
+@TestOn('browser')
library web_components.test.custom_element_test;
import 'dart:async';
import 'dart:html';
-import 'package:unittest/html_config.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
import 'package:web_components/web_components.dart';
@CustomElement('basic-element')
@@ -32,8 +32,7 @@ class ExtendedElement extends InputElement {
}
main() {
- useHtmlConfiguration();
- initWebComponents().then((_) {
+ return initWebComponents().then((_) {
var container = querySelector('#container') as DivElement;
setUp(() {
@@ -47,9 +46,9 @@ main() {
test('basic custom element', () {
expect(document.querySelector('basic-element') is BasicElement, isTrue);
container.append(new BasicElement());
- container.appendHtml('<basic-element></basic-element>');
- // TODO(jakemac): after appendHtml elements are upgraded asynchronously,
- // why? https://github.com/dart-lang/web-components/issues/4
+ container.appendHtml('<basic-element></basic-element>',
+ treeSanitizer: nullSanitizer);
+ // elements are upgraded asynchronously
return new Future(() {}).then((_) {
var elements = container.querySelectorAll('basic-element');
expect(elements.length, 2);
@@ -62,9 +61,9 @@ main() {
test('child custom element', () {
expect(document.querySelector('child-element') is ChildElement, isTrue);
container.append(new ChildElement());
- container.appendHtml('<child-element></child-element>');
- // TODO(jakemac): after appendHtml elements are upgraded asynchronously,
- // why? https://github.com/dart-lang/web-components/issues/4
+ container.appendHtml('<child-element></child-element>',
+ treeSanitizer: nullSanitizer);
+ // elements are upgraded asynchronously
return new Future(() {}).then((_) {
var elements = container.querySelectorAll('child-element');
expect(elements.length, 2);
@@ -77,9 +76,9 @@ main() {
test('extends input element', () {
expect(document.querySelector('input') is ExtendedElement, isTrue);
container.append(new ExtendedElement());
- container.appendHtml('<input is="extended-element" />');
- // TODO(jakemac): after appendHtml elements are upgraded asynchronously,
- // why? https://github.com/dart-lang/web-components/issues/4
+ container.appendHtml('<input is="extended-element" />',
+ treeSanitizer: nullSanitizer);
+ // elements are upgraded asynchronously
return new Future(() {}).then((_) {
var elements = container.querySelectorAll('input');
expect(elements.length, 2);
@@ -90,3 +89,10 @@ main() {
});
});
}
+
+class NullTreeSanitizer implements NodeTreeSanitizer {
+ const NullTreeSanitizer();
+ void sanitizeTree(Node node) {}
+}
+
+final nullSanitizer = const NullTreeSanitizer();
« no previous file with comments | « packages/web_components/test/custom_element_proxy_test.html ('k') | packages/web_components/test/custom_element_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698