OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 2040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2051 EXPECT_TRUE(controller.RendererDidNavigate(main_test_rfh(), params, | 2051 EXPECT_TRUE(controller.RendererDidNavigate(main_test_rfh(), params, |
2052 &details)); | 2052 &details)); |
2053 EXPECT_EQ(1U, navigation_entry_committed_counter_); | 2053 EXPECT_EQ(1U, navigation_entry_committed_counter_); |
2054 navigation_entry_committed_counter_ = 0; | 2054 navigation_entry_committed_counter_ = 0; |
2055 EXPECT_EQ(2, controller.GetEntryCount()); | 2055 EXPECT_EQ(2, controller.GetEntryCount()); |
2056 | 2056 |
2057 // Second manual subframe navigation should also make a new entry. | 2057 // Second manual subframe navigation should also make a new entry. |
2058 const GURL url3("http://foo3"); | 2058 const GURL url3("http://foo3"); |
2059 params.page_id = 2; | 2059 params.page_id = 2; |
2060 params.url = url3; | 2060 params.url = url3; |
| 2061 params.transition = ui::PAGE_TRANSITION_MANUAL_SUBFRAME; |
2061 EXPECT_TRUE(controller.RendererDidNavigate(main_test_rfh(), params, | 2062 EXPECT_TRUE(controller.RendererDidNavigate(main_test_rfh(), params, |
2062 &details)); | 2063 &details)); |
2063 EXPECT_EQ(1U, navigation_entry_committed_counter_); | 2064 EXPECT_EQ(1U, navigation_entry_committed_counter_); |
2064 navigation_entry_committed_counter_ = 0; | 2065 navigation_entry_committed_counter_ = 0; |
2065 EXPECT_EQ(3, controller.GetEntryCount()); | 2066 EXPECT_EQ(3, controller.GetEntryCount()); |
2066 EXPECT_EQ(2, controller.GetCurrentEntryIndex()); | 2067 EXPECT_EQ(2, controller.GetCurrentEntryIndex()); |
2067 | 2068 |
2068 // Go back one. | 2069 // Go back one. |
2069 controller.GoBack(); | 2070 controller.GoBack(); |
| 2071 params.page_id = 1; |
2070 params.url = url2; | 2072 params.url = url2; |
2071 params.page_id = 1; | 2073 params.transition = ui::PAGE_TRANSITION_AUTO_SUBFRAME; |
2072 EXPECT_TRUE(controller.RendererDidNavigate(main_test_rfh(), params, | 2074 EXPECT_TRUE(controller.RendererDidNavigate(main_test_rfh(), params, |
2073 &details)); | 2075 &details)); |
2074 EXPECT_EQ(1U, navigation_entry_committed_counter_); | 2076 EXPECT_EQ(1U, navigation_entry_committed_counter_); |
2075 navigation_entry_committed_counter_ = 0; | 2077 navigation_entry_committed_counter_ = 0; |
2076 EXPECT_EQ(3, controller.GetEntryCount()); | 2078 EXPECT_EQ(3, controller.GetEntryCount()); |
2077 EXPECT_EQ(1, controller.GetCurrentEntryIndex()); | 2079 EXPECT_EQ(1, controller.GetCurrentEntryIndex()); |
2078 EXPECT_EQ(-1, controller.GetPendingEntryIndex()); | 2080 EXPECT_EQ(-1, controller.GetPendingEntryIndex()); |
2079 EXPECT_FALSE(controller.GetPendingEntry()); | 2081 EXPECT_FALSE(controller.GetPendingEntry()); |
2080 | 2082 |
2081 // Go back one more. | 2083 // Go back one more. |
2082 controller.GoBack(); | 2084 controller.GoBack(); |
| 2085 params.page_id = 0; |
2083 params.url = url1; | 2086 params.url = url1; |
2084 params.page_id = 0; | 2087 params.transition = ui::PAGE_TRANSITION_AUTO_SUBFRAME; |
2085 EXPECT_TRUE(controller.RendererDidNavigate(main_test_rfh(), params, | 2088 EXPECT_TRUE(controller.RendererDidNavigate(main_test_rfh(), params, |
2086 &details)); | 2089 &details)); |
2087 EXPECT_EQ(1U, navigation_entry_committed_counter_); | 2090 EXPECT_EQ(1U, navigation_entry_committed_counter_); |
2088 navigation_entry_committed_counter_ = 0; | 2091 navigation_entry_committed_counter_ = 0; |
2089 EXPECT_EQ(3, controller.GetEntryCount()); | 2092 EXPECT_EQ(3, controller.GetEntryCount()); |
2090 EXPECT_EQ(0, controller.GetCurrentEntryIndex()); | 2093 EXPECT_EQ(0, controller.GetCurrentEntryIndex()); |
2091 EXPECT_EQ(-1, controller.GetPendingEntryIndex()); | 2094 EXPECT_EQ(-1, controller.GetPendingEntryIndex()); |
2092 EXPECT_FALSE(controller.GetPendingEntry()); | 2095 EXPECT_FALSE(controller.GetPendingEntry()); |
2093 } | 2096 } |
2094 | 2097 |
(...skipping 2433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4528 params.post_id = -1; | 4531 params.post_id = -1; |
4529 contents()->GetMainFrame()->SendNavigateWithParams(¶ms); | 4532 contents()->GetMainFrame()->SendNavigateWithParams(¶ms); |
4530 | 4533 |
4531 // Now reload. replaceState overrides the POST, so we should not show a | 4534 // Now reload. replaceState overrides the POST, so we should not show a |
4532 // repost warning dialog. | 4535 // repost warning dialog. |
4533 controller_impl().Reload(true); | 4536 controller_impl().Reload(true); |
4534 EXPECT_EQ(0, delegate->repost_form_warning_count()); | 4537 EXPECT_EQ(0, delegate->repost_form_warning_count()); |
4535 } | 4538 } |
4536 | 4539 |
4537 } // namespace content | 4540 } // namespace content |
OLD | NEW |