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

Side by Side Diff: ios/web_view/test/boolean_observer.h

Issue 2892193002: Add unittest to test CWVWebView. (Closed)
Patch Set: Respond to comments. Created 3 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
« no previous file with comments | « ios/web_view/test/DEPS ('k') | ios/web_view/test/boolean_observer.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_BOOLEAN_OBSERVER_H_
6 #define IOS_WEB_VIEW_TEST_BOOLEAN_OBSERVER_H_
7
8 #import <Foundation/Foundation.h>
9
10 // Class to observe a boolean KVO compliant property. To use this object, first
11 // create an instance of BooleanObserver and call |setObservedObject:keyPath:|.
12 // After an expected change in the value of |keyPath|, ask for |lastValue| and
13 // compare to the expected value.
14 @interface BooleanObserver : NSObject
15
16 // The last value of performing |keyPath| on |object| after being notified of a
17 // KVO value change or null if a change has not been observed.
18 @property(nonatomic, nullable, readonly) NSNumber* lastValue;
19
20 // The |keyPath| of |object| being observed.
21 @property(nonatomic, nullable, readonly) NSString* keyPath;
22
23 // The current |object| being observed.
24 @property(nonatomic, nullable, readonly, weak) NSObject* object;
25
26 // Sets the |object| and |keyPath| to observe. Performing |keyPath| on |object|
27 // must return a BOOL value and |keyPath| must be KVO compliant.
28 // If |object| is null and |self.object| is nonnull, |self.object| will stop
29 // being observed. If |object| is nonnull, |keyPath| must be nonnull.
30 - (void)setObservedObject:(nullable NSObject*)object
31 keyPath:(nullable NSString*)keyPath;
32
33 @end
34
35 #endif // IOS_WEB_VIEW_TEST_BOOLEAN_OBSERVER_H_
OLDNEW
« no previous file with comments | « ios/web_view/test/DEPS ('k') | ios/web_view/test/boolean_observer.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698