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

Side by Side Diff: chrome/browser/prerender/prerender_browsertest.cc

Issue 11028037: Fix prerender histograms for multiple prerender case. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... new tests, indent. Created 8 years, 2 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 <deque> 5 #include <deque>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 PrerenderContents::DidStopLoading(render_view_host); 300 PrerenderContents::DidStopLoading(render_view_host);
301 ++number_of_loads_; 301 ++number_of_loads_;
302 if (ShouldRenderPrerenderedPageCorrectly(expected_final_status_) && 302 if (ShouldRenderPrerenderedPageCorrectly(expected_final_status_) &&
303 number_of_loads_ == expected_number_of_loads_) { 303 number_of_loads_ == expected_number_of_loads_) {
304 MessageLoopForUI::current()->Quit(); 304 MessageLoopForUI::current()->Quit();
305 } 305 }
306 } 306 }
307 307
308 virtual void AddPendingPrerender( 308 virtual void AddPendingPrerender(
309 base::WeakPtr<PrerenderHandle> weak_prerender_handle, 309 base::WeakPtr<PrerenderHandle> weak_prerender_handle,
310 Origin origin,
310 const GURL& url, 311 const GURL& url,
311 const content::Referrer& referrer, 312 const content::Referrer& referrer,
312 const gfx::Size& size) OVERRIDE { 313 const gfx::Size& size) OVERRIDE {
313 PrerenderContents::AddPendingPrerender( 314 PrerenderContents::AddPendingPrerender(
314 weak_prerender_handle, url, referrer, size); 315 weak_prerender_handle, origin, url, referrer, size);
315 if (expected_pending_prerenders_ > 0 && 316 if (expected_pending_prerenders_ > 0 &&
316 pending_prerenders().size() == expected_pending_prerenders_) { 317 pending_prerenders().size() == expected_pending_prerenders_) {
317 MessageLoop::current()->Quit(); 318 MessageLoop::current()->Quit();
318 } 319 }
319 } 320 }
320 321
321 virtual WebContents* CreateWebContents( 322 virtual WebContents* CreateWebContents(
322 content::SessionStorageNamespace* session_storage_namespace) OVERRIDE { 323 content::SessionStorageNamespace* session_storage_namespace) OVERRIDE {
323 WebContents* web_contents = PrerenderContents::CreateWebContents( 324 WebContents* web_contents = PrerenderContents::CreateWebContents(
324 session_storage_namespace); 325 session_storage_namespace);
(...skipping 2193 matching lines...) Expand 10 before | Expand all | Expand 10 after
2518 channel_close_watcher.WatchChannel( 2519 channel_close_watcher.WatchChannel(
2519 chrome::GetActiveWebContents(browser())->GetRenderProcessHost()); 2520 chrome::GetActiveWebContents(browser())->GetRenderProcessHost());
2520 NavigateToDestURL(); 2521 NavigateToDestURL();
2521 channel_close_watcher.WaitForChannelClose(); 2522 channel_close_watcher.WaitForChannelClose();
2522 2523
2523 ASSERT_TRUE(IsEmptyPrerenderLinkManager()); 2524 ASSERT_TRUE(IsEmptyPrerenderLinkManager());
2524 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); 2525 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message();
2525 } 2526 }
2526 2527
2527 } // namespace prerender 2528 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/prerender/prerender_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698