Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: tools/telemetry/telemetry/core/platform/network_controller.py

Issue 656303003: Telemetry: Move Web Page Replay to the platform. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update --use-live-sites tests to not use private browser property. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/telemetry/telemetry/core/platform/network_controller.py
diff --git a/tools/telemetry/telemetry/core/platform/network_controller.py b/tools/telemetry/telemetry/core/platform/network_controller.py
new file mode 100644
index 0000000000000000000000000000000000000000..19826c3f395ed72fa3dfca92c45331cee47049bd
--- /dev/null
+++ b/tools/telemetry/telemetry/core/platform/network_controller.py
@@ -0,0 +1,28 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+class NetworkController(object):
+ """Control network settings and servers to simulate the Web.
+
+ Network changes include forwarding device ports to host platform ports.
+ Web Page Replay is used to record and replay HTTP/HTTPS responses.
+ """
+
+ def __init__(self, network_controller_backend):
+ self._network_controller_backend = network_controller_backend
+
+ def SetReplayArgs(self, archive_path, wpr_mode, netsim, extra_wpr_args,
+ make_javascript_deterministic=False):
+ """Save the arguments needed for replay."""
+ self._network_controller_backend.SetReplayArgs(
+ archive_path, wpr_mode, netsim, extra_wpr_args,
+ make_javascript_deterministic)
+
+ def UpdateReplayForExistingBrowser(self):
+ """Restart replay if needed for an existing browser.
+
+ TODO(slamm): Drop this method when the browser_backend dependencies are
+ moved to the platform. https://crbug.com/423962
+ """
+ self._network_controller_backend.UpdateReplay()

Powered by Google App Engine
This is Rietveld 408576698