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.
7 from profile_creators
import extension_profile_extender
8 from profile_creators
import profile_generator
9 from telemetry
.page
import shared_page_state
12 class ExtensionProfileSharedState(shared_page_state
.SharedPageState
):
13 """Shared state tied with extension profile.
15 Generates extension profile on initialization.
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
,
24 self
._out
_dir
= generator
.Run(finder_options
)
26 finder_options
.browser_options
.profile_dir
= self
._out
_dir
28 finder_options
.browser_options
.dont_override_profile
= True
30 def TearDownState(self
):
31 """Clean up generated profile directory."""
32 super(ExtensionProfileSharedState
, self
).TearDownState()
34 shutil
.rmtree(self
._out
_dir
)