| 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 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 return web_controller().pageDisplayState.scroll_state().offset_y() == 30.0; | 667 return web_controller().pageDisplayState.scroll_state().offset_y() == 30.0; |
| 668 }); | 668 }); |
| 669 | 669 |
| 670 ASSERT_FALSE(web_controller().atTop); | 670 ASSERT_FALSE(web_controller().atTop); |
| 671 }; | 671 }; |
| 672 | 672 |
| 673 // Real WKWebView is required for CRWWebControllerNavigationTest. | 673 // Real WKWebView is required for CRWWebControllerNavigationTest. |
| 674 typedef web::WebTestWithWebController CRWWebControllerNavigationTest; | 674 typedef web::WebTestWithWebController CRWWebControllerNavigationTest; |
| 675 | 675 |
| 676 // Tests navigation between 2 URLs which differ only by fragment. | 676 // Tests navigation between 2 URLs which differ only by fragment. |
| 677 TEST_F(CRWWebControllerNavigationTest, GoToItemWithoutDocumentChange) { | 677 TEST_F(CRWWebControllerNavigationTest, GoToEntryWithoutDocumentChange) { |
| 678 LoadHtml(@"<html><body></body></html>", GURL("https://chromium.test")); | 678 LoadHtml(@"<html><body></body></html>", GURL("https://chromium.test")); |
| 679 LoadHtml(@"<html><body></body></html>", GURL("https://chromium.test#hash")); | 679 LoadHtml(@"<html><body></body></html>", GURL("https://chromium.test#hash")); |
| 680 NavigationManagerImpl& nav_manager = | 680 NavigationManagerImpl& nav_manager = |
| 681 web_controller().webStateImpl->GetNavigationManagerImpl(); | 681 web_controller().webStateImpl->GetNavigationManagerImpl(); |
| 682 CRWSessionController* session_controller = nav_manager.GetSessionController(); | 682 CRWSessionController* session_controller = nav_manager.GetSessionController(); |
| 683 EXPECT_EQ(2U, session_controller.items.size()); | 683 EXPECT_EQ(2U, session_controller.entries.count); |
| 684 EXPECT_EQ(session_controller.items.back().get(), | 684 EXPECT_NSEQ(session_controller.entries.lastObject, |
| 685 session_controller.currentItem); | 685 session_controller.currentEntry); |
| 686 | 686 |
| 687 [web_controller() goToItemAtIndex:0]; | 687 [web_controller() goToItemAtIndex:0]; |
| 688 EXPECT_EQ(session_controller.items.front().get(), | 688 EXPECT_NSEQ(session_controller.entries.firstObject, |
| 689 session_controller.currentItem); | 689 session_controller.currentEntry); |
| 690 } | 690 } |
| 691 | 691 |
| 692 // Tests that didShowPasswordInputOnHTTP updates the SSLStatus to indicate that | 692 // Tests that didShowPasswordInputOnHTTP updates the SSLStatus to indicate that |
| 693 // a password field has been displayed on an HTTP page. | 693 // a password field has been displayed on an HTTP page. |
| 694 TEST_F(CRWWebControllerNavigationTest, HTTPPassword) { | 694 TEST_F(CRWWebControllerNavigationTest, HTTPPassword) { |
| 695 LoadHtml(@"<html><body></body></html>", GURL("http://chromium.test")); | 695 LoadHtml(@"<html><body></body></html>", GURL("http://chromium.test")); |
| 696 NavigationManagerImpl& nav_manager = | 696 NavigationManagerImpl& nav_manager = |
| 697 web_controller().webStateImpl->GetNavigationManagerImpl(); | 697 web_controller().webStateImpl->GetNavigationManagerImpl(); |
| 698 EXPECT_FALSE(nav_manager.GetLastCommittedItem()->GetSSL().content_status & | 698 EXPECT_FALSE(nav_manager.GetLastCommittedItem()->GetSSL().content_status & |
| 699 web::SSLStatus::DISPLAYED_PASSWORD_FIELD_ON_HTTP); | 699 web::SSLStatus::DISPLAYED_PASSWORD_FIELD_ON_HTTP); |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1055 }; | 1055 }; |
| 1056 | 1056 |
| 1057 RenderProcessGoneObserver observer(web_state()); | 1057 RenderProcessGoneObserver observer(web_state()); |
| 1058 web::SimulateWKWebViewCrash(webView_); | 1058 web::SimulateWKWebViewCrash(webView_); |
| 1059 observer.WaitForRenderProcessGone(); | 1059 observer.WaitForRenderProcessGone(); |
| 1060 | 1060 |
| 1061 EXPECT_FALSE([web_controller() isViewAlive]); | 1061 EXPECT_FALSE([web_controller() isViewAlive]); |
| 1062 }; | 1062 }; |
| 1063 | 1063 |
| 1064 } // namespace | 1064 } // namespace |
| OLD | NEW |