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

Unified Diff: packages/web_components/test/custom_element_proxy_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_proxy_test.dart
diff --git a/packages/web_components/test/custom_element_proxy_test.dart b/packages/web_components/test/custom_element_proxy_test.dart
index 5fa11e0dbe569ecb5145afde6fc9ac0aaab93c5a..d95012e6f69cd43afdb6a67f9b8557a53bb6f0cf 100644
--- a/packages/web_components/test/custom_element_proxy_test.dart
+++ b/packages/web_components/test/custom_element_proxy_test.dart
@@ -1,13 +1,13 @@
// 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 custom_element_proxy_test;
import 'dart:async';
import 'dart:html';
import 'dart:js';
-import 'package:unittest/html_config.dart';
-import 'package:unittest/unittest.dart';
+import 'package:test/test.dart';
import 'package:web_components/web_components.dart';
@CustomElementProxy('basic-element')
@@ -32,8 +32,7 @@ class ExtendedElement extends InputElement {
}
main() {
- useHtmlConfiguration();
- initWebComponents().then((_) {
+ return initWebComponents().then((_) {
var container = querySelector('#container') as DivElement;
tearDown(() {
@@ -42,15 +41,14 @@ main() {
test('basic custom element', () {
container.append(new BasicElement());
- container.appendHtml('<basic-element></basic_element>');
+ container.appendHtml('<basic-element></basic_element>',
+ treeSanitizer: nullSanitizer);
// TODO(jakemac): after appendHtml elements are upgraded asynchronously,
// why? https://github.com/dart-lang/web-components/issues/4
return new Future(() {}).then((_) {
var elements = container.querySelectorAll('basic-element');
expect(elements.length, 2);
for (BasicElement element in elements) {
- print(element.outerHtml);
- print(element.runtimeType);
expect(element.isBasicElement, isTrue);
}
});
@@ -58,7 +56,8 @@ main() {
test('extends custom element', () {
container.append(new ExtendedElement());
- container.appendHtml('<input is="extended-element" />');
+ container.appendHtml('<input is="extended-element" />',
+ treeSanitizer: nullSanitizer);
// TODO(jakemac): after appendHtml elements are upgraded asynchronously,
// why? https://github.com/dart-lang/web-components/issues/4
return new Future(() {}).then((_) {
@@ -71,3 +70,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/build/transformer_test.dart ('k') | packages/web_components/test/custom_element_proxy_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698