OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/navigation/navigation_manager_impl.h" | 5 #import "ios/web/navigation/navigation_manager_impl.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #import "base/mac/scoped_nsobject.h" | 8 #import "base/mac/scoped_nsobject.h" |
9 #import "ios/web/navigation/crw_session_controller+private_constructors.h" | 9 #import "ios/web/navigation/crw_session_controller+private_constructors.h" |
10 #import "ios/web/navigation/navigation_manager_delegate.h" | 10 #import "ios/web/navigation/navigation_manager_delegate.h" |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
590 ASSERT_EQ(web::UserAgentType::NONE, native_item2->GetUserAgentType()); | 590 ASSERT_EQ(web::UserAgentType::NONE, native_item2->GetUserAgentType()); |
591 navigation_manager()->AddPendingItem( | 591 navigation_manager()->AddPendingItem( |
592 GURL("http://www.3.com"), Referrer(), ui::PAGE_TRANSITION_TYPED, | 592 GURL("http://www.3.com"), Referrer(), ui::PAGE_TRANSITION_TYPED, |
593 web::NavigationInitiationType::USER_INITIATED); | 593 web::NavigationInitiationType::USER_INITIATED); |
594 [session_controller() commitPendingItem]; | 594 [session_controller() commitPendingItem]; |
595 web::NavigationItem* item3 = navigation_manager()->GetLastCommittedItem(); | 595 web::NavigationItem* item3 = navigation_manager()->GetLastCommittedItem(); |
596 | 596 |
597 // Verify that |item2|'s UserAgentType is propagated to |item3|. | 597 // Verify that |item2|'s UserAgentType is propagated to |item3|. |
598 EXPECT_EQ(item2->GetUserAgentType(), item3->GetUserAgentType()); | 598 EXPECT_EQ(item2->GetUserAgentType(), item3->GetUserAgentType()); |
599 } | 599 } |
600 | 600 |
Eugene But (OOO till 7-30)
2017/03/15 17:53:32
Can we add more tests? Specifically tests which wo
| |
601 // Tests that calling |Reload| on NavigationManager leaves the Url of the | |
602 // visible item unchanged. | |
603 TEST_F(NavigationManagerTest, ReloadWithNormalReloadType) { | |
604 navigation_manager()->AddPendingItem( | |
605 GURL("http://www.url.com"), Referrer(), ui::PAGE_TRANSITION_TYPED, | |
606 web::NavigationInitiationType::USER_INITIATED); | |
607 ASSERT_TRUE(navigation_manager()->GetVisibleItem()); | |
608 | |
609 GURL url_before_reload = navigation_manager()->GetVisibleItem()->GetURL(); | |
610 navigation_manager()->Reload(web::ReloadType::NORMAL, true); | |
Eugene But (OOO till 7-30)
2017/03/15 17:53:32
nit: /*check_for_repost*/
| |
611 | |
612 EXPECT_EQ(url_before_reload, | |
613 navigation_manager()->GetVisibleItem()->GetURL()); | |
614 } | |
615 | |
601 } // namespace web | 616 } // namespace web |
OLD | NEW |