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

Side by Side Diff: telemetry/telemetry/internal/backends/chrome/desktop_browser_backend.py

Issue 2993363002: Re-create devtools client upon browser restart (Closed)
Patch Set: Created 3 years, 4 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
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import datetime 5 import datetime
6 import glob 6 import glob
7 import heapq 7 import heapq
8 import logging 8 import logging
9 import os 9 import os
10 import os.path 10 import os.path
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 self._proc = subprocess.Popen(args, env=env) 314 self._proc = subprocess.Popen(args, env=env)
315 315
316 try: 316 try:
317 self._WaitForBrowserToComeUp() 317 self._WaitForBrowserToComeUp()
318 # browser is foregrounded by default on Windows and Linux, but not Mac. 318 # browser is foregrounded by default on Windows and Linux, but not Mac.
319 if self.browser.platform.GetOSName() == 'mac': 319 if self.browser.platform.GetOSName() == 'mac':
320 subprocess.Popen([ 320 subprocess.Popen([
321 'osascript', '-e', 321 'osascript', '-e',
322 ('tell application "%s" to activate' % self._executable) 322 ('tell application "%s" to activate' % self._executable)
323 ]) 323 ])
324 self._InitDevtoolsClientBackend()
325 if self._supports_extensions: 324 if self._supports_extensions:
326 self._WaitForExtensionsToLoad() 325 self._WaitForExtensionsToLoad()
327 except: 326 except:
328 self.Close() 327 self.Close()
329 raise 328 raise
330 329
331 @property 330 @property
332 def pid(self): 331 def pid(self):
333 if self._proc: 332 if self._proc:
334 return self._proc.pid 333 return self._proc.pid
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 shutil.rmtree(self._tmp_profile_dir, ignore_errors=True) 656 shutil.rmtree(self._tmp_profile_dir, ignore_errors=True)
658 self._tmp_profile_dir = None 657 self._tmp_profile_dir = None
659 658
660 if self._tmp_output_file: 659 if self._tmp_output_file:
661 self._tmp_output_file.close() 660 self._tmp_output_file.close()
662 self._tmp_output_file = None 661 self._tmp_output_file = None
663 662
664 if self._tmp_minidump_dir: 663 if self._tmp_minidump_dir:
665 shutil.rmtree(self._tmp_minidump_dir, ignore_errors=True) 664 shutil.rmtree(self._tmp_minidump_dir, ignore_errors=True)
666 self._tmp_minidump_dir = None 665 self._tmp_minidump_dir = None
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698