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

Unified Diff: ios/web_view/test/observer.h

Issue 2902403002: Add KVO compliant title property to CWVWebView. (Closed)
Patch Set: Remove observers directory. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web_view/test/chrome_web_view_test.mm ('k') | ios/web_view/test/observer.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « ios/web_view/test/chrome_web_view_test.mm ('k') | ios/web_view/test/observer.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698