OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "base/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
8 #include "base/stl_util-inl.h" | 8 #include "base/stl_util-inl.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1321 // Tests that we can do a restore and navigate to the restored entries and | 1321 // Tests that we can do a restore and navigate to the restored entries and |
1322 // everything is updated properly. This can be tricky since there is no | 1322 // everything is updated properly. This can be tricky since there is no |
1323 // SiteInstance for the entries created initially. | 1323 // SiteInstance for the entries created initially. |
1324 TEST_F(NavigationControllerTest, RestoreNavigate) { | 1324 TEST_F(NavigationControllerTest, RestoreNavigate) { |
1325 // Create a NavigationController with a restored set of tabs. | 1325 // Create a NavigationController with a restored set of tabs. |
1326 GURL url("http://foo"); | 1326 GURL url("http://foo"); |
1327 std::vector<TabNavigation> navigations; | 1327 std::vector<TabNavigation> navigations; |
1328 navigations.push_back(TabNavigation(0, url, GURL(), | 1328 navigations.push_back(TabNavigation(0, url, GURL(), |
1329 ASCIIToUTF16("Title"), "state", | 1329 ASCIIToUTF16("Title"), "state", |
1330 PageTransition::LINK)); | 1330 PageTransition::LINK)); |
1331 TabContents our_contents(profile(), NULL, MSG_ROUTING_NONE, NULL); | 1331 TabContents our_contents(profile(), NULL, MSG_ROUTING_NONE, NULL, NULL); |
1332 NavigationController& our_controller = our_contents.controller(); | 1332 NavigationController& our_controller = our_contents.controller(); |
1333 our_controller.RestoreFromState(navigations, 0, true); | 1333 our_controller.RestoreFromState(navigations, 0, true); |
1334 our_controller.GoToIndex(0); | 1334 our_controller.GoToIndex(0); |
1335 | 1335 |
1336 // We should now have one entry, and it should be "pending". | 1336 // We should now have one entry, and it should be "pending". |
1337 EXPECT_EQ(1, our_controller.entry_count()); | 1337 EXPECT_EQ(1, our_controller.entry_count()); |
1338 EXPECT_EQ(our_controller.GetEntryAtIndex(0), | 1338 EXPECT_EQ(our_controller.GetEntryAtIndex(0), |
1339 our_controller.pending_entry()); | 1339 our_controller.pending_entry()); |
1340 EXPECT_EQ(0, our_controller.GetEntryAtIndex(0)->page_id()); | 1340 EXPECT_EQ(0, our_controller.GetEntryAtIndex(0)->page_id()); |
1341 EXPECT_EQ(NavigationEntry::RESTORE_LAST_SESSION, | 1341 EXPECT_EQ(NavigationEntry::RESTORE_LAST_SESSION, |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1933 PageTransition::LINK); | 1933 PageTransition::LINK); |
1934 session_helper_.AssertNavigationEquals(nav, | 1934 session_helper_.AssertNavigationEquals(nav, |
1935 windows_[0]->tabs[0]->navigations[0]); | 1935 windows_[0]->tabs[0]->navigations[0]); |
1936 nav.set_url(url2); | 1936 nav.set_url(url2); |
1937 session_helper_.AssertNavigationEquals(nav, | 1937 session_helper_.AssertNavigationEquals(nav, |
1938 windows_[0]->tabs[0]->navigations[1]); | 1938 windows_[0]->tabs[0]->navigations[1]); |
1939 } | 1939 } |
1940 */ | 1940 */ |
1941 | 1941 |
1942 } // namespace | 1942 } // namespace |
OLD | NEW |