| 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 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 protected: | 668 protected: |
| 669 void SetUp() override { | 669 void SetUp() override { |
| 670 web::WebTestWithWebController::SetUp(); | 670 web::WebTestWithWebController::SetUp(); |
| 671 mock_native_provider_.reset([[TestNativeContentProvider alloc] init]); | 671 mock_native_provider_.reset([[TestNativeContentProvider alloc] init]); |
| 672 [web_controller() setNativeProvider:mock_native_provider_]; | 672 [web_controller() setNativeProvider:mock_native_provider_]; |
| 673 } | 673 } |
| 674 | 674 |
| 675 void Load(const GURL& URL) { | 675 void Load(const GURL& URL) { |
| 676 NavigationManagerImpl& navigation_manager = | 676 NavigationManagerImpl& navigation_manager = |
| 677 [web_controller() webStateImpl]->GetNavigationManagerImpl(); | 677 [web_controller() webStateImpl]->GetNavigationManagerImpl(); |
| 678 navigation_manager.InitializeSession(NO); | |
| 679 navigation_manager.AddPendingItem( | 678 navigation_manager.AddPendingItem( |
| 680 URL, web::Referrer(), ui::PAGE_TRANSITION_TYPED, | 679 URL, web::Referrer(), ui::PAGE_TRANSITION_TYPED, |
| 681 web::NavigationInitiationType::USER_INITIATED); | 680 web::NavigationInitiationType::USER_INITIATED); |
| 682 [web_controller() loadCurrentURL]; | 681 [web_controller() loadCurrentURL]; |
| 683 } | 682 } |
| 684 | 683 |
| 685 base::scoped_nsobject<TestNativeContentProvider> mock_native_provider_; | 684 base::scoped_nsobject<TestNativeContentProvider> mock_native_provider_; |
| 686 }; | 685 }; |
| 687 | 686 |
| 688 // Tests WebState and NavigationManager correctly return native content URL. | 687 // Tests WebState and NavigationManager correctly return native content URL. |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 web::TestWebStateObserver* observer_ptr = &observer; | 899 web::TestWebStateObserver* observer_ptr = &observer; |
| 901 web::SimulateWKWebViewCrash(webView_); | 900 web::SimulateWKWebViewCrash(webView_); |
| 902 base::test::ios::WaitUntilCondition(^bool() { | 901 base::test::ios::WaitUntilCondition(^bool() { |
| 903 return observer_ptr->render_process_gone_info(); | 902 return observer_ptr->render_process_gone_info(); |
| 904 }); | 903 }); |
| 905 EXPECT_EQ(web_state(), observer.render_process_gone_info()->web_state); | 904 EXPECT_EQ(web_state(), observer.render_process_gone_info()->web_state); |
| 906 EXPECT_FALSE([web_controller() isViewAlive]); | 905 EXPECT_FALSE([web_controller() isViewAlive]); |
| 907 }; | 906 }; |
| 908 | 907 |
| 909 } // namespace | 908 } // namespace |
| OLD | NEW |