chrome_browser_field_trials.h revision 2a99a7e74a7f215066514fe81d2bfa6639d9eddd
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 // Called by the browser main sequence to set up Field Trials for this client. 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 // Sets up common desktop-only field trials. 31 // Add an invocation of your field trial init function to this method, or to 32 // SetupFieldTrials if it is for all platforms. 33 void SetupDesktopFieldTrials(); 34 35 // A/B test for spdy when --use-spdy not set. 36 void SpdyFieldTrial(); 37 38 // A/B test for warmest socket vs. most recently used socket. 39 void WarmConnectionFieldTrial(); 40 41 // Field trial to see what disabling DNS pre-resolution does to 42 // latency of page loads. 43 void PredictorFieldTrial(); 44 45 // A field trial to see what effects launching Chrome automatically on 46 // computer startup has on retention and usage of Chrome. 47 void AutoLaunchChromeFieldTrial(); 48 49 // A collection of one-time-randomized and session-randomized field trials 50 // intended to test the uniformity and correctness of the field trial control, 51 // bucketing and reporting systems. 52 void SetupUniformityFieldTrials(const base::Time& install_date); 53 54 // Sets up the InfiniteCache field trial. 55 void SetUpInfiniteCacheFieldTrial(); 56 57 // Sets up field trials for doing Cache Sensitivity Analysis. 58 void SetUpCacheSensitivityAnalysisFieldTrial(); 59 60 // Disables the show profile switcher field trial if multi-profiles is not 61 // enabled. 62 void DisableShowProfileSwitcherTrialIfNecessary(); 63 64 // A field trial to determine the impact of using non-blocking reads for 65 // TCP sockets on Windows instead of overlapped I/O. 66 void WindowsOverlappedTCPReadsFieldTrial(); 67 68 // A field trial to check the simple cache performance. 69 void SetUpSimpleCacheFieldTrial(); 70 71 // Instantiates dynamic trials by querying their state, to ensure they get 72 // reported as used. 73 void InstantiateDynamicTrials(); 74 75 const CommandLine& parsed_command_line_; 76 77 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserFieldTrials); 78}; 79 80#endif // CHROME_BROWSER_CHROME_BROWSER_FIELD_TRIALS_H_ 81