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

Side by Side Diff: content/browser/web_contents/test_web_contents.cc

Issue 10008015: Fixing a problem, where a hung renderer process is not killed when navigating away (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing an uninitialized variable and improving the test. Created 8 years, 8 months 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 | Annotate | Revision Log
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 "content/browser/web_contents/test_web_contents.h" 5 #include "content/browser/web_contents/test_web_contents.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "content/browser/browser_url_handler_impl.h" 9 #include "content/browser/browser_url_handler_impl.h"
10 #include "content/browser/renderer_host/render_view_host_impl.h" 10 #include "content/browser/renderer_host/render_view_host_impl.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 int page_id = entry->GetPageID(); 127 int page_id = entry->GetPageID();
128 if (page_id == -1) { 128 if (page_id == -1) {
129 // It's a new navigation, assign a never-seen page id to it. 129 // It's a new navigation, assign a never-seen page id to it.
130 page_id = GetMaxPageIDForSiteInstance(rvh->GetSiteInstance()) + 1; 130 page_id = GetMaxPageIDForSiteInstance(rvh->GetSiteInstance()) + 1;
131 } 131 }
132 rvh->SendNavigate(page_id, entry->GetURL()); 132 rvh->SendNavigate(page_id, entry->GetURL());
133 133
134 // Simulate the SwapOut_ACK that fires if you commit a cross-site navigation 134 // Simulate the SwapOut_ACK that fires if you commit a cross-site navigation
135 // without making any network requests. 135 // without making any network requests.
136 if (old_rvh != rvh) 136 if (old_rvh != rvh)
137 static_cast<RenderViewHostImpl*>(old_rvh)->OnSwapOutACK(); 137 static_cast<RenderViewHostImpl*>(old_rvh)->OnSwapOutACK(false);
138 } 138 }
139 139
140 int TestWebContents::GetNumberOfFocusCalls() { 140 int TestWebContents::GetNumberOfFocusCalls() {
141 NOTREACHED(); 141 NOTREACHED();
142 return 0; 142 return 0;
143 } 143 }
144 144
145 void TestWebContents::ProceedWithCrossSiteNavigation() { 145 void TestWebContents::ProceedWithCrossSiteNavigation() {
146 if (!GetPendingRenderViewHost()) 146 if (!GetPendingRenderViewHost())
147 return; 147 return;
(...skipping 24 matching lines...) Expand all
172 int32 min_page_id) { 172 int32 min_page_id) {
173 EXPECT_TRUE(expect_set_history_length_and_prune_); 173 EXPECT_TRUE(expect_set_history_length_and_prune_);
174 expect_set_history_length_and_prune_ = false; 174 expect_set_history_length_and_prune_ = false;
175 EXPECT_EQ(expect_set_history_length_and_prune_site_instance_, site_instance); 175 EXPECT_EQ(expect_set_history_length_and_prune_site_instance_, site_instance);
176 EXPECT_EQ(expect_set_history_length_and_prune_history_length_, 176 EXPECT_EQ(expect_set_history_length_and_prune_history_length_,
177 history_length); 177 history_length);
178 EXPECT_EQ(expect_set_history_length_and_prune_min_page_id_, min_page_id); 178 EXPECT_EQ(expect_set_history_length_and_prune_min_page_id_, min_page_id);
179 } 179 }
180 180
181 } // namespace content 181 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/render_view_host_manager_unittest.cc ('k') | content/public/browser/render_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698