| Index: ios/web_view/test/observer.h
|
| diff --git a/ios/web_view/test/observer.h b/ios/web_view/test/observer.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e940dafd6f5ec6ba92e0227876781b8edc978d17
|
| --- /dev/null
|
| +++ b/ios/web_view/test/observer.h
|
| @@ -0,0 +1,32 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef IOS_WEB_VIEW_TEST_OBSERVER_H_
|
| +#define IOS_WEB_VIEW_TEST_OBSERVER_H_
|
| +
|
| +#import <Foundation/Foundation.h>
|
| +
|
| +// Observes a KVO compliant property. To use this Observer, create an instance
|
| +// and call |setObservedObject:keyPath:|. Then test expected values against
|
| +// |lastValue|.
|
| +@interface Observer : NSObject
|
| +
|
| +// The last value of performing |keyPath| on |object| after being notified of a
|
| +// KVO value change or null if a change has not been observed.
|
| +@property(nonatomic, nullable, readonly) id lastValue;
|
| +
|
| +// The |keyPath| of |object| being observed.
|
| +@property(nonatomic, nullable, readonly) NSString* keyPath;
|
| +
|
| +// The current |object| being observed.
|
| +@property(nonatomic, nullable, readonly, weak) NSObject* object;
|
| +
|
| +// Sets the |object| and |keyPath| to observe. The |keyPath| property of
|
| +// |object| must exist and be KVO compliant.
|
| +- (void)setObservedObject:(nonnull NSObject*)object
|
| + keyPath:(nonnull NSString*)keyPath;
|
| +
|
| +@end
|
| +
|
| +#endif // IOS_WEB_VIEW_TEST_OBSERVER_H_
|
|
|