| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 const GURL kNewURL("http://eh"); | 509 const GURL kNewURL("http://eh"); |
| 510 controller.LoadURL( | 510 controller.LoadURL( |
| 511 kNewURL, content::Referrer(), content::PAGE_TRANSITION_TYPED, | 511 kNewURL, content::Referrer(), content::PAGE_TRANSITION_TYPED, |
| 512 std::string()); | 512 std::string()); |
| 513 EXPECT_EQ(0U, notifications.size()); | 513 EXPECT_EQ(0U, notifications.size()); |
| 514 EXPECT_EQ(-1, controller.GetPendingEntryIndex()); | 514 EXPECT_EQ(-1, controller.GetPendingEntryIndex()); |
| 515 EXPECT_TRUE(controller.GetPendingEntry()); | 515 EXPECT_TRUE(controller.GetPendingEntry()); |
| 516 EXPECT_EQ(-1, controller.GetLastCommittedEntryIndex()); | 516 EXPECT_EQ(-1, controller.GetLastCommittedEntryIndex()); |
| 517 EXPECT_EQ(1, delegate->navigation_state_change_count()); | 517 EXPECT_EQ(1, delegate->navigation_state_change_count()); |
| 518 | 518 |
| 519 // Now the navigation redirects. | 519 // Now the navigation redirects. The NavigationController no longer |
| 520 // receives a notification of the redirect, so nothing happens here. |
| 521 // See https://chromiumcodereview.appspot.com/10316020 |
| 520 const GURL kRedirectURL("http://bee"); | 522 const GURL kRedirectURL("http://bee"); |
| 521 test_rvh()->OnMessageReceived( | |
| 522 ViewHostMsg_DidRedirectProvisionalLoad(0, // routing_id | |
| 523 -1, // pending page_id | |
| 524 GURL(), // opener | |
| 525 kNewURL, // old url | |
| 526 kRedirectURL)); // new url | |
| 527 | |
| 528 // We don't want to change the NavigationEntry's url, in case it cancels. | |
| 529 // Prevents regression of http://crbug.com/77786. | |
| 530 EXPECT_EQ(kNewURL, controller.GetPendingEntry()->GetURL()); | |
| 531 | 523 |
| 532 // It may abort before committing, if it's a download or due to a stop or | 524 // It may abort before committing, if it's a download or due to a stop or |
| 533 // a new navigation from the user. | 525 // a new navigation from the user. |
| 534 ViewHostMsg_DidFailProvisionalLoadWithError_Params params; | 526 ViewHostMsg_DidFailProvisionalLoadWithError_Params params; |
| 535 params.frame_id = 1; | 527 params.frame_id = 1; |
| 536 params.is_main_frame = true; | 528 params.is_main_frame = true; |
| 537 params.error_code = net::ERR_ABORTED; | 529 params.error_code = net::ERR_ABORTED; |
| 538 params.error_description = string16(); | 530 params.error_description = string16(); |
| 539 params.url = kRedirectURL; | 531 params.url = kRedirectURL; |
| 540 params.showing_repost_interstitial = false; | 532 params.showing_repost_interstitial = false; |
| (...skipping 2078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2619 TabNavigation nav(0, url0, GURL(), string16(), | 2611 TabNavigation nav(0, url0, GURL(), string16(), |
| 2620 webkit_glue::CreateHistoryStateForURL(url0), | 2612 webkit_glue::CreateHistoryStateForURL(url0), |
| 2621 content::PAGE_TRANSITION_LINK); | 2613 content::PAGE_TRANSITION_LINK); |
| 2622 session_helper_.AssertNavigationEquals(nav, | 2614 session_helper_.AssertNavigationEquals(nav, |
| 2623 windows_[0]->tabs[0]->navigations[0]); | 2615 windows_[0]->tabs[0]->navigations[0]); |
| 2624 nav.set_url(url2); | 2616 nav.set_url(url2); |
| 2625 session_helper_.AssertNavigationEquals(nav, | 2617 session_helper_.AssertNavigationEquals(nav, |
| 2626 windows_[0]->tabs[0]->navigations[1]); | 2618 windows_[0]->tabs[0]->navigations[1]); |
| 2627 } | 2619 } |
| 2628 */ | 2620 */ |
| OLD | NEW |