Index: tools/telemetry/telemetry/core/webpagereplay_unittest.py |
diff --git a/tools/telemetry/telemetry/core/webpagereplay_unittest.py b/tools/telemetry/telemetry/core/webpagereplay_unittest.py |
index 11303d51db39be0549a995876165df3443ffc11c..1309fc4cc557b23e809a5291f51e3ad7ea4d4b86 100644 |
--- a/tools/telemetry/telemetry/core/webpagereplay_unittest.py |
+++ b/tools/telemetry/telemetry/core/webpagereplay_unittest.py |
@@ -2,12 +2,34 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
+import sys |
import unittest |
from telemetry.core import webpagereplay |
# pylint: disable=W0212 |
+class CreateCommandTest(unittest.TestCase): |
+ def testHasDnsGivesDnsPort(self): |
+ expected_cmd_line = [ |
+ sys.executable, 'replay.py', '--host=127.0.0.1', |
+ '--port=2', '--ssl_port=1', '--dns_port=0', |
+ '--use_closest_match', '--log_level=warning', '--extra_arg', 'foo.wpr'] |
+ cmd_line = webpagereplay.ReplayServer._GetCommandLine( |
+ 'replay.py', '127.0.0.1', 2, 1, 0, ['--extra_arg'], 'foo.wpr') |
+ self.assertEqual(expected_cmd_line, cmd_line) |
+ |
+ def testNoDnsGivesNoDnsForwarding(self): |
+ expected_cmd_line = [ |
+ sys.executable, 'replay.py', '--host=127.0.0.1', |
+ '--port=8080', '--ssl_port=8443', '--no-dns_forwarding', |
+ '--use_closest_match', '--log_level=warning', 'bar.wpr'] |
+ cmd_line = webpagereplay.ReplayServer._GetCommandLine( |
+ 'replay.py', '127.0.0.1', 8080, 8443, None, [], 'bar.wpr') |
+ self.assertEqual(expected_cmd_line, cmd_line) |
+ |
+ |
+# pylint: disable=W0212 |
class ParseLogFilePortsTest(unittest.TestCase): |
def testEmptyLinesGivesEmptyDict(self): |
log_lines = iter([]) |