OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 import os | 4 import os |
5 import sys | 5 import sys |
6 | 6 |
7 from telemetry import util | 7 from telemetry.core import util |
8 | 8 |
9 # Get chrome/test/functional scripts into our path. | 9 # Get chrome/test/functional scripts into our path. |
10 # TODO(tonyg): Move webpagereplay.py to a common location. | 10 # TODO(tonyg): Move webpagereplay.py to a common location. |
11 sys.path.append( | 11 sys.path.append( |
12 os.path.abspath( | 12 os.path.abspath( |
13 os.path.join(os.path.dirname(__file__), | 13 os.path.join(os.path.dirname(__file__), |
14 '../../../chrome/test/functional'))) | 14 '../../../../chrome/test/functional'))) |
15 import webpagereplay # pylint: disable=F0401 | 15 import webpagereplay # pylint: disable=F0401 |
16 | 16 |
17 def GetChromeFlags(replay_host, http_port, https_port): | 17 def GetChromeFlags(replay_host, http_port, https_port): |
18 return webpagereplay.GetChromeFlags(replay_host, http_port, https_port) | 18 return webpagereplay.GetChromeFlags(replay_host, http_port, https_port) |
19 | 19 |
20 class ReplayServer(object): | 20 class ReplayServer(object): |
21 def __init__(self, browser_backend, path, is_record_mode, webpagereplay_host, | 21 def __init__(self, browser_backend, path, is_record_mode, webpagereplay_host, |
22 webpagereplay_local_http_port, webpagereplay_local_https_port, | 22 webpagereplay_local_http_port, webpagereplay_local_https_port, |
23 webpagereplay_remote_http_port, webpagereplay_remote_https_port): | 23 webpagereplay_remote_http_port, webpagereplay_remote_https_port): |
24 self._browser_backend = browser_backend | 24 self._browser_backend = browser_backend |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 def __exit__(self, *args): | 56 def __exit__(self, *args): |
57 self.Close() | 57 self.Close() |
58 | 58 |
59 def Close(self): | 59 def Close(self): |
60 if self._forwarder: | 60 if self._forwarder: |
61 self._forwarder.Close() | 61 self._forwarder.Close() |
62 self._forwarder = None | 62 self._forwarder = None |
63 if self._web_page_replay: | 63 if self._web_page_replay: |
64 self._web_page_replay.StopServer() | 64 self._web_page_replay.StopServer() |
65 self._web_page_replay = None | 65 self._web_page_replay = None |
OLD | NEW |