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/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/memory/shared_memory.h" | 8 #include "base/memory/shared_memory.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 params_B.commit_params.page_state = | 857 params_B.commit_params.page_state = |
858 state_A; // Doesn't matter, just has to be present. | 858 state_A; // Doesn't matter, just has to be present. |
859 params_B.commit_params.browser_navigation_start = | 859 params_B.commit_params.browser_navigation_start = |
860 base::TimeTicks::FromInternalValue(1); | 860 base::TimeTicks::FromInternalValue(1); |
861 frame()->OnNavigate(params_B); | 861 frame()->OnNavigate(params_B); |
862 | 862 |
863 // State should be unchanged. | 863 // State should be unchanged. |
864 EXPECT_EQ(2, view()->history_list_length_); | 864 EXPECT_EQ(2, view()->history_list_length_); |
865 EXPECT_EQ(1, view()->history_list_offset_); | 865 EXPECT_EQ(1, view()->history_list_offset_); |
866 EXPECT_EQ(3, view()->history_page_ids_[1]); | 866 EXPECT_EQ(3, view()->history_page_ids_[1]); |
| 867 |
| 868 // Check for a valid DidDropNavigation message. |
| 869 ProcessPendingMessages(); |
| 870 const IPC::Message* msg = render_thread_->sink().GetUniqueMessageMatching( |
| 871 FrameHostMsg_DidDropNavigation::ID); |
| 872 ASSERT_TRUE(msg); |
| 873 render_thread_->sink().ClearMessages(); |
867 } | 874 } |
868 | 875 |
869 // Test that we do not ignore navigations after the entry limit is reached, | 876 // Test that we do not ignore navigations after the entry limit is reached, |
870 // in which case the browser starts dropping entries from the front. In this | 877 // in which case the browser starts dropping entries from the front. In this |
871 // case, we'll see a page_id mismatch but the RenderView's id will be older, | 878 // case, we'll see a page_id mismatch but the RenderView's id will be older, |
872 // not newer, than params.page_id. Use this as a cue that we should update the | 879 // not newer, than params.page_id. Use this as a cue that we should update the |
873 // state and not treat it like a navigation to a cropped forward history item. | 880 // state and not treat it like a navigation to a cropped forward history item. |
874 // See http://crbug.com/89798. | 881 // See http://crbug.com/89798. |
875 TEST_F(RenderViewImplTest, DontIgnoreBackAfterNavEntryLimit) { | 882 TEST_F(RenderViewImplTest, DontIgnoreBackAfterNavEntryLimit) { |
876 // Load page A. | 883 // Load page A. |
(...skipping 1659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2536 | 2543 |
2537 gfx::Size initial_size_; | 2544 gfx::Size initial_size_; |
2538 }; | 2545 }; |
2539 | 2546 |
2540 TEST_F(RenderViewImplInitialSizeTest, InitialSize) { | 2547 TEST_F(RenderViewImplInitialSizeTest, InitialSize) { |
2541 ASSERT_EQ(initial_size_, view_->GetSize()); | 2548 ASSERT_EQ(initial_size_, view_->GetSize()); |
2542 ASSERT_EQ(initial_size_, gfx::Size(view_->GetWebView()->size())); | 2549 ASSERT_EQ(initial_size_, gfx::Size(view_->GetWebView()->size())); |
2543 } | 2550 } |
2544 | 2551 |
2545 } // namespace content | 2552 } // namespace content |
OLD | NEW |