| OLD | NEW |
| 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 import page_sets |
| 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 | 14 |
| 15 class _SessionRestoreTest(benchmark.Benchmark): | 15 class _SessionRestoreTest(benchmark.Benchmark): |
| 16 | 16 |
| 17 @classmethod | 17 @classmethod |
| 18 def Name(cls): |
| 19 return 'session_restore' |
| 20 |
| 21 @classmethod |
| 18 def ProcessCommandLineArgs(cls, parser, args): | 22 def ProcessCommandLineArgs(cls, parser, args): |
| 19 super(_SessionRestoreTest, cls).ProcessCommandLineArgs(parser, args) | 23 super(_SessionRestoreTest, cls).ProcessCommandLineArgs(parser, args) |
| 20 profile_type = 'small_profile' | 24 profile_type = 'small_profile' |
| 21 if not args.browser_options.profile_dir: | 25 if not args.browser_options.profile_dir: |
| 22 output_dir = os.path.join(tempfile.gettempdir(), profile_type) | 26 output_dir = os.path.join(tempfile.gettempdir(), profile_type) |
| 23 profile_dir = os.path.join(output_dir, profile_type) | 27 profile_dir = os.path.join(output_dir, profile_type) |
| 24 if not os.path.exists(output_dir): | 28 if not os.path.exists(output_dir): |
| 25 os.makedirs(output_dir) | 29 os.makedirs(output_dir) |
| 26 | 30 |
| 27 # Generate new profiles if profile_dir does not exist. It only exists if | 31 # Generate new profiles if profile_dir does not exist. It only exists if |
| (...skipping 10 matching lines...) Expand all Loading... |
| 38 is_cold = (self.tag == 'cold') | 42 is_cold = (self.tag == 'cold') |
| 39 return session_restore.SessionRestore(cold=is_cold) | 43 return session_restore.SessionRestore(cold=is_cold) |
| 40 | 44 |
| 41 # crbug.com/325479, crbug.com/381990 | 45 # crbug.com/325479, crbug.com/381990 |
| 42 @benchmark.Disabled('android', 'linux', 'reference') | 46 @benchmark.Disabled('android', 'linux', 'reference') |
| 43 class SessionRestoreColdTypical25(_SessionRestoreTest): | 47 class SessionRestoreColdTypical25(_SessionRestoreTest): |
| 44 tag = 'cold' | 48 tag = 'cold' |
| 45 page_set = page_sets.Typical25PageSet | 49 page_set = page_sets.Typical25PageSet |
| 46 options = {'pageset_repeat': 5} | 50 options = {'pageset_repeat': 5} |
| 47 | 51 |
| 52 @classmethod |
| 53 def Name(cls): |
| 54 return 'session_restore.cold.typical_25' |
| 55 |
| 48 | 56 |
| 49 # crbug.com/325479, crbug.com/381990 | 57 # crbug.com/325479, crbug.com/381990 |
| 50 @benchmark.Disabled('android', 'linux', 'reference') | 58 @benchmark.Disabled('android', 'linux', 'reference') |
| 51 class SessionRestoreWarmTypical25(_SessionRestoreTest): | 59 class SessionRestoreWarmTypical25(_SessionRestoreTest): |
| 52 tag = 'warm' | 60 tag = 'warm' |
| 53 page_set = page_sets.Typical25PageSet | 61 page_set = page_sets.Typical25PageSet |
| 54 options = {'pageset_repeat': 20} | 62 options = {'pageset_repeat': 20} |
| 63 @classmethod |
| 64 def Name(cls): |
| 65 return 'session_restore.warm.typical_25' |
| 66 |
| OLD | NEW |