| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 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 #ifndef IOS_WEB_VIEW_TEST_OBSERVER_H_ |
| 6 #define IOS_WEB_VIEW_TEST_OBSERVER_H_ |
| 7 |
| 8 #import <Foundation/Foundation.h> |
| 9 |
| 10 // Observes a KVO compliant property. To use this Observer, create an instance |
| 11 // and call |setObservedObject:keyPath:|. Then test expected values against |
| 12 // |lastValue|. |
| 13 @interface Observer : NSObject |
| 14 |
| 15 // The last value of performing |keyPath| on |object| after being notified of a |
| 16 // KVO value change or null if a change has not been observed. |
| 17 @property(nonatomic, nullable, readonly) id lastValue; |
| 18 |
| 19 // The |keyPath| of |object| being observed. |
| 20 @property(nonatomic, nullable, readonly) NSString* keyPath; |
| 21 |
| 22 // The current |object| being observed. |
| 23 @property(nonatomic, nullable, readonly, weak) NSObject* object; |
| 24 |
| 25 // Sets the |object| and |keyPath| to observe. The |keyPath| property of |
| 26 // |object| must exist and be KVO compliant. |
| 27 - (void)setObservedObject:(nonnull NSObject*)object |
| 28 keyPath:(nonnull NSString*)keyPath; |
| 29 |
| 30 @end |
| 31 |
| 32 #endif // IOS_WEB_VIEW_TEST_OBSERVER_H_ |
| OLD | NEW |