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.core 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. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 else: | 46 else: |
47 options.append('--record') | 47 options.append('--record') |
48 if not make_javascript_deterministic: | 48 if not make_javascript_deterministic: |
49 options.append('--inject_scripts=') | 49 options.append('--inject_scripts=') |
50 self._web_page_replay = webpagereplay.ReplayServer( | 50 self._web_page_replay = webpagereplay.ReplayServer( |
51 path, | 51 path, |
52 self._webpagereplay_host, | 52 self._webpagereplay_host, |
53 self._webpagereplay_local_http_port, | 53 self._webpagereplay_local_http_port, |
54 self._webpagereplay_local_https_port, | 54 self._webpagereplay_local_https_port, |
55 options) | 55 options) |
56 if browser_backend.webdriver_based: | |
nduca
2013/07/30 06:49:45
lets do this by constructing the options list firs
chrisgao (Use stgao instead)
2013/07/31 19:05:41
Good idea.
Done. But we need to override webpagere
| |
57 self._web_page_replay.replay_options.remove('--no-dns_forwarding') | |
56 self._web_page_replay.StartServer() | 58 self._web_page_replay.StartServer() |
57 | 59 |
58 def __enter__(self): | 60 def __enter__(self): |
59 return self | 61 return self |
60 | 62 |
61 def __exit__(self, *args): | 63 def __exit__(self, *args): |
62 self.Close() | 64 self.Close() |
63 | 65 |
64 def Close(self): | 66 def Close(self): |
65 if self._forwarder: | 67 if self._forwarder: |
66 self._forwarder.Close() | 68 self._forwarder.Close() |
67 self._forwarder = None | 69 self._forwarder = None |
68 if self._web_page_replay: | 70 if self._web_page_replay: |
69 self._web_page_replay.StopServer() | 71 self._web_page_replay.StopServer() |
70 self._web_page_replay = None | 72 self._web_page_replay = None |
OLD | NEW |