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

Side by Side Diff: content/test/test_web_contents.cc

Issue 12602003: When a pending contents is created but deleted before it is shown, remove it from the list of pendi… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 7 years, 9 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/test/test_web_contents.h" 5 #include "content/test/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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 } 167 }
168 168
169 void TestWebContents::SetOpener(TestWebContents* opener) { 169 void TestWebContents::SetOpener(TestWebContents* opener) {
170 // This is normally only set in the WebContents constructor, which also 170 // This is normally only set in the WebContents constructor, which also
171 // registers an observer for when the opener gets closed. 171 // registers an observer for when the opener gets closed.
172 opener_ = opener; 172 opener_ = opener;
173 registrar_.Add(this, NOTIFICATION_WEB_CONTENTS_DESTROYED, 173 registrar_.Add(this, NOTIFICATION_WEB_CONTENTS_DESTROYED,
174 Source<WebContents>(opener_)); 174 Source<WebContents>(opener_));
175 } 175 }
176 176
177 void TestWebContents::AddPendingContents(TestWebContents* contents) {
178 // This is normally only done in WebContentsImpl::CreateNewWindow.
179 pending_contents_[contents->GetRenderViewHost()->GetRoutingID()] = contents;
180 registrar_.Add(this, NOTIFICATION_WEB_CONTENTS_DESTROYED,
181 Source<WebContents>(contents));
182 }
183
177 void TestWebContents::ExpectSetHistoryLengthAndPrune( 184 void TestWebContents::ExpectSetHistoryLengthAndPrune(
178 const SiteInstance* site_instance, 185 const SiteInstance* site_instance,
179 int history_length, 186 int history_length,
180 int32 min_page_id) { 187 int32 min_page_id) {
181 expect_set_history_length_and_prune_ = true; 188 expect_set_history_length_and_prune_ = true;
182 expect_set_history_length_and_prune_site_instance_ = 189 expect_set_history_length_and_prune_site_instance_ =
183 static_cast<const SiteInstanceImpl*>(site_instance); 190 static_cast<const SiteInstanceImpl*>(site_instance);
184 expect_set_history_length_and_prune_history_length_ = history_length; 191 expect_set_history_length_and_prune_history_length_ = history_length;
185 expect_set_history_length_and_prune_min_page_id_ = min_page_id; 192 expect_set_history_length_and_prune_min_page_id_ = min_page_id;
186 } 193 }
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 } 241 }
235 242
236 void TestWebContents::ShowCreatedWidget(int route_id, 243 void TestWebContents::ShowCreatedWidget(int route_id,
237 const gfx::Rect& initial_pos) { 244 const gfx::Rect& initial_pos) {
238 } 245 }
239 246
240 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) { 247 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) {
241 } 248 }
242 249
243 } // namespace content 250 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698