blob: cb0ecd35fbe6b15b5e5d3341b5242d1980a92e5f [file] [log] [blame]
// Copyright 2015 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.
#import "ios/web/public/test/fakes/crw_fake_web_view_content_view.h"
#include "base/check.h"
#include "base/notreached.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
@interface CRWFakeWebViewContentView () {
id _mockWebView;
id _mockScrollView;
}
@end
@implementation CRWFakeWebViewContentView
- (instancetype)initWithMockWebView:(id)webView scrollView:(id)scrollView {
self = [super initForTesting];
if (self) {
DCHECK(webView);
DCHECK(scrollView);
_mockWebView = webView;
_mockScrollView = scrollView;
}
return self;
}
- (instancetype)initWithCoder:(NSCoder*)decoder {
NOTREACHED();
return nil;
}
- (instancetype)initWithFrame:(CGRect)frame {
NOTREACHED();
return nil;
}
#pragma mark Accessors
- (UIScrollView*)scrollView {
return static_cast<UIScrollView*>(_mockScrollView);
}
- (UIView*)webView {
return static_cast<UIView*>(_mockWebView);
}
@end