clean up Browser dirs and add flags_location

This commit is contained in:
Barbara Miller 2016-09-29 20:58:10 -07:00
parent a8430baf1b
commit 016367bc46

View File

@ -137,9 +137,10 @@ class Browser:
# these can raise exceptions
self.chrome_port = self._find_available_port()
self._work_dir = tempfile.TemporaryDirectory()
data_dir = os.path.join(self._work_dir.name, "chrome-user-data")
flags_location = os.path.join(data_dir, "Local State")
if cookie_db is not None:
cookie_dir = os.path.join(
self._work_dir.name, "chrome-user-data", "Default")
cookie_dir = os.path.join(data_dir, "Default")
cookie_location = os.path.join(cookie_dir, "Cookies")
self.logger.debug(
"cookie DB provided, writing to %s", cookie_location)