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

Side by Side Diff: samples-dev/swarm/test/swarm_ui_lib/observable/observable_value_tests.dart

Issue 2828603002: Format samples and samples-dev directories. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 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 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 part of observable_tests; 5 part of observable_tests;
6 6
7 testObservableValue() { 7 testObservableValue() {
8 test('ObservableValue', () { 8 test('ObservableValue', () {
9 final value = new ObservableValue<String>('initial'); 9 final value = new ObservableValue<String>('initial');
10 expect(value.value, equals('initial')); 10 expect(value.value, equals('initial'));
(...skipping 15 matching lines...) Expand all
26 expect(result, isNotNull); 26 expect(result, isNotNull);
27 expect(result.events.length, equals(1)); 27 expect(result.events.length, equals(1));
28 validateUpdate(result.events[0], value, 'value', null, 'newer', 'new'); 28 validateUpdate(result.events[0], value, 'value', null, 'newer', 'new');
29 }); 29 });
30 30
31 test('does not raise event if unchanged', () { 31 test('does not raise event if unchanged', () {
32 final value = new ObservableValue<String>('foo'); 32 final value = new ObservableValue<String>('foo');
33 expect(value.value, equals('foo')); 33 expect(value.value, equals('foo'));
34 34
35 bool called = false; 35 bool called = false;
36 value.addChangeListener((summary) { called = true; }); 36 value.addChangeListener((summary) {
37 called = true;
38 });
37 39
38 // Set it to the same value. 40 // Set it to the same value.
39 value.value = 'foo'; 41 value.value = 'foo';
40 42
41 // Should not have gotten an event. 43 // Should not have gotten an event.
42 expect(called, isFalse); 44 expect(called, isFalse);
43 }); 45 });
44 } 46 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698