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

Side by Side Diff: tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py

Issue 2652313002: predictors: Move the configuration of speculative prefetch to field trials. (Closed)
Patch Set: Address comments. Created 3 years, 10 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
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # 2 #
3 # Copyright 2015 The Chromium Authors. All rights reserved. 3 # Copyright 2015 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Loops Custom Tabs tests and outputs the results into a CSV file.""" 7 """Loops Custom Tabs tests and outputs the results into a CSV file."""
8 8
9 import collections 9 import collections
10 import contextlib 10 import contextlib
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 try: 180 try:
181 while should_stop is None or not should_stop.is_set(): 181 while should_stop is None or not should_stop.is_set():
182 config = configs[random.randint(0, len(configs) - 1)] 182 config = configs[random.randint(0, len(configs) - 1)]
183 chrome_args = CHROME_ARGS + wpr_attributes.chrome_args 183 chrome_args = CHROME_ARGS + wpr_attributes.chrome_args
184 if config['speculation_mode'] == 'no_state_prefetch': 184 if config['speculation_mode'] == 'no_state_prefetch':
185 # NoStatePrefetch is enabled through an experiment. 185 # NoStatePrefetch is enabled through an experiment.
186 chrome_args.extend([ 186 chrome_args.extend([
187 '--force-fieldtrials=trial/group', 187 '--force-fieldtrials=trial/group',
188 '--force-fieldtrial-params=trial.group:mode/no_state_prefetch', 188 '--force-fieldtrial-params=trial.group:mode/no_state_prefetch',
189 '--enable-features="NoStatePrefetch<trial"']) 189 '--enable-features="NoStatePrefetch<trial"'])
190 elif config['speculation_mode'] == 'speculative_prefetch':
191 # Speculative Prefetch is enabled through an experiment.
192 chrome_args.extend([
193 '--force-fieldtrials=trial/group',
194 '--force-fieldtrial-params=trial.group:mode/external-prefetching',
195 '--enable-features="SpeculativeResourcePrefetching<trial"'])
190 196
191 result = RunOnce(device, config['url'], config['warmup'], 197 result = RunOnce(device, config['url'], config['warmup'],
192 config['speculation_mode'], 198 config['speculation_mode'],
193 config['delay_to_may_launch_url'], 199 config['delay_to_may_launch_url'],
194 config['delay_to_launch_url'], config['cold'], 200 config['delay_to_launch_url'], config['cold'],
195 chrome_args, reset_chrome_state=True) 201 chrome_args, reset_chrome_state=True)
196 if result is not None: 202 if result is not None:
197 out.write(result + '\n') 203 out.write(result + '\n')
198 out.flush() 204 out.flush()
199 if once: 205 if once:
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 'delay_to_launch_url': options.delay_to_launch_url, 323 'delay_to_launch_url': options.delay_to_launch_url,
318 'cold': options.cold, 324 'cold': options.cold,
319 } 325 }
320 LoopOnDevice(device, [config], options.output_file, options.wpr_archive, 326 LoopOnDevice(device, [config], options.output_file, options.wpr_archive,
321 options.record, options.network_condition, options.wpr_log, 327 options.record, options.network_condition, options.wpr_log,
322 once=options.once) 328 once=options.once)
323 329
324 330
325 if __name__ == '__main__': 331 if __name__ == '__main__':
326 main() 332 main()
OLDNEW
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | tools/resource_prefetch_predictor/generate_test_data.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698