Index: tools/telemetry/telemetry/core/backends/chrome/ios_browser_finder.py |
diff --git a/tools/telemetry/telemetry/core/backends/chrome/ios_browser_finder.py b/tools/telemetry/telemetry/core/backends/chrome/ios_browser_finder.py |
index f65f09bf81619be7b67d579a1e9193c2e4192545..327f2afde82a17ce08f399ff525c6cbf3ebe3a13 100644 |
--- a/tools/telemetry/telemetry/core/backends/chrome/ios_browser_finder.py |
+++ b/tools/telemetry/telemetry/core/backends/chrome/ios_browser_finder.py |
@@ -70,7 +70,7 @@ def FindAllBrowserTypes(_): |
def _IsIosDeviceAttached(): |
devices = subprocess.check_output('system_profiler SPUSBDataType', shell=True) |
for line in devices.split('\n'): |
- if line and re.match('\s*(iPod|iPhone|iPad):', line): |
+ if line and re.match(r'\s*(iPod|iPhone|iPad):', line): |
return True |
return False |
@@ -86,8 +86,8 @@ def FindAllAvailableBrowsers(finder_options): |
options = finder_options.browser_options |
options.browser_type = 'ios-chrome' |
- backend = ios_browser_backend.IosBrowserBackend(options) |
host = platform.GetHostPlatform() |
+ backend = ios_browser_backend.IosBrowserBackend(host, options) |
# TODO(baxley): Use idevice to wake up device or log debug statement. |
if not host.IsApplicationRunning(IOS_WEBKIT_DEBUG_PROXY): |
host.LaunchApplication(IOS_WEBKIT_DEBUG_PROXY) |
@@ -103,11 +103,11 @@ def FindAllAvailableBrowsers(finder_options): |
debug_urls = backend.GetWebSocketDebuggerUrls(device_urls) |
# Get the userAgent for each UIWebView to find the browsers. |
- browser_pattern = ('\)\s(%s)\/(\d+[\.\d]*)\sMobile' |
+ browser_pattern = (r'\)\s(%s)\/(\d+[\.\d]*)\sMobile' |
% '|'.join(IOS_BROWSERS.keys())) |
browser_types = set() |
for url in debug_urls: |
- context = {'webSocketDebuggerUrl':url , 'id':1} |
+ context = {'webSocketDebuggerUrl': url, 'id': 1} |
inspector = inspector_backend.InspectorBackend(backend, context) |
res = inspector.EvaluateJavaScript("navigator.userAgent") |
match_browsers = re.search(browser_pattern, res) |