Chromium Code Reviews| 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 | |
| 6 import tempfile | |
| 7 | |
| 5 from measurements import session_restore | 8 from measurements import session_restore |
| 9 from measurements import session_restore_with_url | |
| 10 from profile_creators import small_profile_creator | |
| 6 from telemetry import test | 11 from telemetry import test |
| 12 from telemetry.page import profile_generator | |
| 13 | |
| 14 | |
| 15 class _SessionRestoreTest(test.Test): | |
|
jeremy
2014/06/05 10:47:26
I worry that a mistake in the bot config could mak
| |
| 16 | |
| 17 @classmethod | |
| 18 def ProcessCommandLineArgs(cls, parser, args): | |
| 19 super(_SessionRestoreTest, cls).ProcessCommandLineArgs(parser, args) | |
| 20 profile_type = 'small_profile' | |
| 21 if not args.browser_options.profile_dir: | |
| 22 profile_dir = os.path.join(tempfile.gettempdir(), profile_type) | |
| 23 if not os.path.exists(profile_dir): | |
| 24 os.makedirs(profile_dir) | |
| 25 new_args = args.Copy() | |
| 26 new_args.pageset_repeat = 1 | |
| 27 new_args.output_dir = tempfile.gettempdir() | |
| 28 profile_generator.GenerateProfiles( | |
| 29 small_profile_creator.SmallProfileCreator, profile_type, new_args) | |
| 30 args.browser_options.profile_dir = profile_dir | |
| 7 | 31 |
| 8 | 32 |
| 9 # crbug.com/325479: Disabling this test for now since it never ran before. | 33 # crbug.com/325479: Disabling this test for now since it never ran before. |
| 10 @test.Disabled('android', 'linux') | 34 @test.Disabled('android', 'linux') |
| 11 class SessionRestoreColdTypical25(test.Test): | 35 class SessionRestoreColdTypical25(_SessionRestoreTest): |
| 12 tag = 'cold' | 36 tag = 'cold' |
| 13 test = session_restore.SessionRestore | 37 test = session_restore.SessionRestore |
| 14 page_set = 'page_sets/typical_25.py' | 38 page_set = 'page_sets/typical_25.py' |
| 15 options = {'cold': True, | 39 options = {'cold': True, |
| 16 'pageset_repeat': 5} | 40 'pageset_repeat': 5} |
| 17 | 41 |
| 18 | 42 |
| 19 class SessionRestoreWarmTypical25(test.Test): | 43 class SessionRestoreWarmTypical25(_SessionRestoreTest): |
| 20 tag = 'warm' | 44 tag = 'warm' |
| 21 test = session_restore.SessionRestore | 45 test = session_restore.SessionRestore |
| 22 page_set = 'page_sets/typical_25.py' | 46 page_set = 'page_sets/typical_25.py' |
| 23 options = {'warm': True, | 47 options = {'warm': True, |
| 24 'pageset_repeat': 20} | 48 'pageset_repeat': 20} |
| 49 | |
| 50 | |
| 51 class SessionRestoreWithUrlCold(_SessionRestoreTest): | |
| 52 """Measure Chrome cold session restore with startup URLs.""" | |
| 53 tag = 'cold' | |
| 54 test = session_restore_with_url.SessionRestoreWithUrl | |
| 55 page_set = 'page_sets/startup_pages.py' | |
| 56 options = {'cold': True, | |
| 57 'pageset_repeat': 5} | |
| 58 | |
| 59 | |
| 60 class SessionRestoreWithUrlWarm(_SessionRestoreTest): | |
| 61 """Measure Chrome warm session restore with startup URLs.""" | |
| 62 tag = 'warm' | |
| 63 test = session_restore_with_url.SessionRestoreWithUrl | |
| 64 page_set = 'page_sets/startup_pages.py' | |
| 65 options = {'warm': True, | |
| 66 'pageset_repeat': 10} | |
| OLD | NEW |