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

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

Issue 1891483005: [ios] Added API to enable/disable web usage for WebState. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self review Created 4 years, 8 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
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 901 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 912
913 // Configure web delegate. 913 // Configure web delegate.
914 delegate_.reset([[MockInteractionLoader alloc] 914 delegate_.reset([[MockInteractionLoader alloc]
915 initWithRepresentedObject: 915 initWithRepresentedObject:
916 [OCMockObject niceMockForProtocol:@protocol(CRWWebDelegate)]]); 916 [OCMockObject niceMockForProtocol:@protocol(CRWWebDelegate)]]);
917 ASSERT_TRUE([delegate_ blockPopups]); 917 ASSERT_TRUE([delegate_ blockPopups]);
918 [webController_ setDelegate:delegate_]; 918 [webController_ setDelegate:delegate_];
919 919
920 // Configure child web state. 920 // Configure child web state.
921 child_web_state_.reset(new web::WebStateImpl(GetBrowserState())); 921 child_web_state_.reset(new web::WebStateImpl(GetBrowserState()));
922 [child_web_state_->GetWebController() setWebUsageEnabled:YES]; 922 child_web_state_->SetWebUsageEnabled(true);
923 [delegate_ setChildWebController:child_web_state_->GetWebController()]; 923 [delegate_ setChildWebController:child_web_state_->GetWebController()];
924 924
925 // Configure child web controller's session controller mock. 925 // Configure child web controller's session controller mock.
926 id sessionController = 926 id sessionController =
927 [OCMockObject niceMockForClass:[CRWSessionController class]]; 927 [OCMockObject niceMockForClass:[CRWSessionController class]];
928 BOOL yes = YES; 928 BOOL yes = YES;
929 [[[sessionController stub] andReturnValue:OCMOCK_VALUE(yes)] isOpenedByDOM]; 929 [[[sessionController stub] andReturnValue:OCMOCK_VALUE(yes)] isOpenedByDOM];
930 child_web_state_->GetNavigationManagerImpl().SetSessionController( 930 child_web_state_->GetNavigationManagerImpl().SetSessionController(
931 sessionController); 931 sessionController);
932 932
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 1055
1056 [webController_ setDelegate:delegate]; 1056 [webController_ setDelegate:delegate];
1057 web::SimulateWKWebViewCrash(webView_); 1057 web::SimulateWKWebViewCrash(webView_);
1058 1058
1059 EXPECT_OCMOCK_VERIFY(delegate); 1059 EXPECT_OCMOCK_VERIFY(delegate);
1060 EXPECT_FALSE([webController_ isViewAlive]); 1060 EXPECT_FALSE([webController_ isViewAlive]);
1061 [webController_ setDelegate:nil]; 1061 [webController_ setDelegate:nil];
1062 }; 1062 };
1063 1063
1064 } // namespace 1064 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698