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

Unified Diff: chrome/test/functional/media/cns_test_base.py

Issue 10825051: Update CNS to run on chromeperf34 and CNS tests to run on windows perf_av bot. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: +OWNERS file Created 8 years, 5 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 | « chrome/test/functional/media/OWNERS ('k') | chrome/test/functional/media/media_constrained_network_perf.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/functional/media/cns_test_base.py
diff --git a/chrome/test/functional/media/cns_test_base.py b/chrome/test/functional/media/cns_test_base.py
index bb48d54e918cc857f0a6b16bf1087b01ce32234a..b90932ce9f8abaa513ad5a875b2a5f4964f2777e 100644
--- a/chrome/test/functional/media/cns_test_base.py
+++ b/chrome/test/functional/media/cns_test_base.py
@@ -15,6 +15,8 @@ import urllib2
import pyauto
import pyauto_paths
+WINDOWS = 'win32' in sys.platform
+
# List of commonly used network constraints settings.
# Each setting is a tuppe of the form:
# ('TEST_NAME', [BANDWIDTH_Kbps, LATENCY_ms, PACKET_LOSS_%])
@@ -42,7 +44,10 @@ _CNS_PATH = os.path.join(
_CNS_PORT = 9000
# Base CNS URL, only requires & separated parameter names appended.
-CNS_BASE_URL = 'http://127.0.0.1:%d/ServeConstrained?' % _CNS_PORT
+if WINDOWS:
+ CNS_BASE_URL = 'http://chromeperf34.chrome:%d/ServeConstrained?' % _CNS_PORT
+else:
+ CNS_BASE_URL = 'http://127.0.0.1:%d/ServeConstrained?' % _CNS_PORT
# Used for server sanity check.
_TEST_VIDEO = 'roller.webm'
@@ -69,7 +74,22 @@ class CNSTestBase(pyauto.PyUITest):
pyauto.PyUITest.__init__(self, *args, **kwargs)
def setUp(self):
- """Starts the Constrained Network Server (CNS)."""
+ """Ensures the Constrained Network Server (CNS) server is up and running."""
+ if WINDOWS:
+ self._SetUpWin()
+ else:
+ self._SetUpLinux()
+
+ def _SetUpWin(self):
+ """Ensures the test can connect to the external CNS server."""
+ if self.WaitUntil(self._CanAccessServer, retry_sleep=3, timeout=30,
+ debug=False):
+ pyauto.PyUITest.setUp(self)
+ else:
+ self.fail('Failed to connect to CNS.')
+
+ def _SetUpLinux(self):
+ """Starts the CNS server locally."""
cmd = [sys.executable, os.path.join(pyauto_paths.GetSourceDir(), _CNS_PATH),
'--port', str(self._port),
'--interface', self._interface,
@@ -103,13 +123,14 @@ class CNSTestBase(pyauto.PyUITest):
def tearDown(self):
"""Stops the Constrained Network Server (CNS)."""
pyauto.PyUITest.tearDown(self)
- logging.debug('Stopping CNS server.')
- # Do not use process.kill(), it will not clean up cns.
- self.Kill(self._cns_process.pid)
- # Need to wait since the process logger has a lock on the process stderr.
- self._cns_process.wait()
- self.assertFalse(self._cns_process.returncode is None)
- logging.debug('CNS server stopped.')
+ if not WINDOWS:
+ logging.debug('Stopping CNS server.')
+ # Do not use process.kill(), it will not clean up cns.
+ self.Kill(self._cns_process.pid)
+ # Need to wait since the process logger has a lock on the process stderr.
+ self._cns_process.wait()
+ self.assertFalse(self._cns_process.returncode is None)
+ logging.debug('CNS server stopped.')
class ProcessLogger(threading.Thread):
« no previous file with comments | « chrome/test/functional/media/OWNERS ('k') | chrome/test/functional/media/media_constrained_network_perf.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698