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 datetime | 8 import datetime |
9 import httplib | 9 import httplib |
10 import json | 10 import json |
11 import logging | 11 import logging |
12 import os | 12 import os |
13 import sys | 13 import sys |
14 import time | 14 import time |
15 | 15 |
16 file_dir = os.path.dirname(__file__) | 16 file_dir = os.path.dirname(__file__) |
17 sys.path.append(os.path.join(file_dir, '..', '..', 'perf')) | 17 sys.path.append(os.path.join(file_dir, '..', '..', 'perf')) |
18 from chrome_telemetry_build import chromium_config | 18 from core import path_util |
19 sys.path.append(chromium_config.GetTelemetryDir()) | 19 sys.path.append(path_util.GetTelemetryDir()) |
20 | 20 |
21 from telemetry.internal.backends.chrome_inspector import inspector_websocket | 21 from telemetry.internal.backends.chrome_inspector import inspector_websocket |
22 from telemetry.internal.backends.chrome_inspector import websocket | 22 from telemetry.internal.backends.chrome_inspector import websocket |
23 | 23 |
24 import common_util | 24 import common_util |
25 | 25 |
26 | 26 |
27 DEFAULT_TIMEOUT_SECONDS = 10 | 27 DEFAULT_TIMEOUT_SECONDS = 10 |
28 | 28 |
29 _WEBSOCKET_TIMEOUT_SECONDS = 10 | 29 _WEBSOCKET_TIMEOUT_SECONDS = 10 |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 json_data: (dict) Parsed from a JSON file using the json module. | 485 json_data: (dict) Parsed from a JSON file using the json module. |
486 | 486 |
487 Returns: | 487 Returns: |
488 a Track instance. | 488 a Track instance. |
489 """ | 489 """ |
490 # There is no sensible way to deserialize this abstract class, but | 490 # There is no sensible way to deserialize this abstract class, but |
491 # subclasses are not required to define a deserialization method. For | 491 # subclasses are not required to define a deserialization method. For |
492 # example, for testing we have a FakeRequestTrack which is never | 492 # example, for testing we have a FakeRequestTrack which is never |
493 # deserialized; instead fake instances are deserialized as RequestTracks. | 493 # deserialized; instead fake instances are deserialized as RequestTracks. |
494 assert False | 494 assert False |
OLD | NEW |