1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 class NetworkController(object):
6 """Control network settings and servers to simulate the Web.
8 Network changes include forwarding device ports to host platform ports.
9 Web Page Replay is used to record and replay HTTP/HTTPS responses.
12 def __init__(self, network_controller_backend):
13 self._network_controller_backend = network_controller_backend
15 def SetReplayArgs(self, archive_path, wpr_mode, netsim, extra_wpr_args,
16 make_javascript_deterministic=False):
17 """Save the arguments needed for replay."""
18 self._network_controller_backend.SetReplayArgs(
19 archive_path, wpr_mode, netsim, extra_wpr_args,
20 make_javascript_deterministic)
22 def UpdateReplayForExistingBrowser(self):
23 """Restart replay if needed for an existing browser.
25 TODO(slamm): Drop this method when the browser_backend dependencies are
26 moved to the platform. https://crbug.com/423962
28 self._network_controller_backend.UpdateReplay()