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

Side by Side Diff: tools/perf/benchmarks/session_restore.py

Issue 808893002: [Telemetry] Remove session_restore's use of PageTest.CanRunForPage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Drop session_restore's use of CanRunForPage. Created 5 years, 11 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
« no previous file with comments | « no previous file | tools/perf/page_sets/session_restore.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 import os 5 import os
6 import tempfile 6 import tempfile
7 7
8 from measurements import session_restore 8 from measurements import session_restore
9 import page_sets 9 from page_sets import session_restore as session_restore_page_set
10 from profile_creators import small_profile_creator 10 from profile_creators import small_profile_creator
11 from telemetry import benchmark 11 from telemetry import benchmark
12 from telemetry.page import profile_generator 12 from telemetry.page import profile_generator
13 13
14
15 class _SessionRestoreTest(benchmark.Benchmark): 14 class _SessionRestoreTest(benchmark.Benchmark):
15 page_set = session_restore_page_set.SessionRestorePageSet
nednguyen 2015/01/08 01:54:14 I think this will lead to naming change.
16 16
17 @classmethod 17 @classmethod
18 def ProcessCommandLineArgs(cls, parser, args): 18 def ProcessCommandLineArgs(cls, parser, args):
19 super(_SessionRestoreTest, cls).ProcessCommandLineArgs(parser, args) 19 super(_SessionRestoreTest, cls).ProcessCommandLineArgs(parser, args)
20 profile_type = 'small_profile' 20 profile_type = 'small_profile'
21 if not args.browser_options.profile_dir: 21 if not args.browser_options.profile_dir:
22 output_dir = os.path.join(tempfile.gettempdir(), profile_type) 22 output_dir = os.path.join(tempfile.gettempdir(), profile_type)
23 profile_dir = os.path.join(output_dir, profile_type) 23 profile_dir = os.path.join(output_dir, profile_type)
24 if not os.path.exists(output_dir): 24 if not os.path.exists(output_dir):
25 os.makedirs(output_dir) 25 os.makedirs(output_dir)
26 26
27 # Generate new profiles if profile_dir does not exist. It only exists if 27 # Generate new profiles if profile_dir does not exist. It only exists if
28 # all profiles had been correctly generated in a previous run. 28 # all profiles had been correctly generated in a previous run.
29 if not os.path.exists(profile_dir): 29 if not os.path.exists(profile_dir):
30 new_args = args.Copy() 30 new_args = args.Copy()
31 new_args.pageset_repeat = 1 31 new_args.pageset_repeat = 1
32 new_args.output_dir = output_dir 32 new_args.output_dir = output_dir
33 profile_generator.GenerateProfiles( 33 profile_generator.GenerateProfiles(
34 small_profile_creator.SmallProfileCreator, profile_type, new_args) 34 small_profile_creator.SmallProfileCreator, profile_type, new_args)
35 args.browser_options.profile_dir = profile_dir 35 args.browser_options.profile_dir = profile_dir
36 36
37 def CreatePageTest(self, options): 37 def CreatePageTest(self, options):
38 is_cold = (self.tag == 'cold') 38 is_cold = (self.tag == 'cold')
39 return session_restore.SessionRestore(cold=is_cold) 39 return session_restore.SessionRestore(cold=is_cold)
40 40
41 # crbug.com/325479, crbug.com/381990 41 # crbug.com/325479, crbug.com/381990
42 @benchmark.Disabled('android', 'linux', 'reference') 42 @benchmark.Disabled('android', 'linux', 'reference')
43 class SessionRestoreColdTypical25(_SessionRestoreTest): 43 class SessionRestoreColdTypical25(_SessionRestoreTest):
44 tag = 'cold' 44 tag = 'cold'
45 page_set = page_sets.Typical25PageSet
46 options = {'pageset_repeat': 5} 45 options = {'pageset_repeat': 5}
47 46
48 47
49 # crbug.com/325479, crbug.com/381990 48 # crbug.com/325479, crbug.com/381990
50 @benchmark.Disabled('android', 'linux', 'reference') 49 @benchmark.Disabled('android', 'linux', 'reference')
51 class SessionRestoreWarmTypical25(_SessionRestoreTest): 50 class SessionRestoreWarmTypical25(_SessionRestoreTest):
52 tag = 'warm' 51 tag = 'warm'
53 page_set = page_sets.Typical25PageSet
54 options = {'pageset_repeat': 20} 52 options = {'pageset_repeat': 20}
OLDNEW
« no previous file with comments | « no previous file | tools/perf/page_sets/session_restore.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698