OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 datetime | 5 import datetime |
6 import logging | 6 import logging |
7 import os | 7 import os |
8 | 8 |
9 from integration_tests import network_metrics | 9 from integration_tests import network_metrics |
10 from telemetry.page import page_measurement | 10 from telemetry.page import page_test |
11 from telemetry.value import scalar | 11 from telemetry.value import scalar |
12 | 12 |
13 | 13 |
14 class ChromeProxyMetricException(page_measurement.MeasurementFailure): | 14 class ChromeProxyMetricException(page_test.MeasurementFailure): |
15 pass | 15 pass |
16 | 16 |
17 | 17 |
18 CHROME_PROXY_VIA_HEADER = 'Chrome-Compression-Proxy' | 18 CHROME_PROXY_VIA_HEADER = 'Chrome-Compression-Proxy' |
19 CHROME_PROXY_VIA_HEADER_DEPRECATED = '1.1 Chrome Compression Proxy' | 19 CHROME_PROXY_VIA_HEADER_DEPRECATED = '1.1 Chrome Compression Proxy' |
20 | 20 |
21 PROXY_SETTING_HTTPS = 'proxy.googlezip.net:443' | 21 PROXY_SETTING_HTTPS = 'proxy.googlezip.net:443' |
22 PROXY_SETTING_HTTPS_WITH_SCHEME = 'https://' + PROXY_SETTING_HTTPS | 22 PROXY_SETTING_HTTPS_WITH_SCHEME = 'https://' + PROXY_SETTING_HTTPS |
23 PROXY_SETTING_HTTP = 'compress.googlezip.net:80' | 23 PROXY_SETTING_HTTP = 'compress.googlezip.net:80' |
24 PROXY_SETTING_DIRECT = 'direct://' | 24 PROXY_SETTING_DIRECT = 'direct://' |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 bad_proxies = [] | 264 bad_proxies = [] |
265 if 'badProxies' in info and info['badProxies']: | 265 if 'badProxies' in info and info['badProxies']: |
266 bad_proxies = [p['proxy'] for p in info['badProxies'] | 266 bad_proxies = [p['proxy'] for p in info['badProxies'] |
267 if 'proxy' in p and p['proxy']] | 267 if 'proxy' in p and p['proxy']] |
268 if bad_proxies != expected_bad_proxies: | 268 if bad_proxies != expected_bad_proxies: |
269 raise ChromeProxyMetricException, ( | 269 raise ChromeProxyMetricException, ( |
270 'Wrong bad proxies (%s). Expect: "%s"' % ( | 270 'Wrong bad proxies (%s). Expect: "%s"' % ( |
271 str(bad_proxies), str(expected_bad_proxies))) | 271 str(bad_proxies), str(expected_bad_proxies))) |
272 results.AddValue(scalar.ScalarValue( | 272 results.AddValue(scalar.ScalarValue( |
273 results.current_page, 'http_fallback', 'boolean', True)) | 273 results.current_page, 'http_fallback', 'boolean', True)) |
OLD | NEW |