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

Unified Diff: packages/polymer/test/inject_bound_html_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
« no previous file with comments | « packages/polymer/test/import_test.html ('k') | packages/polymer/test/inject_bound_html_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/polymer/test/inject_bound_html_test.dart
diff --git a/packages/polymer/test/inject_bound_html_test.dart b/packages/polymer/test/inject_bound_html_test.dart
deleted file mode 100644
index 2f8910e5a87143e852e55f84bd049e300a419098..0000000000000000000000000000000000000000
--- a/packages/polymer/test/inject_bound_html_test.dart
+++ /dev/null
@@ -1,76 +0,0 @@
-// 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.
-
-import 'dart:async';
-import 'dart:html';
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
-import 'package:polymer/polymer.dart';
-
-@CustomTag('x-foo')
-class XFoo extends PolymerElement {
- @observable String bar = "baz";
-
- XFoo.created() : super.created();
-
- @ComputedProperty('bar')
- String get ignore => readValue(#bar);
-}
-
-class NullTreeSanitizer implements NodeTreeSanitizer {
- const NullTreeSanitizer();
- void sanitizeTree(Node node) {}
-}
-final nullSanitizer = const NullTreeSanitizer();
-
-class NullNodeValidator implements NodeValidator {
- const NullNodeValidator();
- bool allowsAttribute(Element e, String a, String v) => true;
- bool allowsElement(Element element) => true;
-}
-final nullValidator = const NullNodeValidator();
-
-main() => initPolymer().then((zone) => zone.run(() {
- useHtmlConfiguration();
-
- XFoo xFoo;
- DivElement injectDiv;
-
- setUp(() => Polymer.onReady.then((_) {
- xFoo = querySelector('x-foo');
- injectDiv = xFoo.$['inject'];
- }));
-
- tearDown(() {
- injectDiv.innerHtml = '';
- });
-
- test('can inject bound html fragments', () {
- xFoo.injectBoundHtml('<span>{{bar}}</span>', element: injectDiv);
- expect(injectDiv.innerHtml, '<span>baz</span>');
-
- xFoo.bar = 'bat';
- return new Future(() {}).then((_) {
- expect(injectDiv.innerHtml, '<span>bat</span>');
- });
- });
-
- test('custom sanitizer and validator', () {
- var html = '<span style="color: black;"></span>';
- var sanitizedHtml = '<span></span>';
-
- // Expect it to sanitize by default.
- xFoo.injectBoundHtml(html, element: injectDiv);
- expect(injectDiv.innerHtml, sanitizedHtml);
-
- // Don't sanitize if we give it a dummy validator
- xFoo.injectBoundHtml(html, element: injectDiv, validator: nullValidator);
- expect(injectDiv.innerHtml, html);
-
- // Don't sanitize if we give it a dummy sanitizer
- xFoo.injectBoundHtml(html,
- element: injectDiv, treeSanitizer: nullSanitizer);
- expect(injectDiv.innerHtml, html);
- });
-}));
« no previous file with comments | « packages/polymer/test/import_test.html ('k') | packages/polymer/test/inject_bound_html_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698