| 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 from measurements import session_restore_with_url | 9 from measurements import session_restore_with_url |
| 10 import page_sets | 10 import page_sets |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 # Generate new profiles if profile_dir does not exist. It only exists if | 28 # Generate new profiles if profile_dir does not exist. It only exists if |
| 29 # all profiles had been correctly generated in a previous run. | 29 # all profiles had been correctly generated in a previous run. |
| 30 if not os.path.exists(profile_dir): | 30 if not os.path.exists(profile_dir): |
| 31 new_args = args.Copy() | 31 new_args = args.Copy() |
| 32 new_args.pageset_repeat = 1 | 32 new_args.pageset_repeat = 1 |
| 33 new_args.output_dir = output_dir | 33 new_args.output_dir = output_dir |
| 34 profile_generator.GenerateProfiles( | 34 profile_generator.GenerateProfiles( |
| 35 small_profile_creator.SmallProfileCreator, profile_type, new_args) | 35 small_profile_creator.SmallProfileCreator, profile_type, new_args) |
| 36 args.browser_options.profile_dir = profile_dir | 36 args.browser_options.profile_dir = profile_dir |
| 37 | 37 |
| 38 def CreatePageTest(self, options): |
| 39 is_cold = (self.tag == 'cold') |
| 40 return self.test(cold=is_cold) |
| 38 | 41 |
| 39 # crbug.com/325479, crbug.com/381990 | 42 # crbug.com/325479, crbug.com/381990 |
| 40 @benchmark.Disabled('android', 'linux', 'reference') | 43 @benchmark.Disabled('android', 'linux', 'reference') |
| 41 class SessionRestoreColdTypical25(_SessionRestoreTest): | 44 class SessionRestoreColdTypical25(_SessionRestoreTest): |
| 42 tag = 'cold' | 45 tag = 'cold' |
| 43 test = session_restore.SessionRestore(cold=True) | 46 test = session_restore.SessionRestore |
| 44 page_set = page_sets.Typical25PageSet | 47 page_set = page_sets.Typical25PageSet |
| 45 options = {'pageset_repeat': 5} | 48 options = {'pageset_repeat': 5} |
| 46 | 49 |
| 47 | 50 |
| 48 # crbug.com/325479, crbug.com/381990 | 51 # crbug.com/325479, crbug.com/381990 |
| 49 @benchmark.Disabled('android', 'linux', 'reference') | 52 @benchmark.Disabled('android', 'linux', 'reference') |
| 50 class SessionRestoreWarmTypical25(_SessionRestoreTest): | 53 class SessionRestoreWarmTypical25(_SessionRestoreTest): |
| 51 tag = 'warm' | 54 tag = 'warm' |
| 52 test = session_restore.SessionRestore(cold=False) | 55 test = session_restore.SessionRestore |
| 53 page_set = page_sets.Typical25PageSet | 56 page_set = page_sets.Typical25PageSet |
| 54 options = {'pageset_repeat': 20} | 57 options = {'pageset_repeat': 20} |
| 55 | 58 |
| 56 | 59 |
| 57 # crbug.com/325479, crbug.com/381990, crbug.com/405386 | 60 # crbug.com/325479, crbug.com/381990, crbug.com/405386 |
| 58 @benchmark.Disabled | 61 @benchmark.Disabled |
| 59 class SessionRestoreWithUrlCold(_SessionRestoreTest): | 62 class SessionRestoreWithUrlCold(_SessionRestoreTest): |
| 60 """Measure Chrome cold session restore with startup URLs.""" | 63 """Measure Chrome cold session restore with startup URLs.""" |
| 61 tag = 'cold' | 64 tag = 'cold' |
| 62 test = session_restore_with_url.SessionRestoreWithUrl(cold=True) | 65 test = session_restore_with_url.SessionRestoreWithUrl |
| 63 page_set = page_sets.StartupPagesPageSet | 66 page_set = page_sets.StartupPagesPageSet |
| 64 options = {'pageset_repeat': 5} | 67 options = {'pageset_repeat': 5} |
| 65 | 68 |
| 66 | 69 |
| 67 # crbug.com/325479, crbug.com/381990, crbug.com/405386 | 70 # crbug.com/325479, crbug.com/381990, crbug.com/405386 |
| 68 @benchmark.Disabled | 71 @benchmark.Disabled |
| 69 class SessionRestoreWithUrlWarm(_SessionRestoreTest): | 72 class SessionRestoreWithUrlWarm(_SessionRestoreTest): |
| 70 """Measure Chrome warm session restore with startup URLs.""" | 73 """Measure Chrome warm session restore with startup URLs.""" |
| 71 tag = 'warm' | 74 tag = 'warm' |
| 72 test = session_restore_with_url.SessionRestoreWithUrl(cold=False) | 75 test = session_restore_with_url.SessionRestoreWithUrl |
| 73 page_set = page_sets.StartupPagesPageSet | 76 page_set = page_sets.StartupPagesPageSet |
| 74 options = {'pageset_repeat': 10} | 77 options = {'pageset_repeat': 10} |
| OLD | NEW |