| OLD | NEW |
| 1 # Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2016 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 """Library handling DevTools websocket interaction. | 5 """Library handling DevTools websocket interaction. |
| 6 """ | 6 """ |
| 7 | 7 |
| 8 import httplib | 8 import httplib |
| 9 import json | 9 import json |
| 10 import logging | 10 import logging |
| 11 import os | 11 import os |
| 12 import sys | 12 import sys |
| 13 | 13 |
| 14 file_dir = os.path.dirname(__file__) | 14 file_dir = os.path.dirname(__file__) |
| 15 sys.path.append(os.path.join(file_dir, '..', '..', 'telemetry')) | 15 sys.path.append(os.path.join(file_dir, '..', '..', 'perf')) |
| 16 from chrome_telemetry_build import chromium_config |
| 17 sys.path.append(chromium_config.GetTelemetryDir()) |
| 16 | 18 |
| 17 from telemetry.internal.backends.chrome_inspector import inspector_websocket | 19 from telemetry.internal.backends.chrome_inspector import inspector_websocket |
| 18 from telemetry.internal.backends.chrome_inspector import websocket | 20 from telemetry.internal.backends.chrome_inspector import websocket |
| 19 | 21 |
| 20 | 22 |
| 21 class DevToolsConnectionException(Exception): | 23 class DevToolsConnectionException(Exception): |
| 22 def __init__(self, message): | 24 def __init__(self, message): |
| 23 super(DevToolsConnectionException, self).__init__(message) | 25 super(DevToolsConnectionException, self).__init__(message) |
| 24 logging.warning("DevToolsConnectionException: " + message) | 26 logging.warning("DevToolsConnectionException: " + message) |
| 25 | 27 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 event: (dict) complete event. | 168 event: (dict) complete event. |
| 167 """ | 169 """ |
| 168 pass | 170 pass |
| 169 | 171 |
| 170 | 172 |
| 171 class Track(Listener): | 173 class Track(Listener): |
| 172 """Collects data from a DevTools server.""" | 174 """Collects data from a DevTools server.""" |
| 173 def GetEvents(self): | 175 def GetEvents(self): |
| 174 """Returns a list of collected events, finalizing the state if necessary.""" | 176 """Returns a list of collected events, finalizing the state if necessary.""" |
| 175 pass | 177 pass |
| OLD | NEW |