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

Side by Side Diff: pkg/observe/test/observe_test.dart

Issue 20886002: add custom_element package (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/observe/lib/src/observable_map.dart ('k') | pkg/pkg.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 import 'package:logging/logging.dart'; 6 import 'package:logging/logging.dart';
7 import 'package:observe/observe.dart'; 7 import 'package:observe/observe.dart';
8 import 'package:observe/src/dirty_check.dart' as dirty_check; 8 import 'package:observe/src/dirty_check.dart' as dirty_check;
9 import 'package:unittest/unittest.dart'; 9 import 'package:unittest/unittest.dart';
10 import 'observe_test_utils.dart'; 10 import 'observe_test_utils.dart';
11 11
12 // Note: this ensures we run the dartanalyzer on the @observe package.
13 // @static-clean
14
12 const _VALUE = const Symbol('value'); 15 const _VALUE = const Symbol('value');
13 16
14 main() { 17 main() {
15 // Note: to test the basic Observable system, we use ObservableBox due to its 18 // Note: to test the basic Observable system, we use ObservableBox due to its
16 // simplicity. We also test a variant that is based on dirty-checking. 19 // simplicity. We also test a variant that is based on dirty-checking.
17 20
18 observeTest('no observers at the start', () { 21 observeTest('no observers at the start', () {
19 expect(dirty_check.allObservablesCount, 0); 22 expect(dirty_check.allObservablesCount, 0);
20 }); 23 });
21 24
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 _changedValue(len) => new List.filled(len, new PropertyChangeRecord(_VALUE)); 244 _changedValue(len) => new List.filled(len, new PropertyChangeRecord(_VALUE));
242 245
243 // A test model based on dirty checking. 246 // A test model based on dirty checking.
244 class WatcherModel<T> extends ObservableBase { 247 class WatcherModel<T> extends ObservableBase {
245 @observable T value; 248 @observable T value;
246 249
247 WatcherModel([T initialValue]) : value = initialValue; 250 WatcherModel([T initialValue]) : value = initialValue;
248 251
249 String toString() => '#<$runtimeType value: $value>'; 252 String toString() => '#<$runtimeType value: $value>';
250 } 253 }
OLDNEW
« no previous file with comments | « pkg/observe/lib/src/observable_map.dart ('k') | pkg/pkg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698