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 base64 | 5 import base64 |
6 import logging | 6 import logging |
7 import urlparse | 7 import urlparse |
8 | 8 |
9 from integration_tests import chrome_proxy_metrics as metrics | 9 from integration_tests import chrome_proxy_metrics as metrics |
10 from metrics import loading | 10 from metrics import loading |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 # Attempt to load a page through the nonexistent primary proxy in order to | 303 # Attempt to load a page through the nonexistent primary proxy in order to |
304 # cause a proxy fallback, and have this test run starting from the HTTP | 304 # cause a proxy fallback, and have this test run starting from the HTTP |
305 # fallback proxy. | 305 # fallback proxy. |
306 tab.Navigate(_TEST_SERVER_DEFAULT_URL) | 306 tab.Navigate(_TEST_SERVER_DEFAULT_URL) |
307 tab.WaitForJavaScriptExpression('performance.timing.loadEventStart', 300) | 307 tab.WaitForJavaScriptExpression('performance.timing.loadEventStart', 300) |
308 | 308 |
309 proxies = [ | 309 proxies = [ |
310 'nonexistent.googlezip.net:80', | 310 'nonexistent.googlezip.net:80', |
311 self._metrics.effective_proxies['fallback'], | 311 self._metrics.effective_proxies['fallback'], |
312 self._metrics.effective_proxies['direct']] | 312 self._metrics.effective_proxies['direct']] |
| 313 # TODO(sclittle): Remove this dependency on net-internals#proxy once an |
| 314 # alternative method of verifying that Chrome is on the fallback proxy |
| 315 # exists. |
313 self._metrics.VerifyProxyInfo(tab, proxies, proxies[:1]) | 316 self._metrics.VerifyProxyInfo(tab, proxies, proxies[:1]) |
314 | 317 |
315 def AddResults(self, tab, results): | 318 def AddResults(self, tab, results): |
316 self._metrics.AddResultsForHTTPToDirectFallback(tab, results) | 319 self._metrics.AddResultsForHTTPToDirectFallback(tab, results) |
317 | 320 |
318 | 321 |
319 class ChromeProxyExplicitBypass(ChromeProxyValidation): | 322 class ChromeProxyExplicitBypass(ChromeProxyValidation): |
320 """Correctness measurement for explicit proxy bypasses. | 323 """Correctness measurement for explicit proxy bypasses. |
321 | 324 |
322 In this test, the configured proxy is the chromeproxy-test server which | 325 In this test, the configured proxy is the chromeproxy-test server which |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 ], | 391 ], |
389 'bypass': [self._metrics.AddResultsForBypass], | 392 'bypass': [self._metrics.AddResultsForBypass], |
390 'safebrowsing': [self._metrics.AddResultsForSafebrowsing], | 393 'safebrowsing': [self._metrics.AddResultsForSafebrowsing], |
391 } | 394 } |
392 if not self._page.name in page_to_metrics: | 395 if not self._page.name in page_to_metrics: |
393 raise page_test.MeasurementFailure( | 396 raise page_test.MeasurementFailure( |
394 'Invalid page name (%s) in smoke. Page name must be one of:\n%s' % ( | 397 'Invalid page name (%s) in smoke. Page name must be one of:\n%s' % ( |
395 self._page.name, page_to_metrics.keys())) | 398 self._page.name, page_to_metrics.keys())) |
396 for add_result in page_to_metrics[self._page.name]: | 399 for add_result in page_to_metrics[self._page.name]: |
397 add_result(tab, results) | 400 add_result(tab, results) |
OLD | NEW |