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

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

Issue 1586143003: Enable crash symbols unit test for Mac OSX. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Only import fcntl when needed Created 4 years, 11 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
« no previous file with comments | « tools/perf/core/stacktrace_unittest.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 28 matching lines...) Expand all
39 if os_name == 'mac': 39 if os_name == 'mac':
40 version_dir = os.path.join(os.path.dirname(executable), 40 version_dir = os.path.join(os.path.dirname(executable),
41 '..', 41 '..',
42 'Versions') 42 'Versions')
43 for version_num in os.listdir(version_dir): 43 for version_num in os.listdir(version_dir):
44 framework_file = os.path.join(version_dir, 44 framework_file = os.path.join(version_dir,
45 version_num, 45 version_num,
46 'Chromium Framework.framework', 46 'Chromium Framework.framework',
47 'Chromium Framework') 47 'Chromium Framework')
48 if os.path.isfile(framework_file): 48 if os.path.isfile(framework_file):
49 return framework_file 49 # Sometimes dyld returns symbols for a different file. Emulate what it
50 # does here by using the same mechanism to find the binary file.
51 import fcntl
52 F_GETPATH = 50
53 with open(framework_file, 'rb') as f:
54 return fcntl.fcntl(f.fileno(), F_GETPATH, b'\0' * 1024).rstrip(b'\0')
50 55
51 return executable 56 return executable
52 57
53 58
54 class DesktopBrowserBackend(chrome_browser_backend.ChromeBrowserBackend): 59 class DesktopBrowserBackend(chrome_browser_backend.ChromeBrowserBackend):
55 """The backend for controlling a locally-executed browser instance, on Linux, 60 """The backend for controlling a locally-executed browser instance, on Linux,
56 Mac or Windows. 61 Mac or Windows.
57 """ 62 """
58 def __init__(self, desktop_platform_backend, browser_options, executable, 63 def __init__(self, desktop_platform_backend, browser_options, executable,
59 flash_path, is_content_shell, browser_directory, 64 flash_path, is_content_shell, browser_directory,
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 self._tmp_profile_dir) 566 self._tmp_profile_dir)
562 else: 567 else:
563 # If we don't need the profile after the run then cleanup. 568 # If we don't need the profile after the run then cleanup.
564 if self._tmp_profile_dir and os.path.exists(self._tmp_profile_dir): 569 if self._tmp_profile_dir and os.path.exists(self._tmp_profile_dir):
565 shutil.rmtree(self._tmp_profile_dir, ignore_errors=True) 570 shutil.rmtree(self._tmp_profile_dir, ignore_errors=True)
566 self._tmp_profile_dir = None 571 self._tmp_profile_dir = None
567 572
568 if self._tmp_output_file: 573 if self._tmp_output_file:
569 self._tmp_output_file.close() 574 self._tmp_output_file.close()
570 self._tmp_output_file = None 575 self._tmp_output_file = None
OLDNEW
« no previous file with comments | « tools/perf/core/stacktrace_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698