OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 """Constrained network server (CNS) test base.""" | 5 """Constrained network server (CNS) test base.""" |
6 | 6 |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import Queue | 9 import Queue |
10 import subprocess | 10 import subprocess |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 # Path to CNS executable relative to source root. | 39 # Path to CNS executable relative to source root. |
40 _CNS_PATH = os.path.join( | 40 _CNS_PATH = os.path.join( |
41 'media', 'tools', 'constrained_network_server', 'cns.py') | 41 'media', 'tools', 'constrained_network_server', 'cns.py') |
42 | 42 |
43 # Port to start the CNS on. | 43 # Port to start the CNS on. |
44 _CNS_PORT = 9000 | 44 _CNS_PORT = 9000 |
45 | 45 |
46 # Base CNS URL, only requires & separated parameter names appended. | 46 # Base CNS URL, only requires & separated parameter names appended. |
47 if WINDOWS: | 47 if WINDOWS: |
48 CNS_BASE_URL = 'http://chromeperf34.chrome:%d/ServeConstrained?' % _CNS_PORT | 48 CNS_BASE_URL = 'http://chromeperf34:%d/ServeConstrained?' % _CNS_PORT |
49 else: | 49 else: |
50 CNS_BASE_URL = 'http://127.0.0.1:%d/ServeConstrained?' % _CNS_PORT | 50 CNS_BASE_URL = 'http://127.0.0.1:%d/ServeConstrained?' % _CNS_PORT |
51 | 51 |
52 # Used for server sanity check. | 52 # Used for server sanity check. |
53 _TEST_VIDEO = 'roller.webm' | 53 _TEST_VIDEO = 'roller.webm' |
54 | 54 |
55 # Directory root to serve files from. | 55 # Directory root to serve files from. |
56 _ROOT_PATH = os.path.join(pyauto.PyUITest.DataDir(), 'pyauto_private', 'media') | 56 _ROOT_PATH = os.path.join(pyauto.PyUITest.DataDir(), 'pyauto_private', 'media') |
57 | 57 |
58 | 58 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 """ | 182 """ |
183 # Convert relative test path into an absolute path. | 183 # Convert relative test path into an absolute path. |
184 tasks = Queue.Queue() | 184 tasks = Queue.Queue() |
185 for file_name in test_media_files: | 185 for file_name in test_media_files: |
186 for series_name, settings in network_constraints_settings: | 186 for series_name, settings in network_constraints_settings: |
187 logging.debug('Add test: %s\tSettings: %s\tMedia: %s', series_name, | 187 logging.debug('Add test: %s\tSettings: %s\tMedia: %s', series_name, |
188 settings, file_name) | 188 settings, file_name) |
189 tasks.put((series_name, settings, file_name)) | 189 tasks.put((series_name, settings, file_name)) |
190 | 190 |
191 return tasks | 191 return tasks |
OLD | NEW |