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, GoToEntryWithoutDocumentChange) { | 677 TEST_F(CRWWebControllerNavigationTest, GoToItemWithoutDocumentChange) { |
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.entries.count); | 683 EXPECT_EQ(2U, session_controller.items.size()); |
684 EXPECT_NSEQ(session_controller.entries.lastObject, | 684 EXPECT_EQ(session_controller.items.back().get(), |
685 session_controller.currentEntry); | 685 session_controller.currentItem); |
686 | 686 |
687 [web_controller() goToItemAtIndex:0]; | 687 [web_controller() goToItemAtIndex:0]; |
688 EXPECT_NSEQ(session_controller.entries.firstObject, | 688 EXPECT_EQ(session_controller.items.front().get(), |
689 session_controller.currentEntry); | 689 session_controller.currentItem); |
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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1054 }; | 1054 }; |
1055 | 1055 |
1056 RenderProcessGoneObserver observer(web_state()); | 1056 RenderProcessGoneObserver observer(web_state()); |
1057 web::SimulateWKWebViewCrash(webView_); | 1057 web::SimulateWKWebViewCrash(webView_); |
1058 observer.WaitForRenderProcessGone(); | 1058 observer.WaitForRenderProcessGone(); |
1059 | 1059 |
1060 EXPECT_FALSE([web_controller() isViewAlive]); | 1060 EXPECT_FALSE([web_controller() isViewAlive]); |
1061 }; | 1061 }; |
1062 | 1062 |
1063 } // namespace | 1063 } // namespace |
OLD | NEW |