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

Side by Side Diff: tools/perf/page_sets/extension_profile_shared_state.py

Issue 1240703003: Extension profile generator + benchmark for startup with profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed redundant code in extensions_profile_extender.py Created 5 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import shutil
6
7 from profile_creators import extension_profile_extender
8 from profile_creators import profile_generator
9 from telemetry.page import shared_page_state
10
11
12 class ExtensionProfileSharedState(shared_page_state.SharedPageState):
13 """Shared state tied with extension profile.
14
15 Generates extension profile on initialization.
16 """
17
18 def __init__(self, test, finder_options, story_set):
19 super(ExtensionProfileSharedState, self).__init__(
20 test, finder_options, story_set)
21 generator = profile_generator.ProfileGenerator(
22 extension_profile_extender.ExtensionProfileExtender,
23 'extension_profile')
24 self._out_dir = generator.Run(finder_options)
25 if self._out_dir:
26 finder_options.browser_options.profile_dir = self._out_dir
27 else:
28 finder_options.browser_options.dont_override_profile = True
29
30 def TearDownState(self):
31 """Clean up generated profile directory."""
32 super(ExtensionProfileSharedState, self).TearDownState()
33 if self._out_dir:
34 shutil.rmtree(self._out_dir)
OLDNEW
« no previous file with comments | « tools/perf/page_sets/blank_page_with_extension_profile.py ('k') | tools/perf/profile_creators/extension_profile_extender.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698