Chromium Code Reviews| Index: tools/telemetry/telemetry/core/dirty_profile_creator.py |
| diff --git a/tools/telemetry/telemetry/core/dirty_profile_creator.py b/tools/telemetry/telemetry/core/dirty_profile_creator.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..50b48c631ba9cc4fda9d71f6af8b0d9c85423734 |
| --- /dev/null |
| +++ b/tools/telemetry/telemetry/core/dirty_profile_creator.py |
| @@ -0,0 +1,27 @@ |
| +# Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +import logging |
| + |
| +from perf_tools import small_profile # pylint: disable=F0401 |
| + |
| +# Object that manages filling in dirty profiles. |
|
nduca
2013/04/26 20:09:36
maybe put this module in a subdir, profile_creator
|
| +class DirtyProfileCreator(object): |
| + def __init__(self, browser, options): |
| + self._browser = browser |
| + self._options = options |
| + |
| + def CreateDirtyProfile(self, profile_type): |
| + with self._browser as b: |
| + if profile_type == 'dirty_small': |
| + logging.info('Started creating a small dirty profile') |
| + profile_creator = small_profile.SmallProfile(b) |
| + else: |
| + raise Exception('Unsupported dirty profile type: %s' % profile_type) |
| + |
| + profile_creator.CreateProfile() |
| + |
| + logging.info("Dirty profile created succesfully in '%s'", |
| + self._browser.profile_directory) |
| + return self._browser.profile_directory |