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