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

Unified Diff: samples/tests/samples/src/lib/observable/AbstractObservableTests.dart

Issue 10253022: test rename overhaul: step 13 - samples (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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: samples/tests/samples/src/lib/observable/AbstractObservableTests.dart
diff --git a/samples/tests/samples/src/lib/observable/AbstractObservableTests.dart b/samples/tests/samples/src/lib/observable/AbstractObservableTests.dart
deleted file mode 100644
index 7738fd2529f6e24804c12cb946741d108ae140ec..0000000000000000000000000000000000000000
--- a/samples/tests/samples/src/lib/observable/AbstractObservableTests.dart
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright (c) 2011, 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.
-
-testAbstractObservable() {
- group('addChangeListener()', () {
- test('adding the same listener twice returns false the second time', () {
- final target = new AbstractObservable();
- final listener = (e) { };
-
- expect(target.addChangeListener(listener)).isTrue();
- expect(target.addChangeListener(listener)).isFalse();
- });
-
- test('modifies listeners list', () {
- // check that add/remove works, see contents of listeners too
- final target = new AbstractObservable();
- final l1 = (e) { };
- final l2 = (e) { };
- final l3 = (e) { };
- final l4 = (e) { };
-
- expect(target.listeners).equalsCollection([]);
-
- target.addChangeListener(l1);
- expect(target.listeners).equalsCollection([l1]);
-
- target.addChangeListener(l2);
- expect(target.listeners).equalsCollection([l1, l2]);
-
- target.addChangeListener(l3);
- target.addChangeListener(l4);
- expect(target.listeners).equalsCollection([l1, l2, l3, l4]);
-
- target.removeChangeListener(l4);
- expect(target.listeners).equalsCollection([l1, l2, l3]);
-
- target.removeChangeListener(l2);
- expect(target.listeners).equalsCollection([l1, l3]);
-
- target.removeChangeListener(l1);
- expect(target.listeners).equalsCollection([l3]);
-
- target.removeChangeListener(l3);
- expect(target.listeners).equalsCollection([]);
- });
- });
-
- test('fires immediately if no batch', () {
- // If no batch is created, a summary should be automatically created and
- // fired on each property change.
- final target = new AbstractObservable();
- EventSummary res = null;
- target.addChangeListener((summary) {
- expect(res).isNull();
- res = summary;
- expect(res).isNotNull();
- });
-
- target.recordPropertyUpdate('pM', 10, 11);
-
- expect(res).isNotNull();
- expect(res.events.length).equals(1);
- validateUpdate(res.events[0], target, 'pM', null, 10, 11);
- res = null;
-
- target.recordPropertyUpdate('pL', '11', '13');
-
- expect(res).isNotNull();
- expect(res.events.length).equals(1);
- validateUpdate(res.events[0], target, 'pL', null, '11', '13');
- });
-}

Powered by Google App Engine
This is Rietveld 408576698