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

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

Issue 7289020: Updating histograms to allow for experiments & log origin-based histograms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 5 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 public: 91 public:
92 TestPrerenderContents( 92 TestPrerenderContents(
93 PrerenderManager* prerender_manager, 93 PrerenderManager* prerender_manager,
94 PrerenderTracker* prerender_tracker, 94 PrerenderTracker* prerender_tracker,
95 Profile* profile, 95 Profile* profile,
96 const GURL& url, 96 const GURL& url,
97 const GURL& referrer, 97 const GURL& referrer,
98 int number_of_loads, 98 int number_of_loads,
99 FinalStatus expected_final_status) 99 FinalStatus expected_final_status)
100 : PrerenderContents(prerender_manager, prerender_tracker, profile, 100 : PrerenderContents(prerender_manager, prerender_tracker, profile,
101 url, referrer, ORIGIN_LINK_REL_PRERENDER), 101 url, referrer, ORIGIN_LINK_REL_PRERENDER,
102 PrerenderManager::kNoExperiment),
102 number_of_loads_(0), 103 number_of_loads_(0),
103 expected_number_of_loads_(number_of_loads), 104 expected_number_of_loads_(number_of_loads),
104 expected_final_status_(expected_final_status), 105 expected_final_status_(expected_final_status),
105 new_render_view_host_(NULL), 106 new_render_view_host_(NULL),
106 was_hidden_(false), 107 was_hidden_(false),
107 was_shown_(false), 108 was_shown_(false),
108 quit_message_loop_on_destruction_(true) { 109 quit_message_loop_on_destruction_(true) {
109 } 110 }
110 111
111 virtual ~TestPrerenderContents() { 112 virtual ~TestPrerenderContents() {
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 VLOG(1) << "Factory created with queue length " << 238 VLOG(1) << "Factory created with queue length " <<
238 expected_final_status_queue_.size(); 239 expected_final_status_queue_.size();
239 } 240 }
240 241
241 virtual PrerenderContents* CreatePrerenderContents( 242 virtual PrerenderContents* CreatePrerenderContents(
242 PrerenderManager* prerender_manager, 243 PrerenderManager* prerender_manager,
243 PrerenderTracker* prerender_tracker, 244 PrerenderTracker* prerender_tracker,
244 Profile* profile, 245 Profile* profile,
245 const GURL& url, 246 const GURL& url,
246 const GURL& referrer, 247 const GURL& referrer,
247 Origin origin) OVERRIDE { 248 Origin origin,
249 char experiment_id) OVERRIDE {
cbentzel 2011/06/30 18:15:39 uint8 is better than char.
tburkard 2011/06/30 19:25:43 So use 255 then as "no experiment"? I think -1 is
dominich 2011/06/30 19:28:25 You can cast -1 to a uint8. Are the experiments g
tburkard 2011/06/30 19:45:48 Done.
tburkard 2011/06/30 19:45:48 Done.
248 CHECK(!expected_final_status_queue_.empty()) << 250 CHECK(!expected_final_status_queue_.empty()) <<
249 "Creating prerender contents for " << url.path() << 251 "Creating prerender contents for " << url.path() <<
250 " with no expected final status"; 252 " with no expected final status";
251 FinalStatus expected_final_status = expected_final_status_queue_.front(); 253 FinalStatus expected_final_status = expected_final_status_queue_.front();
252 expected_final_status_queue_.pop_front(); 254 expected_final_status_queue_.pop_front();
253 VLOG(1) << "Creating prerender contents for " << url.path() << 255 VLOG(1) << "Creating prerender contents for " << url.path() <<
254 " with expected final status " << expected_final_status; 256 " with expected final status " << expected_final_status;
255 VLOG(1) << expected_final_status_queue_.size() << " left in the queue."; 257 VLOG(1) << expected_final_status_queue_.size() << " left in the queue.";
256 return new TestPrerenderContents(prerender_manager, prerender_tracker, 258 return new TestPrerenderContents(prerender_manager, prerender_tracker,
257 profile, url, 259 profile, url,
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1444 NewRunnableFunction(ClearBrowsingData, browser(), 1446 NewRunnableFunction(ClearBrowsingData, browser(),
1445 BrowsingDataRemover::REMOVE_CACHE)); 1447 BrowsingDataRemover::REMOVE_CACHE));
1446 ui_test_utils::RunMessageLoop(); 1448 ui_test_utils::RunMessageLoop();
1447 1449
1448 // Make sure prerender history was not cleared. Not a vital behavior, but 1450 // Make sure prerender history was not cleared. Not a vital behavior, but
1449 // used to compare with PrerenderClearHistory test. 1451 // used to compare with PrerenderClearHistory test.
1450 EXPECT_EQ(1, GetHistoryLength()); 1452 EXPECT_EQ(1, GetHistoryLength());
1451 } 1453 }
1452 1454
1453 } // namespace prerender 1455 } // namespace prerender
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_contents.h » ('j') | chrome/browser/prerender/prerender_contents.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698