OLD | NEW |
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 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 protected: | 723 protected: |
724 void SetUp() override { | 724 void SetUp() override { |
725 web::WebTestWithWebController::SetUp(); | 725 web::WebTestWithWebController::SetUp(); |
726 mock_native_provider_.reset([[TestNativeContentProvider alloc] init]); | 726 mock_native_provider_.reset([[TestNativeContentProvider alloc] init]); |
727 [web_controller() setNativeProvider:mock_native_provider_]; | 727 [web_controller() setNativeProvider:mock_native_provider_]; |
728 } | 728 } |
729 | 729 |
730 void Load(const GURL& URL) { | 730 void Load(const GURL& URL) { |
731 NavigationManagerImpl& navigation_manager = | 731 NavigationManagerImpl& navigation_manager = |
732 [web_controller() webStateImpl]->GetNavigationManagerImpl(); | 732 [web_controller() webStateImpl]->GetNavigationManagerImpl(); |
733 navigation_manager.InitializeSession(NO); | |
734 navigation_manager.AddPendingItem( | 733 navigation_manager.AddPendingItem( |
735 URL, web::Referrer(), ui::PAGE_TRANSITION_TYPED, | 734 URL, web::Referrer(), ui::PAGE_TRANSITION_TYPED, |
736 web::NavigationInitiationType::USER_INITIATED); | 735 web::NavigationInitiationType::USER_INITIATED); |
737 [web_controller() loadCurrentURL]; | 736 [web_controller() loadCurrentURL]; |
738 } | 737 } |
739 | 738 |
740 base::scoped_nsobject<TestNativeContentProvider> mock_native_provider_; | 739 base::scoped_nsobject<TestNativeContentProvider> mock_native_provider_; |
741 }; | 740 }; |
742 | 741 |
743 // Tests WebState and NavigationManager correctly return native content URL. | 742 // Tests WebState and NavigationManager correctly return native content URL. |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 web::TestWebStateObserver* observer_ptr = &observer; | 954 web::TestWebStateObserver* observer_ptr = &observer; |
956 web::SimulateWKWebViewCrash(webView_); | 955 web::SimulateWKWebViewCrash(webView_); |
957 base::test::ios::WaitUntilCondition(^bool() { | 956 base::test::ios::WaitUntilCondition(^bool() { |
958 return observer_ptr->render_process_gone_info(); | 957 return observer_ptr->render_process_gone_info(); |
959 }); | 958 }); |
960 EXPECT_EQ(web_state(), observer.render_process_gone_info()->web_state); | 959 EXPECT_EQ(web_state(), observer.render_process_gone_info()->web_state); |
961 EXPECT_FALSE([web_controller() isViewAlive]); | 960 EXPECT_FALSE([web_controller() isViewAlive]); |
962 }; | 961 }; |
963 | 962 |
964 } // namespace | 963 } // namespace |
OLD | NEW |