Commit 5ecb75c2 authored by ichikawa's avatar ichikawa Committed by Commit bot

Add CRWWebViewScrollViewProxy.dragging which will be used in

CWVScrollView.

BUG=714543

Review-Url: https://codereview.chromium.org/2840013004
Cr-Commit-Position: refs/heads/master@{#467560}
parent 6b6e8ff5
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
@interface CRWWebViewScrollViewProxy : NSObject<UIScrollViewDelegate> @interface CRWWebViewScrollViewProxy : NSObject<UIScrollViewDelegate>
@property(nonatomic, assign) CGPoint contentOffset; @property(nonatomic, assign) CGPoint contentOffset;
@property(nonatomic, assign) UIEdgeInsets contentInset; @property(nonatomic, assign) UIEdgeInsets contentInset;
@property(nonatomic, readonly, getter=isDragging) BOOL dragging;
@property(nonatomic, readonly) BOOL isZooming; @property(nonatomic, readonly) BOOL isZooming;
@property(nonatomic, readonly) CGFloat zoomScale; @property(nonatomic, readonly) CGFloat zoomScale;
@property(nonatomic, assign) UIEdgeInsets scrollIndicatorInsets; @property(nonatomic, assign) UIEdgeInsets scrollIndicatorInsets;
......
...@@ -93,6 +93,10 @@ ...@@ -93,6 +93,10 @@
[_scrollView setBounces:bounces]; [_scrollView setBounces:bounces];
} }
- (BOOL)isDragging {
return [_scrollView isDragging];
}
- (BOOL)isZooming { - (BOOL)isZooming {
return [_scrollView isZooming]; return [_scrollView isZooming];
} }
......
...@@ -101,6 +101,12 @@ TEST_F(CRWWebViewScrollViewProxyTest, testScrollViewPresent) { ...@@ -101,6 +101,12 @@ TEST_F(CRWWebViewScrollViewProxyTest, testScrollViewPresent) {
[[[mockScrollView_ stub] andReturnValue:[NSValue valueWithCGRect:frame]] [[[mockScrollView_ stub] andReturnValue:[NSValue valueWithCGRect:frame]]
frame]; frame];
EXPECT_TRUE(CGRectEqualToRect(frame, [webViewScrollViewProxy_ frame])); EXPECT_TRUE(CGRectEqualToRect(frame, [webViewScrollViewProxy_ frame]));
[[[mockScrollView_ expect] andReturnValue:@YES] isDragging];
EXPECT_TRUE([webViewScrollViewProxy_ isDragging]);
[[[mockScrollView_ expect] andReturnValue:@NO] isDragging];
EXPECT_FALSE([webViewScrollViewProxy_ isDragging]);
} }
// Tests that CRWWebViewScrollViewProxy returns the correct property values when // Tests that CRWWebViewScrollViewProxy returns the correct property values when
...@@ -117,6 +123,7 @@ TEST_F(CRWWebViewScrollViewProxyTest, testScrollViewAbsent) { ...@@ -117,6 +123,7 @@ TEST_F(CRWWebViewScrollViewProxyTest, testScrollViewAbsent) {
EXPECT_TRUE( EXPECT_TRUE(
CGSizeEqualToSize(CGSizeZero, [webViewScrollViewProxy_ contentSize])); CGSizeEqualToSize(CGSizeZero, [webViewScrollViewProxy_ contentSize]));
EXPECT_TRUE(CGRectEqualToRect(CGRectZero, [webViewScrollViewProxy_ frame])); EXPECT_TRUE(CGRectEqualToRect(CGRectZero, [webViewScrollViewProxy_ frame]));
EXPECT_FALSE([webViewScrollViewProxy_ isDragging]);
// Make sure setting the properties is fine too. // Make sure setting the properties is fine too.
// Arbitrary point. // Arbitrary point.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment