1 // Copyright 2015 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.
5 #include "ios/web/public/test/test_web_view_content_view.h"
7 #include "base/logging.h"
8 #include "base/mac/scoped_nsobject.h"
10 @interface TestWebViewContentView () {
11 base::scoped_nsprotocol<id> _mockWebView;
12 base::scoped_nsprotocol<id> _mockScrollView;
17 @implementation TestWebViewContentView
19 - (instancetype)initWithMockWebView:(id)webView scrollView:(id)scrollView {
20 self = [super initForTesting];
24 _mockWebView.reset([webView retain]);
25 _mockScrollView.reset([scrollView retain]);
30 - (instancetype)initWithCoder:(NSCoder*)decoder {
35 - (instancetype)initWithFrame:(CGRect)frame {
40 #pragma mark Accessors
42 - (UIScrollView*)scrollView {
43 return static_cast<UIScrollView*>(_mockScrollView.get());
47 return static_cast<UIView*>(_mockWebView.get());