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

Side by Side Diff: telemetry/telemetry/internal/util/ts_proxy_server_unittest.py

Issue 2346093002: [Telemetry] Add API for updating ts_proxy_server's traffic settings (Closed)
Patch Set: Rebase Created 4 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 unified diff | Download patch
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 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 import unittest 5 import unittest
6 6
7 from telemetry.internal.util import ts_proxy_server 7 from telemetry.internal.util import ts_proxy_server
8 8
9 class TsProxyServerTest(unittest.TestCase): 9 class TsProxyServerTest(unittest.TestCase):
10 def testParseTsProxyPort(self): 10 def testParseTsProxyPort(self):
(...skipping 14 matching lines...) Expand all
25 with ts_proxy_server.TsProxyServer() as server: 25 with ts_proxy_server.TsProxyServer() as server:
26 self.assertIsNotNone(server.port) 26 self.assertIsNotNone(server.port)
27 with ts_proxy_server.TsProxyServer(None, 37124, 37125) as server: 27 with ts_proxy_server.TsProxyServer(None, 37124, 37125) as server:
28 self.assertIsNotNone(server.port) 28 self.assertIsNotNone(server.port)
29 29
30 def testSmokeUpdatingOutboundPorts(self): 30 def testSmokeUpdatingOutboundPorts(self):
31 with ts_proxy_server.TsProxyServer() as server: 31 with ts_proxy_server.TsProxyServer() as server:
32 self.assertIsNotNone(server.port) 32 self.assertIsNotNone(server.port)
33 server.UpdateOutboundPorts(31242, 14220) 33 server.UpdateOutboundPorts(31242, 14220)
34 34
35 def testSmokeUpdatingOutboundPortsInvalid(self): 35 def testSmokeUpdateOutboundPortsInvalid(self):
36 with ts_proxy_server.TsProxyServer() as server: 36 with ts_proxy_server.TsProxyServer() as server:
37 self.assertIsNotNone(server.port) 37 self.assertIsNotNone(server.port)
38 with self.assertRaises(AssertionError): 38 with self.assertRaises(AssertionError):
39 server.UpdateOutboundPorts(31242, 'abcde') 39 server.UpdateOutboundPorts(31242, 'abcde')
40
41 def testSmokeUpdateTrafficSettings(self):
42 with ts_proxy_server.TsProxyServer() as server:
43 server.UpdateTrafficSettings(round_trip_latency_ms=100)
44 server.UpdateTrafficSettings(download_bandwidth_kbps=5000)
45 server.UpdateTrafficSettings(upload_bandwidth_kbps=2000)
46 server.UpdateTrafficSettings(
47 round_trip_latency_ms=200, download_bandwidth_kbps=500,
48 upload_bandwidth_kbps=2000)
OLDNEW
« no previous file with comments | « telemetry/telemetry/internal/util/ts_proxy_server.py ('k') | telemetry/telemetry/page/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698