chrome_browser_field_trials.h revision 5821806d5e7f356e8fa4b058a389a808ea183019
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 3// found in the LICENSE file. 4 5#ifndef CHROME_BROWSER_CHROME_BROWSER_FIELD_TRIALS_H_ 6#define CHROME_BROWSER_CHROME_BROWSER_FIELD_TRIALS_H_ 7 8#include "base/basictypes.h" 9#include "base/command_line.h" 10#include "base/gtest_prod_util.h" 11#include "base/time.h" 12 13class ChromeBrowserFieldTrials { 14 public: 15 explicit ChromeBrowserFieldTrials(const CommandLine& command_line); 16 ~ChromeBrowserFieldTrials(); 17 18 // Add an invocation of your field trial init function to this method. 19 // |install_time| is the time this browser was installed (or the last time 20 // prefs was reset). |install_time| is used by trials that are only created 21 // for new installs of the browser. 22 void SetupFieldTrials(const base::Time& install_time); 23 24 private: 25 FRIEND_TEST_ALL_PREFIXES(BrowserMainTest, 26 WarmConnectionFieldTrial_WarmestSocket); 27 FRIEND_TEST_ALL_PREFIXES(BrowserMainTest, WarmConnectionFieldTrial_Random); 28 FRIEND_TEST_ALL_PREFIXES(BrowserMainTest, WarmConnectionFieldTrial_Invalid); 29 30 // A/B test for spdy when --use-spdy not set. 31 void SpdyFieldTrial(); 32 33 // A/B test for warmest socket vs. most recently used socket. 34 void WarmConnectionFieldTrial(); 35 36 // Field trial to see what disabling DNS pre-resolution does to 37 // latency of page loads. 38 void PredictorFieldTrial(); 39 40 // A field trial to see what effects launching Chrome automatically on 41 // computer startup has on retention and usage of Chrome. 42 void AutoLaunchChromeFieldTrial(); 43 44 // A collection of one-time-randomized and session-randomized field trials 45 // intended to test the uniformity and correctness of the field trial control, 46 // bucketing and reporting systems. 47 void SetupUniformityFieldTrials(const base::Time& install_date); 48 49 // Disables the new tab field trial if not running in desktop mode. 50 void DisableNewTabFieldTrialIfNecesssary(); 51 52 // Sets up the InfiniteCache field trial. 53 void SetUpInfiniteCacheFieldTrial(); 54 55 // Sets up field trials for doing Cache Sensitivity Analysis. 56 void SetUpCacheSensitivityAnalysisFieldTrial(); 57 58 // A field trial to determine the impact of using non-blocking reads for 59 // TCP sockets on Windows instead of overlapped I/O. 60 void WindowsOverlappedTCPReadsFieldTrial(); 61 62 // Instantiates dynamic trials by querying their state, to ensure they get 63 // reported as used. 64 void InstantiateDynamicTrials(); 65 66 const CommandLine& parsed_command_line_; 67 68 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserFieldTrials); 69}; 70 71#endif // CHROME_BROWSER_CHROME_BROWSER_FIELD_TRIALS_H_ 72