| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 """Handles generating profiles and transferring them to/from mobile devices.""" | 5 """Handles generating profiles and transferring them to/from mobile devices.""" |
| 6 | 6 |
| 7 import logging | 7 import logging |
| 8 import optparse | 8 import optparse |
| 9 import os | 9 import os |
| 10 import shutil | 10 import shutil |
| 11 import stat | 11 import stat |
| 12 import sys | 12 import sys |
| 13 import tempfile | 13 import tempfile |
| 14 | 14 |
| 15 from telemetry import benchmark | 15 from profile_creators import profile_creator |
| 16 from telemetry.core import browser_options | 16 from telemetry.core import browser_options |
| 17 from telemetry.core import discover | 17 from telemetry.core import discover |
| 18 from telemetry.core import util | 18 from telemetry.core import util |
| 19 from telemetry.page import profile_creator | |
| 20 from telemetry.page import test_expectations | |
| 21 from telemetry.results import results_options | |
| 22 from telemetry.user_story import user_story_runner | 19 from telemetry.user_story import user_story_runner |
| 23 | 20 |
| 24 | 21 |
| 25 def _DiscoverProfileCreatorClasses(): | 22 def _DiscoverProfileCreatorClasses(): |
| 26 profile_creators_dir = os.path.abspath(os.path.join(util.GetBaseDir(), | 23 profile_creators_dir = os.path.abspath(os.path.join(util.GetBaseDir(), |
| 27 os.pardir, 'perf', 'profile_creators')) | 24 os.pardir, 'perf', 'profile_creators')) |
| 28 base_dir = os.path.abspath(os.path.join(profile_creators_dir, os.pardir)) | 25 base_dir = os.path.abspath(os.path.join(profile_creators_dir, os.pardir)) |
| 29 | 26 |
| 30 profile_creators_unfiltered = discover.DiscoverClasses( | 27 profile_creators_unfiltered = discover.DiscoverClasses( |
| 31 profile_creators_dir, base_dir, profile_creator.ProfileCreator) | 28 profile_creators_dir, base_dir, profile_creator.ProfileCreator) |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 "%%prog <--profile-type-to-generate=...> <--browser=...> <--output-dir>") | 135 "%%prog <--profile-type-to-generate=...> <--browser=...> <--output-dir>") |
| 139 AddCommandLineArgs(parser) | 136 AddCommandLineArgs(parser) |
| 140 _, _ = parser.parse_args() | 137 _, _ = parser.parse_args() |
| 141 ProcessCommandLineArgs(parser, options) | 138 ProcessCommandLineArgs(parser, options) |
| 142 | 139 |
| 143 # Generate profile. | 140 # Generate profile. |
| 144 profile_creators = _DiscoverProfileCreatorClasses() | 141 profile_creators = _DiscoverProfileCreatorClasses() |
| 145 profile_creator_class = profile_creators[options.profile_type_to_generate] | 142 profile_creator_class = profile_creators[options.profile_type_to_generate] |
| 146 return GenerateProfiles(profile_creator_class, | 143 return GenerateProfiles(profile_creator_class, |
| 147 options.profile_type_to_generate, options) | 144 options.profile_type_to_generate, options) |
| OLD | NEW |