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

Unified Diff: tools/telemetry/telemetry/core/webpagereplay_unittest.py

Issue 617043003: Handle replay args within replay module. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@combinewpr-localremote-ports
Patch Set: Rebase. 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
« no previous file with comments | « tools/telemetry/telemetry/core/webpagereplay.py ('k') | tools/telemetry/telemetry/core/wpr_server.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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([])
« no previous file with comments | « tools/telemetry/telemetry/core/webpagereplay.py ('k') | tools/telemetry/telemetry/core/wpr_server.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698