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

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

Issue 2672723003: Converted CRWSessionController to use NavigationItems. (Closed)
Patch Set: test fixes, self review Created 3 years, 10 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 | « ios/web/web_state/ui/crw_web_controller.mm ('k') | 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 [web_controller() setDelegate:mockDelegate_]; 212 [web_controller() setDelegate:mockDelegate_];
213 base::scoped_nsobject<TestWebViewContentView> webViewContentView( 213 base::scoped_nsobject<TestWebViewContentView> webViewContentView(
214 [[TestWebViewContentView alloc] initWithMockWebView:mockWebView_ 214 [[TestWebViewContentView alloc] initWithMockWebView:mockWebView_
215 scrollView:mockScrollView_]); 215 scrollView:mockScrollView_]);
216 [web_controller() injectWebViewContentView:webViewContentView]; 216 [web_controller() injectWebViewContentView:webViewContentView];
217 217
218 NavigationManagerImpl& navigationManager = 218 NavigationManagerImpl& navigationManager =
219 [web_controller() webStateImpl]->GetNavigationManagerImpl(); 219 [web_controller() webStateImpl]->GetNavigationManagerImpl();
220 navigationManager.InitializeSession(@"name", nil, NO, 0); 220 navigationManager.InitializeSession(@"name", nil, NO, 0);
221 [navigationManager.GetSessionController() 221 [navigationManager.GetSessionController()
222 addPendingEntry:GURL("http://www.google.com/?q=foo#bar") 222 addPendingItem:GURL("http://www.google.com/?q=foo#bar")
223 referrer:web::Referrer() 223 referrer:web::Referrer()
224 transition:ui::PAGE_TRANSITION_TYPED 224 transition:ui::PAGE_TRANSITION_TYPED
225 rendererInitiated:NO]; 225 rendererInitiated:NO];
226 } 226 }
227 227
228 void TearDown() override { 228 void TearDown() override {
229 EXPECT_OCMOCK_VERIFY(mockDelegate_); 229 EXPECT_OCMOCK_VERIFY(mockDelegate_);
230 EXPECT_OCMOCK_VERIFY(mockChildWebController_); 230 EXPECT_OCMOCK_VERIFY(mockChildWebController_);
231 EXPECT_OCMOCK_VERIFY(mockWebView_); 231 EXPECT_OCMOCK_VERIFY(mockWebView_);
232 [web_controller() resetInjectedWebViewContentView]; 232 [web_controller() resetInjectedWebViewContentView];
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 web::WebTestWithWebController::SetUp(); 790 web::WebTestWithWebController::SetUp();
791 mock_native_provider_.reset([[TestNativeContentProvider alloc] init]); 791 mock_native_provider_.reset([[TestNativeContentProvider alloc] init]);
792 [web_controller() setNativeProvider:mock_native_provider_]; 792 [web_controller() setNativeProvider:mock_native_provider_];
793 } 793 }
794 794
795 void Load(const GURL& URL) { 795 void Load(const GURL& URL) {
796 NavigationManagerImpl& navigation_manager = 796 NavigationManagerImpl& navigation_manager =
797 [web_controller() webStateImpl]->GetNavigationManagerImpl(); 797 [web_controller() webStateImpl]->GetNavigationManagerImpl();
798 navigation_manager.InitializeSession(@"name", nil, NO, 0); 798 navigation_manager.InitializeSession(@"name", nil, NO, 0);
799 [navigation_manager.GetSessionController() 799 [navigation_manager.GetSessionController()
800 addPendingEntry:URL 800 addPendingItem:URL
801 referrer:web::Referrer() 801 referrer:web::Referrer()
802 transition:ui::PAGE_TRANSITION_TYPED 802 transition:ui::PAGE_TRANSITION_TYPED
803 rendererInitiated:NO]; 803 rendererInitiated:NO];
804 [web_controller() loadCurrentURL]; 804 [web_controller() loadCurrentURL];
805 } 805 }
806 806
807 base::scoped_nsobject<TestNativeContentProvider> mock_native_provider_; 807 base::scoped_nsobject<TestNativeContentProvider> mock_native_provider_;
808 }; 808 };
809 809
810 // Tests WebState and NavigationManager correctly return native content URL. 810 // Tests WebState and NavigationManager correctly return native content URL.
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 }; 1041 };
1042 1042
1043 RenderProcessGoneObserver observer(web_state()); 1043 RenderProcessGoneObserver observer(web_state());
1044 web::SimulateWKWebViewCrash(webView_); 1044 web::SimulateWKWebViewCrash(webView_);
1045 observer.WaitForRenderProcessGone(); 1045 observer.WaitForRenderProcessGone();
1046 1046
1047 EXPECT_FALSE([web_controller() isViewAlive]); 1047 EXPECT_FALSE([web_controller() isViewAlive]);
1048 }; 1048 };
1049 1049
1050 } // namespace 1050 } // namespace
OLDNEW
« no previous file with comments | « ios/web/web_state/ui/crw_web_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698