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

Side by Side Diff: ios/web/web_state/ui/crw_web_controller_unittest.mm

Issue 2185823002: [ios] Fixed CRWWebControllerTest.WebUrlWithTrustLevel for iOS 10. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/web/web_state/ui/crw_web_controller.h" 5 #import "ios/web/web_state/ui/crw_web_controller.h"
6 6
7 #import <WebKit/WebKit.h> 7 #import <WebKit/WebKit.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 CGSize containerViewSize = [UIScreen mainScreen].bounds.size; 313 CGSize containerViewSize = [UIScreen mainScreen].bounds.size;
314 containerViewSize.height -= 314 containerViewSize.height -=
315 CGRectGetHeight([UIApplication sharedApplication].statusBarFrame); 315 CGRectGetHeight([UIApplication sharedApplication].statusBarFrame);
316 return {CGPointZero, containerViewSize}; 316 return {CGPointZero, containerViewSize};
317 } 317 }
318 318
319 // Creates WebView mock. 319 // Creates WebView mock.
320 UIView* CreateMockWebView() { 320 UIView* CreateMockWebView() {
321 id result = [[OCMockObject mockForClass:[WKWebView class]] retain]; 321 id result = [[OCMockObject mockForClass:[WKWebView class]] retain];
322 322
323 // Called by resetInjectedWebView 323 if (base::ios::IsRunningOnIOS10OrLater()) {
324 [[result stub] certificateChain]; 324 [[result stub] serverTrust];
325 } else {
326 [[result stub] certificateChain];
327 }
328
325 [[result stub] backForwardList]; 329 [[result stub] backForwardList];
326 [[[result stub] andReturn:[NSURL URLWithString:kTestURLString]] URL]; 330 [[[result stub] andReturn:[NSURL URLWithString:kTestURLString]] URL];
327 [[result stub] setNavigationDelegate:OCMOCK_ANY]; 331 [[result stub] setNavigationDelegate:OCMOCK_ANY];
328 [[result stub] setUIDelegate:OCMOCK_ANY]; 332 [[result stub] setUIDelegate:OCMOCK_ANY];
329 [[result stub] setFrame:ExpectedWebViewFrame()]; 333 [[result stub] setFrame:ExpectedWebViewFrame()];
330 [[result stub] addObserver:web_controller() 334 [[result stub] addObserver:web_controller()
331 forKeyPath:OCMOCK_ANY 335 forKeyPath:OCMOCK_ANY
332 options:0 336 options:0
333 context:nullptr]; 337 context:nullptr];
334 [[result stub] addObserver:OCMOCK_ANY 338 [[result stub] addObserver:OCMOCK_ANY
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 1006
1003 [web_controller() setDelegate:delegate]; 1007 [web_controller() setDelegate:delegate];
1004 web::SimulateWKWebViewCrash(webView_); 1008 web::SimulateWKWebViewCrash(webView_);
1005 1009
1006 EXPECT_OCMOCK_VERIFY(delegate); 1010 EXPECT_OCMOCK_VERIFY(delegate);
1007 EXPECT_FALSE([web_controller() isViewAlive]); 1011 EXPECT_FALSE([web_controller() isViewAlive]);
1008 [web_controller() setDelegate:nil]; 1012 [web_controller() setDelegate:nil];
1009 }; 1013 };
1010 1014
1011 } // namespace 1015 } // namespace
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698