| 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/navigation/crw_session_controller.h" | 5 #import "ios/web/navigation/crw_session_controller.h" |
| 6 | 6 |
| 7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 | 578 |
| 579 // Tests state of an empty session controller. | 579 // Tests state of an empty session controller. |
| 580 TEST_F(CRWSessionControllerTest, EmptyController) { | 580 TEST_F(CRWSessionControllerTest, EmptyController) { |
| 581 EXPECT_EQ(0U, [[session_controller_ entries] count]); | 581 EXPECT_EQ(0U, [[session_controller_ entries] count]); |
| 582 EXPECT_EQ(-1, [session_controller_ currentNavigationIndex]); | 582 EXPECT_EQ(-1, [session_controller_ currentNavigationIndex]); |
| 583 EXPECT_EQ(-1, [session_controller_ previousNavigationIndex]); | 583 EXPECT_EQ(-1, [session_controller_ previousNavigationIndex]); |
| 584 EXPECT_FALSE([session_controller_ currentEntry]); | 584 EXPECT_FALSE([session_controller_ currentEntry]); |
| 585 EXPECT_FALSE([session_controller_ pendingEntry]); | 585 EXPECT_FALSE([session_controller_ pendingEntry]); |
| 586 EXPECT_EQ(-1, [session_controller_ pendingEntryIndex]); | 586 EXPECT_EQ(-1, [session_controller_ pendingEntryIndex]); |
| 587 EXPECT_EQ(-1, [session_controller_ indexOfEntryForDelta:0]); | 587 EXPECT_EQ(-1, [session_controller_ indexOfEntryForDelta:0]); |
| 588 EXPECT_EQ(nil, [session_controller_ currentEntry]); |
| 588 } | 589 } |
| 589 | 590 |
| 590 // Tests going delta, including out of range cases. | 591 // Tests going delta, including out of range cases. |
| 591 TEST_F(CRWSessionControllerTest, GoDelta) { | 592 TEST_F(CRWSessionControllerTest, GoDelta) { |
| 592 [session_controller_ addPendingEntry:GURL("http://www.example.com/0") | 593 [session_controller_ addPendingEntry:GURL("http://www.example.com/0") |
| 593 referrer:MakeReferrer("http://www.example.com/a") | 594 referrer:MakeReferrer("http://www.example.com/a") |
| 594 transition:ui::PAGE_TRANSITION_LINK | 595 transition:ui::PAGE_TRANSITION_LINK |
| 595 rendererInitiated:NO]; | 596 rendererInitiated:NO]; |
| 596 [session_controller_ commitPendingEntry]; | 597 [session_controller_ commitPendingEntry]; |
| 597 [session_controller_ addPendingEntry:GURL("http://www.example.com/redirect") | 598 [session_controller_ addPendingEntry:GURL("http://www.example.com/redirect") |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1217 | 1218 |
| 1218 [session_controller_ setPendingEntryIndex:0]; | 1219 [session_controller_ setPendingEntryIndex:0]; |
| 1219 | 1220 |
| 1220 web::NavigationItem* visible_item = | 1221 web::NavigationItem* visible_item = |
| 1221 [[session_controller_ visibleEntry] navigationItem]; | 1222 [[session_controller_ visibleEntry] navigationItem]; |
| 1222 ASSERT_TRUE(visible_item); | 1223 ASSERT_TRUE(visible_item); |
| 1223 EXPECT_EQ("http://www.example.com/0", visible_item->GetURL().spec()); | 1224 EXPECT_EQ("http://www.example.com/0", visible_item->GetURL().spec()); |
| 1224 } | 1225 } |
| 1225 | 1226 |
| 1226 } // anonymous namespace | 1227 } // anonymous namespace |
| OLD | NEW |