Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Unified Diff: tools/telemetry/telemetry/core/dirty_profile_creator.py

Issue 14359012: Telemetry: Add option to create a dirty profile as part of a test run (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Whitespace fixes Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698