OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import "ios/chrome/browser/ui/settings/utils/fake_observable_boolean.h" |
| 6 |
| 7 @implementation FakeObservableBoolean |
| 8 |
| 9 @synthesize value = _value; |
| 10 @synthesize observer = _observer; |
| 11 |
| 12 - (void)setValue:(BOOL)value { |
| 13 bool changed = value != _value; |
| 14 _value = value; |
| 15 if (changed) |
| 16 [self.observer booleanDidChange:self]; |
| 17 } |
| 18 |
| 19 @end |
| 20 |
| 21 @implementation TestBooleanObserver |
| 22 |
| 23 @synthesize updateCount = _updateCount; |
| 24 |
| 25 - (void)booleanDidChange:(id<ObservableBoolean>)observableBoolean { |
| 26 self.updateCount++; |
| 27 } |
| 28 |
| 29 @end |
OLD | NEW |