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

Unified Diff: pkg/polymer/test/noscript_test.dart

Issue 158083002: introduce web_components pkg for consolidated polyfills (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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 | « pkg/polymer/test/build/polyfill_injector_test.dart ('k') | pkg/polymer_expressions/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/test/noscript_test.dart
diff --git a/pkg/polymer/test/noscript_test.dart b/pkg/polymer/test/noscript_test.dart
index d6387138bd306688caa43a716f7a7d01f2f387d1..bdbcb6f99b1d88c1b387cad7d3257c72ce5833f2 100644
--- a/pkg/polymer/test/noscript_test.dart
+++ b/pkg/polymer/test/noscript_test.dart
@@ -2,18 +2,32 @@
// 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';
import 'package:template_binding/template_binding.dart';
-main() {
- initPolymer();
+Future<List<MutationRecord>> onMutation(Node node) {
+ var completer = new Completer();
+ new MutationObserver((mutations, observer) {
+ observer.disconnect();
+ completer.complete(mutations);
+ })..observe(node, childList: true, subtree: true);
+ return completer.future;
+}
+
+main() => initPolymer().run(() {
useHtmlConfiguration();
- templateBind(querySelector("#a")).model = "foo";
- setUp(() => Polymer.onReady);
+ var ready = Polymer.onReady.then((_) {
+ var a = querySelector("#a");
+ templateBind(a).model = "foo";
+ return onMutation(a.parent);
+ });
+
+ setUp(() => ready);
test('template found with multiple noscript declarations', () {
expect(querySelector('x-a') is PolymerElement, isTrue);
@@ -28,4 +42,4 @@ main() {
expect(querySelector('x-d') is PolymerElement, isTrue);
expect(querySelector('x-d').shadowRoot.nodes.first.text, 'd');
});
-}
+});
« no previous file with comments | « pkg/polymer/test/build/polyfill_injector_test.dart ('k') | pkg/polymer_expressions/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698