Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Side by Side Diff: content/renderer/render_view_browsertest.cc

Issue 790843002: If the renderer drops a navigation, make sure the spinner doesn't spin endlessly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698