| 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 #include "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
| 7 #include "content/browser/frame_host/frame_tree.h" | 7 #include "content/browser/frame_host/frame_tree.h" |
| 8 #include "content/browser/frame_host/navigation_controller_impl.h" | 8 #include "content/browser/frame_host/navigation_controller_impl.h" |
| 9 #include "content/browser/frame_host/navigation_entry_impl.h" | 9 #include "content/browser/frame_host/navigation_entry_impl.h" |
| 10 #include "content/browser/web_contents/web_contents_impl.h" | 10 #include "content/browser/web_contents/web_contents_impl.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 EXPECT_EQ(controller.GetEntryCount(), kMaxEntryCount); | 68 EXPECT_EQ(controller.GetEntryCount(), kMaxEntryCount); |
| 69 | 69 |
| 70 // Navigate twice more more. | 70 // Navigate twice more more. |
| 71 for (int url_index = kMaxEntryCount; | 71 for (int url_index = kMaxEntryCount; |
| 72 url_index < kMaxEntryCount + 2; ++url_index) { | 72 url_index < kMaxEntryCount + 2; ++url_index) { |
| 73 GURL url(base::StringPrintf("data:text/html,page%d", url_index)); | 73 GURL url(base::StringPrintf("data:text/html,page%d", url_index)); |
| 74 EXPECT_TRUE(NavigateToURL(shell(), url)); | 74 EXPECT_TRUE(NavigateToURL(shell(), url)); |
| 75 } | 75 } |
| 76 | 76 |
| 77 // We expect http://www.a.com/0 and /1 to be gone. | 77 // We expect page0 and page1 to be gone. |
| 78 EXPECT_EQ(kMaxEntryCount, controller.GetEntryCount()); | 78 EXPECT_EQ(kMaxEntryCount, controller.GetEntryCount()); |
| 79 EXPECT_EQ(GURL("data:text/html,page2"), | 79 EXPECT_EQ(GURL("data:text/html,page2"), |
| 80 controller.GetEntryAtIndex(0)->GetURL()); | 80 controller.GetEntryAtIndex(0)->GetURL()); |
| 81 | 81 |
| 82 // Now try to go back. This should not hang. | 82 // Now try to go back. This should not hang. |
| 83 ASSERT_TRUE(controller.CanGoBack()); | 83 ASSERT_TRUE(controller.CanGoBack()); |
| 84 controller.GoBack(); | 84 controller.GoBack(); |
| 85 EXPECT_TRUE(WaitForLoadStop(shell()->web_contents())); | 85 EXPECT_TRUE(WaitForLoadStop(shell()->web_contents())); |
| 86 | 86 |
| 87 // This should have successfully gone back. | 87 // This should have successfully gone back. |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 embedded_test_server()->GetURL("/frame_tree/2-3.html")); | 243 embedded_test_server()->GetURL("/frame_tree/2-3.html")); |
| 244 NavigateFrameToURL(root->child_at(0), frame_url); | 244 NavigateFrameToURL(root->child_at(0), frame_url); |
| 245 capturer.Wait(); | 245 capturer.Wait(); |
| 246 EXPECT_EQ(ui::PAGE_TRANSITION_MANUAL_SUBFRAME, | 246 EXPECT_EQ(ui::PAGE_TRANSITION_MANUAL_SUBFRAME, |
| 247 capturer.params().transition); | 247 capturer.params().transition); |
| 248 EXPECT_EQ(NAVIGATION_TYPE_NEW_SUBFRAME, capturer.details().type); | 248 EXPECT_EQ(NAVIGATION_TYPE_NEW_SUBFRAME, capturer.details().type); |
| 249 } | 249 } |
| 250 } | 250 } |
| 251 | 251 |
| 252 } // namespace content | 252 } // namespace content |
| OLD | NEW |