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

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: update the rite cl 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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 PrerenderContents::DidStopLoading(render_view_host); 299 PrerenderContents::DidStopLoading(render_view_host);
300 ++number_of_loads_; 300 ++number_of_loads_;
301 if (ShouldRenderPrerenderedPageCorrectly(expected_final_status_) && 301 if (ShouldRenderPrerenderedPageCorrectly(expected_final_status_) &&
302 number_of_loads_ == expected_number_of_loads_) { 302 number_of_loads_ == expected_number_of_loads_) {
303 MessageLoopForUI::current()->Quit(); 303 MessageLoopForUI::current()->Quit();
304 } 304 }
305 } 305 }
306 306
307 virtual void AddPendingPrerender( 307 virtual void AddPendingPrerender(
308 base::WeakPtr<PrerenderHandle> weak_prerender_handle, 308 base::WeakPtr<PrerenderHandle> weak_prerender_handle,
309 const Origin origin,
309 const GURL& url, 310 const GURL& url,
310 const content::Referrer& referrer, 311 const content::Referrer& referrer,
311 const gfx::Size& size) OVERRIDE { 312 const gfx::Size& size) OVERRIDE {
312 PrerenderContents::AddPendingPrerender( 313 PrerenderContents::AddPendingPrerender(
313 weak_prerender_handle, url, referrer, size); 314 weak_prerender_handle, origin, url, referrer, size);
314 if (expected_pending_prerenders_ > 0 && 315 if (expected_pending_prerenders_ > 0 &&
315 pending_prerenders().size() == expected_pending_prerenders_) { 316 pending_prerenders().size() == expected_pending_prerenders_) {
316 MessageLoop::current()->Quit(); 317 MessageLoop::current()->Quit();
317 } 318 }
318 } 319 }
319 320
320 virtual WebContents* CreateWebContents( 321 virtual WebContents* CreateWebContents(
321 content::SessionStorageNamespace* session_storage_namespace) OVERRIDE { 322 content::SessionStorageNamespace* session_storage_namespace) OVERRIDE {
322 WebContents* web_contents = PrerenderContents::CreateWebContents( 323 WebContents* web_contents = PrerenderContents::CreateWebContents(
323 session_storage_namespace); 324 session_storage_namespace);
(...skipping 2195 matching lines...) Expand 10 before | Expand all | Expand 10 after
2519 channel_close_watcher.WatchChannel( 2520 channel_close_watcher.WatchChannel(
2520 chrome::GetActiveWebContents(browser())->GetRenderProcessHost()); 2521 chrome::GetActiveWebContents(browser())->GetRenderProcessHost());
2521 NavigateToDestURL(); 2522 NavigateToDestURL();
2522 channel_close_watcher.WaitForChannelClose(); 2523 channel_close_watcher.WaitForChannelClose();
2523 2524
2524 ASSERT_TRUE(IsEmptyPrerenderLinkManager()); 2525 ASSERT_TRUE(IsEmptyPrerenderLinkManager());
2525 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); 2526 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message();
2526 } 2527 }
2527 2528
2528 } // namespace prerender 2529 } // namespace prerender
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_contents.h » ('j') | chrome/browser/prerender/prerender_histograms.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698