Chromium Code Reviews| Index: tools/perf/benchmarks/session_restore.py |
| diff --git a/tools/perf/benchmarks/session_restore.py b/tools/perf/benchmarks/session_restore.py |
| index a5f2a8ca90bf3bb034dc442665d75c2b9dbaca16..919a3a12782c1e101cb02ffc9c318fdb1f330e15 100644 |
| --- a/tools/perf/benchmarks/session_restore.py |
| +++ b/tools/perf/benchmarks/session_restore.py |
| @@ -2,13 +2,37 @@ |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| +import os |
| +import tempfile |
| + |
| from measurements import session_restore |
| +from measurements import session_restore_with_url |
| +from profile_creators import small_profile_creator |
| from telemetry import test |
| +from telemetry.page import profile_generator |
| + |
| + |
| +class _SessionRestoreTest(test.Test): |
|
jeremy
2014/06/05 10:47:26
I worry that a mistake in the bot config could mak
|
| + |
| + @classmethod |
| + def ProcessCommandLineArgs(cls, parser, args): |
| + super(_SessionRestoreTest, cls).ProcessCommandLineArgs(parser, args) |
| + profile_type = 'small_profile' |
| + if not args.browser_options.profile_dir: |
| + profile_dir = os.path.join(tempfile.gettempdir(), profile_type) |
| + if not os.path.exists(profile_dir): |
| + os.makedirs(profile_dir) |
| + new_args = args.Copy() |
| + new_args.pageset_repeat = 1 |
| + new_args.output_dir = tempfile.gettempdir() |
| + profile_generator.GenerateProfiles( |
| + small_profile_creator.SmallProfileCreator, profile_type, new_args) |
| + args.browser_options.profile_dir = profile_dir |
| # crbug.com/325479: Disabling this test for now since it never ran before. |
| @test.Disabled('android', 'linux') |
| -class SessionRestoreColdTypical25(test.Test): |
| +class SessionRestoreColdTypical25(_SessionRestoreTest): |
| tag = 'cold' |
| test = session_restore.SessionRestore |
| page_set = 'page_sets/typical_25.py' |
| @@ -16,9 +40,27 @@ class SessionRestoreColdTypical25(test.Test): |
| 'pageset_repeat': 5} |
| -class SessionRestoreWarmTypical25(test.Test): |
| +class SessionRestoreWarmTypical25(_SessionRestoreTest): |
| tag = 'warm' |
| test = session_restore.SessionRestore |
| page_set = 'page_sets/typical_25.py' |
| options = {'warm': True, |
| 'pageset_repeat': 20} |
| + |
| + |
| +class SessionRestoreWithUrlCold(_SessionRestoreTest): |
| + """Measure Chrome cold session restore with startup URLs.""" |
| + tag = 'cold' |
| + test = session_restore_with_url.SessionRestoreWithUrl |
| + page_set = 'page_sets/startup_pages.py' |
| + options = {'cold': True, |
| + 'pageset_repeat': 5} |
| + |
| + |
| +class SessionRestoreWithUrlWarm(_SessionRestoreTest): |
| + """Measure Chrome warm session restore with startup URLs.""" |
| + tag = 'warm' |
| + test = session_restore_with_url.SessionRestoreWithUrl |
| + page_set = 'page_sets/startup_pages.py' |
| + options = {'warm': True, |
| + 'pageset_repeat': 10} |