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

Side by Side Diff: samples/tests/samples/src/lib/observable/ObservableTest.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, 7 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
OLDNEW
(Empty)
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
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.
4
5 #library('observable_tests');
6
7 #import('dart:html');
8 #import('../../../../../ui_lib/observable/observable.dart');
9 #import('../../../../../../lib/unittest/unittest.dart');
10 #import('../../../../../../lib/unittest/html_config.dart');
11
12 #source('AbstractObservableTests.dart');
13 #source('ChangeEventTests.dart');
14 #source('EventBatchTests.dart');
15 #source('ObservableListTests.dart');
16 #source('ObservableValueTests.dart');
17
18 void main() {
19 useHtmlConfiguration();
20 group('AbstractObservable', testAbstractObservable);
21 group('ChangeEvent', testChangeEvent);
22 group('EventBatch', testEventBatch);
23 group('ObservableList', testObservableList);
24 group('ObservableValue', testObservableValue);
25 }
26
27 void validateEvent(ChangeEvent e, target, pName, index, type, newVal, oldVal) {
28 expect(e.target).equals(target);
29 expect(e.propertyName).equals(pName);
30 expect(e.index).equals(index);
31 expect(e.type).equals(type);
32 expect(e.newValue).equals(newVal);
33 expect(e.oldValue).equals(oldVal);
34 }
35
36 void validateGlobal(ChangeEvent e, target) {
37 validateEvent(e, target, null, null, ChangeEvent.GLOBAL, null, null);
38 }
39
40 void validateInsert(ChangeEvent e, target, pName, index, newVal) {
41 validateEvent(e, target, pName, index, ChangeEvent.INSERT, newVal, null);
42 }
43
44 void validateRemove(ChangeEvent e, target, pName, index, oldVal) {
45 validateEvent(e, target, pName, index, ChangeEvent.REMOVE, null, oldVal);
46 }
47
48 void validateUpdate(ChangeEvent e, target, pName, index, newVal, oldVal) {
49 validateEvent(e, target, pName, index, ChangeEvent.UPDATE, newVal, oldVal);
50 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698