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

Unified Diff: pkg/polymer_expressions/test/globals_test.dart

Issue 132403010: big update to observe, template_binding, polymer (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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: pkg/polymer_expressions/test/globals_test.dart
diff --git a/pkg/polymer_expressions/test/globals_test.dart b/pkg/polymer_expressions/test/globals_test.dart
index 295aa111b81efce57068324641bd209e2ad51aec..9690bafa90534de8cf2dda0efb7703ef630efed2 100644
--- a/pkg/polymer_expressions/test/globals_test.dart
+++ b/pkg/polymer_expressions/test/globals_test.dart
@@ -2,17 +2,17 @@
// 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:observe/observe.dart';
-import 'package:observe/src/microtask.dart';
import 'package:polymer_expressions/polymer_expressions.dart';
import 'package:template_binding/template_binding.dart';
import 'package:unittest/unittest.dart';
-import 'package:unittest/html_enhanced_config.dart';
+import 'package:unittest/html_config.dart';
main() {
- useHtmlEnhancedConfiguration();
+ useHtmlConfiguration();
var testDiv;
group('enumerate', () {
@@ -34,23 +34,23 @@ main() {
testDiv = null;
});
- test('should enumerate item and index', wrapMicrotask(() {
+ test('should enumerate item and index', () {
templateBind(testDiv.query('template'))
..bindingDelegate = new PolymerExpressions()
..model = toObservable(
['hello', 'from', 'polymer', 'expressions']);
- performMicrotaskCheckpoint();
-
- expect(testDiv.queryAll('div').map((n) => n.text), [
- 'Item 0 is hello',
- 'Item 1 is from',
- 'Item 2 is polymer',
- 'Item 3 is expressions',
- ]);
- }));
+ return new Future(() {
+ expect(testDiv.queryAll('div').map((n) => n.text), [
+ 'Item 0 is hello',
+ 'Item 1 is from',
+ 'Item 2 is polymer',
+ 'Item 3 is expressions',
+ ]);
+ });
+ });
- test('should update after changes', wrapMicrotask(() {
+ test('should update after changes', () {
var model = toObservable(
['hello', 'from', 'polymer', 'expressions', 'a', 'b', 'c']);
@@ -58,34 +58,34 @@ main() {
..bindingDelegate = new PolymerExpressions()
..model = model;
- performMicrotaskCheckpoint();
-
- expect(testDiv.queryAll('div').map((n) => n.text), [
- 'Item 0 is hello',
- 'Item 1 is from',
- 'Item 2 is polymer',
- 'Item 3 is expressions',
- 'Item 4 is a',
- 'Item 5 is b',
- 'Item 6 is c',
- ]);
+ return new Future(() {
+ expect(testDiv.queryAll('div').map((n) => n.text), [
+ 'Item 0 is hello',
+ 'Item 1 is from',
+ 'Item 2 is polymer',
+ 'Item 3 is expressions',
+ 'Item 4 is a',
+ 'Item 5 is b',
+ 'Item 6 is c',
+ ]);
- model.removeAt(1);
- model[1] = 'world';
- model[2] = '!';
- model.insert(5, 'e');
+ model.removeAt(1);
+ model[1] = 'world';
+ model[2] = '!';
+ model.insert(5, 'e');
- performMicrotaskCheckpoint();
-
- expect(testDiv.queryAll('div').map((n) => n.text), [
- 'Item 0 is hello',
- 'Item 1 is world',
- 'Item 2 is !',
- 'Item 3 is a',
- 'Item 4 is b',
- 'Item 5 is e',
- 'Item 6 is c',
- ]);
- }));
+ return new Future(() {
+ expect(testDiv.queryAll('div').map((n) => n.text), [
+ 'Item 0 is hello',
+ 'Item 1 is world',
+ 'Item 2 is !',
+ 'Item 3 is a',
+ 'Item 4 is b',
+ 'Item 5 is e',
+ 'Item 6 is c',
+ ]);
+ });
+ });
+ });
});
}

Powered by Google App Engine
This is Rietveld 408576698