| 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 common import chrome_proxy_measurements as measurements | 9 from common import chrome_proxy_measurements as measurements |
| 10 from common.chrome_proxy_measurements import ChromeProxyValidation | 10 from common.chrome_proxy_measurements import ChromeProxyValidation |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 | 66 |
| 67 class ChromeProxyBypass(ChromeProxyValidation): | 67 class ChromeProxyBypass(ChromeProxyValidation): |
| 68 """Correctness measurement for bypass responses.""" | 68 """Correctness measurement for bypass responses.""" |
| 69 | 69 |
| 70 def __init__(self): | 70 def __init__(self): |
| 71 super(ChromeProxyBypass, self).__init__( | 71 super(ChromeProxyBypass, self).__init__( |
| 72 restart_after_each_page=True, | 72 restart_after_each_page=True, |
| 73 metrics=metrics.ChromeProxyMetric()) | 73 metrics=metrics.ChromeProxyMetric()) |
| 74 | 74 |
| 75 def CustomizeBrowserOptions(self, options): |
| 76 super(ChromeProxyBypass, self).CustomizeBrowserOptions(options) |
| 77 options.AppendExtraBrowserArgs('--disable-quic') |
| 78 |
| 75 def AddResults(self, tab, results): | 79 def AddResults(self, tab, results): |
| 76 self._metrics.AddResultsForBypass(tab, results) | 80 self._metrics.AddResultsForBypass(tab, results) |
| 77 | 81 |
| 78 | 82 |
| 79 class ChromeProxyHTTPSBypass(ChromeProxyValidation): | 83 class ChromeProxyHTTPSBypass(ChromeProxyValidation): |
| 80 """Correctness measurement for bypass responses.""" | 84 """Correctness measurement for bypass responses.""" |
| 81 | 85 |
| 82 def __init__(self): | 86 def __init__(self): |
| 83 super(ChromeProxyHTTPSBypass, self).__init__( | 87 super(ChromeProxyHTTPSBypass, self).__init__( |
| 84 restart_after_each_page=True, | 88 restart_after_each_page=True, |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 class ChromeProxyBadHTTPSFallback(ChromeProxyValidation): | 202 class ChromeProxyBadHTTPSFallback(ChromeProxyValidation): |
| 199 """Checks the client falls back to HTTP proxy when HTTPS proxy errors.""" | 203 """Checks the client falls back to HTTP proxy when HTTPS proxy errors.""" |
| 200 | 204 |
| 201 def __init__(self): | 205 def __init__(self): |
| 202 super(ChromeProxyBadHTTPSFallback, self).__init__( | 206 super(ChromeProxyBadHTTPSFallback, self).__init__( |
| 203 restart_after_each_page=True, | 207 restart_after_each_page=True, |
| 204 metrics=metrics.ChromeProxyMetric()) | 208 metrics=metrics.ChromeProxyMetric()) |
| 205 self._is_chrome_proxy_enabled = True | 209 self._is_chrome_proxy_enabled = True |
| 206 | 210 |
| 207 def CustomizeBrowserOptions(self, options): | 211 def CustomizeBrowserOptions(self, options): |
| 208 super(ChromeProxyBadHTTPSFallback, self).CustomizeBrowserOptions( | 212 super(ChromeProxyBadHTTPSFallback, self).CustomizeBrowserOptions(options) |
| 209 options) | 213 options.AppendExtraBrowserArgs('--disable-quic') |
| 210 | 214 |
| 211 def AddResults(self, tab, results): | 215 def AddResults(self, tab, results): |
| 212 self._metrics.AddResultsForBadHTTPSFallback(tab, results) | 216 self._metrics.AddResultsForBadHTTPSFallback(tab, results) |
| 213 | 217 |
| 214 class ChromeProxyHTTPFallbackProbeURL(ChromeProxyValidation): | 218 class ChromeProxyHTTPFallbackProbeURL(ChromeProxyValidation): |
| 215 """Correctness measurement for proxy fallback. | 219 """Correctness measurement for proxy fallback. |
| 216 | 220 |
| 217 In this test, the probe URL does not return 'OK'. Chrome is expected | 221 In this test, the probe URL does not return 'OK'. Chrome is expected |
| 218 to use the fallback proxy. | 222 to use the fallback proxy. |
| 219 """ | 223 """ |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 | 276 |
| 273 class ChromeProxyClientType(ChromeProxyValidation): | 277 class ChromeProxyClientType(ChromeProxyValidation): |
| 274 """Correctness measurement for Chrome-Proxy header client type directives.""" | 278 """Correctness measurement for Chrome-Proxy header client type directives.""" |
| 275 | 279 |
| 276 def __init__(self): | 280 def __init__(self): |
| 277 super(ChromeProxyClientType, self).__init__( | 281 super(ChromeProxyClientType, self).__init__( |
| 278 restart_after_each_page=True, | 282 restart_after_each_page=True, |
| 279 metrics=metrics.ChromeProxyMetric()) | 283 metrics=metrics.ChromeProxyMetric()) |
| 280 self._chrome_proxy_client_type = None | 284 self._chrome_proxy_client_type = None |
| 281 | 285 |
| 286 def CustomizeBrowserOptions(self, options): |
| 287 super(ChromeProxyClientType, self).CustomizeBrowserOptions(options) |
| 288 options.AppendExtraBrowserArgs('--disable-quic') |
| 289 |
| 282 def AddResults(self, tab, results): | 290 def AddResults(self, tab, results): |
| 283 # Get the Chrome-Proxy client type from the first page in the page set, so | 291 # Get the Chrome-Proxy client type from the first page in the page set, so |
| 284 # that the client type value can be used to determine which of the later | 292 # that the client type value can be used to determine which of the later |
| 285 # pages in the page set should be bypassed. | 293 # pages in the page set should be bypassed. |
| 286 if not self._chrome_proxy_client_type: | 294 if not self._chrome_proxy_client_type: |
| 287 client_type = self._metrics.GetClientTypeFromRequests(tab) | 295 client_type = self._metrics.GetClientTypeFromRequests(tab) |
| 288 if client_type: | 296 if client_type: |
| 289 self._chrome_proxy_client_type = client_type | 297 self._chrome_proxy_client_type = client_type |
| 290 | 298 |
| 291 self._metrics.AddResultsForClientType(tab, | 299 self._metrics.AddResultsForClientType(tab, |
| 292 results, | 300 results, |
| 293 self._chrome_proxy_client_type, | 301 self._chrome_proxy_client_type, |
| 294 self._page.bypass_for_client_type) | 302 self._page.bypass_for_client_type) |
| 295 | 303 |
| 296 | 304 |
| 297 class ChromeProxyLoFi(ChromeProxyValidation): | 305 class ChromeProxyLoFi(ChromeProxyValidation): |
| 298 """Correctness measurement for Lo-Fi in Chrome-Proxy header.""" | 306 """Correctness measurement for Lo-Fi in Chrome-Proxy header.""" |
| 299 | 307 |
| 300 def __init__(self): | 308 def __init__(self): |
| 301 super(ChromeProxyLoFi, self).__init__(restart_after_each_page=True, | 309 super(ChromeProxyLoFi, self).__init__(restart_after_each_page=True, |
| 302 metrics=metrics.ChromeProxyMetric()) | 310 metrics=metrics.ChromeProxyMetric()) |
| 303 | 311 |
| 304 def CustomizeBrowserOptions(self, options): | 312 def CustomizeBrowserOptions(self, options): |
| 305 super(ChromeProxyLoFi, self).CustomizeBrowserOptions(options) | 313 super(ChromeProxyLoFi, self).CustomizeBrowserOptions(options) |
| 306 options.AppendExtraBrowserArgs('--data-reduction-proxy-lo-fi=always-on') | 314 options.AppendExtraBrowserArgs('--data-reduction-proxy-lo-fi=always-on') |
| 307 # Disable server experiments such as tamper detection. | 315 # Disable server experiments such as tamper detection. |
| 308 options.AppendExtraBrowserArgs( | 316 options.AppendExtraBrowserArgs( |
| 309 '--data-reduction-proxy-server-experiments-disabled') | 317 '--data-reduction-proxy-server-experiments-disabled') |
| 318 options.AppendExtraBrowserArgs('--disable-quic') |
| 310 | 319 |
| 311 def AddResults(self, tab, results): | 320 def AddResults(self, tab, results): |
| 312 self._metrics.AddResultsForLoFi(tab, results) | 321 self._metrics.AddResultsForLoFi(tab, results) |
| 313 | 322 |
| 314 class ChromeProxyCacheLoFiDisabled(ChromeProxyValidation): | 323 class ChromeProxyCacheLoFiDisabled(ChromeProxyValidation): |
| 315 """ | 324 """ |
| 316 Correctness measurement for Lo-Fi placeholder is not loaded from cache when a | 325 Correctness measurement for Lo-Fi placeholder is not loaded from cache when a |
| 317 page is reloaded with LoFi disabled. First a test page is opened with LoFi and | 326 page is reloaded with LoFi disabled. First a test page is opened with LoFi and |
| 318 chrome proxy enabled. This allows Chrome to cache the LoFi placeholder image. | 327 chrome proxy enabled. This allows Chrome to cache the LoFi placeholder image. |
| 319 The browser is restarted with LoFi disabled and the same test page is loaded. | 328 The browser is restarted with LoFi disabled and the same test page is loaded. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 334 | 343 |
| 335 def WillStartBrowser(self, platform): | 344 def WillStartBrowser(self, platform): |
| 336 super(ChromeProxyCacheLoFiDisabled, self).WillStartBrowser(platform) | 345 super(ChromeProxyCacheLoFiDisabled, self).WillStartBrowser(platform) |
| 337 if not self._page: | 346 if not self._page: |
| 338 # First page load, enable LoFi and chrome proxy. Disable server | 347 # First page load, enable LoFi and chrome proxy. Disable server |
| 339 # experiments such as tamper detection. | 348 # experiments such as tamper detection. |
| 340 self.options.AppendExtraBrowserArgs( | 349 self.options.AppendExtraBrowserArgs( |
| 341 '--data-reduction-proxy-lo-fi=always-on') | 350 '--data-reduction-proxy-lo-fi=always-on') |
| 342 self.options.AppendExtraBrowserArgs( | 351 self.options.AppendExtraBrowserArgs( |
| 343 '--data-reduction-proxy-server-experiments-disabled') | 352 '--data-reduction-proxy-server-experiments-disabled') |
| 353 self.options.AppendExtraBrowserArgs('--disable-quic') |
| 344 self._is_lo_fi_enabled = True | 354 self._is_lo_fi_enabled = True |
| 345 else: | 355 else: |
| 346 # Second page load, disable LoFi. Chrome proxy is still enabled. Disable | 356 # Second page load, disable LoFi. Chrome proxy is still enabled. Disable |
| 347 # server experiments such as tamper detection. | 357 # server experiments such as tamper detection. |
| 348 self.options.browser_options.extra_browser_args.discard( | 358 self.options.browser_options.extra_browser_args.discard( |
| 349 '--data-reduction-proxy-lo-fi=always-on') | 359 '--data-reduction-proxy-lo-fi=always-on') |
| 350 self.options.AppendExtraBrowserArgs( | 360 self.options.AppendExtraBrowserArgs( |
| 351 '--data-reduction-proxy-server-experiments-disabled') | 361 '--data-reduction-proxy-server-experiments-disabled') |
| 362 self.options.AppendExtraBrowserArgs('--disable-quic') |
| 352 self._is_lo_fi_enabled = False | 363 self._is_lo_fi_enabled = False |
| 353 | 364 |
| 354 def WillNavigateToPage(self, page, tab): | 365 def WillNavigateToPage(self, page, tab): |
| 355 super(ChromeProxyCacheLoFiDisabled, self).WillNavigateToPage(page, tab) | 366 super(ChromeProxyCacheLoFiDisabled, self).WillNavigateToPage(page, tab) |
| 356 if self._is_lo_fi_enabled: | 367 if self._is_lo_fi_enabled: |
| 357 # Clear cache for the first page to pick LoFi image from server. | 368 # Clear cache for the first page to pick LoFi image from server. |
| 358 tab.ClearCache(force=True) | 369 tab.ClearCache(force=True) |
| 359 | 370 |
| 360 def DidNavigateToPage(self, page, tab): | 371 def DidNavigateToPage(self, page, tab): |
| 361 if not self._is_lo_fi_enabled: | 372 if not self._is_lo_fi_enabled: |
| (...skipping 24 matching lines...) Expand all Loading... |
| 386 | 397 |
| 387 def WillStartBrowser(self, platform): | 398 def WillStartBrowser(self, platform): |
| 388 super(ChromeProxyCacheProxyDisabled, self).WillStartBrowser(platform) | 399 super(ChromeProxyCacheProxyDisabled, self).WillStartBrowser(platform) |
| 389 if not self._page: | 400 if not self._page: |
| 390 # First page load, enable LoFi and chrome proxy. Disable server | 401 # First page load, enable LoFi and chrome proxy. Disable server |
| 391 # experiments such as tamper detection. | 402 # experiments such as tamper detection. |
| 392 self.options.AppendExtraBrowserArgs( | 403 self.options.AppendExtraBrowserArgs( |
| 393 '--data-reduction-proxy-lo-fi=always-on') | 404 '--data-reduction-proxy-lo-fi=always-on') |
| 394 self.options.AppendExtraBrowserArgs( | 405 self.options.AppendExtraBrowserArgs( |
| 395 '--data-reduction-proxy-server-experiments-disabled') | 406 '--data-reduction-proxy-server-experiments-disabled') |
| 407 self.options.AppendExtraBrowserArgs('--disable-quic') |
| 396 else: | 408 else: |
| 397 # Second page load, disable chrome proxy. LoFi is still enabled. | 409 # Second page load, disable chrome proxy. LoFi is still enabled. |
| 410 self.options.AppendExtraBrowserArgs('--disable-quic') |
| 398 self.DisableChromeProxy() | 411 self.DisableChromeProxy() |
| 399 | 412 |
| 400 def WillNavigateToPage(self, page, tab): | 413 def WillNavigateToPage(self, page, tab): |
| 401 super(ChromeProxyCacheProxyDisabled, self).WillNavigateToPage(page, tab) | 414 super(ChromeProxyCacheProxyDisabled, self).WillNavigateToPage(page, tab) |
| 402 if self._is_chrome_proxy_enabled: | 415 if self._is_chrome_proxy_enabled: |
| 403 # Clear cache for the first page to pick LoFi image from server. | 416 # Clear cache for the first page to pick LoFi image from server. |
| 404 tab.ClearCache(force=True) | 417 tab.ClearCache(force=True) |
| 405 | 418 |
| 406 def DidNavigateToPage(self, page, tab): | 419 def DidNavigateToPage(self, page, tab): |
| 407 if not self._is_chrome_proxy_enabled: | 420 if not self._is_chrome_proxy_enabled: |
| 408 tab.ExecuteJavaScript('window.location.reload()') | 421 tab.ExecuteJavaScript('window.location.reload()') |
| 409 util.WaitFor(tab.HasReachedQuiescence, 3) | 422 util.WaitFor(tab.HasReachedQuiescence, 3) |
| 410 | 423 |
| 411 class ChromeProxyLoFiPreview(ChromeProxyValidation): | 424 class ChromeProxyLoFiPreview(ChromeProxyValidation): |
| 412 """Correctness measurement for Lo-Fi preview in Chrome-Proxy header.""" | 425 """Correctness measurement for Lo-Fi preview in Chrome-Proxy header.""" |
| 413 | 426 |
| 414 def __init__(self): | 427 def __init__(self): |
| 415 super(ChromeProxyLoFiPreview, self).__init__( | 428 super(ChromeProxyLoFiPreview, self).__init__( |
| 416 restart_after_each_page=True, | 429 restart_after_each_page=True, |
| 417 metrics=metrics.ChromeProxyMetric()) | 430 metrics=metrics.ChromeProxyMetric()) |
| 418 | 431 |
| 419 def CustomizeBrowserOptions(self, options): | 432 def CustomizeBrowserOptions(self, options): |
| 420 super(ChromeProxyLoFiPreview, self).CustomizeBrowserOptions(options) | 433 super(ChromeProxyLoFiPreview, self).CustomizeBrowserOptions(options) |
| 421 options.AppendExtraBrowserArgs( | 434 options.AppendExtraBrowserArgs( |
| 422 '--data-reduction-proxy-lo-fi=always-on') | 435 '--data-reduction-proxy-lo-fi=always-on') |
| 423 options.AppendExtraBrowserArgs( | 436 options.AppendExtraBrowserArgs( |
| 424 '--enable-data-reduction-proxy-lo-fi-preview') | 437 '--enable-data-reduction-proxy-lo-fi-preview') |
| 438 options.AppendExtraBrowserArgs('--disable-quic') |
| 425 | 439 |
| 426 def AddResults(self, tab, results): | 440 def AddResults(self, tab, results): |
| 427 self._metrics.AddResultsForLoFiPreview(tab, results) | 441 self._metrics.AddResultsForLoFiPreview(tab, results) |
| 428 | 442 |
| 429 class ChromeProxyExpDirective(ChromeProxyValidation): | 443 class ChromeProxyExpDirective(ChromeProxyValidation): |
| 430 """Correctness measurement for experiment directives in Chrome-Proxy header. | 444 """Correctness measurement for experiment directives in Chrome-Proxy header. |
| 431 | 445 |
| 432 This test verifies that "exp=test" in the Chrome-Proxy request header | 446 This test verifies that "exp=test" in the Chrome-Proxy request header |
| 433 causes a bypass on the experiment test page. | 447 causes a bypass on the experiment test page. |
| 434 """ | 448 """ |
| (...skipping 17 matching lines...) Expand all Loading... |
| 452 causes a resource to be loaded without Data Reduction Proxy transformations. | 466 causes a resource to be loaded without Data Reduction Proxy transformations. |
| 453 """ | 467 """ |
| 454 | 468 |
| 455 def __init__(self): | 469 def __init__(self): |
| 456 super(ChromeProxyPassThrough, self).__init__( | 470 super(ChromeProxyPassThrough, self).__init__( |
| 457 restart_after_each_page=True, | 471 restart_after_each_page=True, |
| 458 metrics=metrics.ChromeProxyMetric()) | 472 metrics=metrics.ChromeProxyMetric()) |
| 459 | 473 |
| 460 def CustomizeBrowserOptions(self, options): | 474 def CustomizeBrowserOptions(self, options): |
| 461 super(ChromeProxyPassThrough, self).CustomizeBrowserOptions(options) | 475 super(ChromeProxyPassThrough, self).CustomizeBrowserOptions(options) |
| 476 options.AppendExtraBrowserArgs('--disable-quic') |
| 462 | 477 |
| 463 def AddResults(self, tab, results): | 478 def AddResults(self, tab, results): |
| 464 self._metrics.AddResultsForPassThrough(tab, results) | 479 self._metrics.AddResultsForPassThrough(tab, results) |
| 465 | 480 |
| 466 class ChromeProxyHTTPToDirectFallback(ChromeProxyValidation): | 481 class ChromeProxyHTTPToDirectFallback(ChromeProxyValidation): |
| 467 """Correctness measurement for HTTP proxy fallback to direct.""" | 482 """Correctness measurement for HTTP proxy fallback to direct.""" |
| 468 | 483 |
| 469 def __init__(self): | 484 def __init__(self): |
| 470 super(ChromeProxyHTTPToDirectFallback, self).__init__( | 485 super(ChromeProxyHTTPToDirectFallback, self).__init__( |
| 471 restart_after_each_page=True, | 486 restart_after_each_page=True, |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 ], | 572 ], |
| 558 'bypass': [self._metrics.AddResultsForBypass], | 573 'bypass': [self._metrics.AddResultsForBypass], |
| 559 } | 574 } |
| 560 if not self._page.name in page_to_metrics: | 575 if not self._page.name in page_to_metrics: |
| 561 raise page_test.MeasurementFailure( | 576 raise page_test.MeasurementFailure( |
| 562 'Invalid page name (%s) in smoke. Page name must be one of:\n%s' % ( | 577 'Invalid page name (%s) in smoke. Page name must be one of:\n%s' % ( |
| 563 self._page.name, page_to_metrics.keys())) | 578 self._page.name, page_to_metrics.keys())) |
| 564 for add_result in page_to_metrics[self._page.name]: | 579 for add_result in page_to_metrics[self._page.name]: |
| 565 add_result(tab, results) | 580 add_result(tab, results) |
| 566 | 581 |
| 582 class ChromeProxyQuicSmoke(ChromeProxyValidation): |
| 583 """Smoke measurement for basic chrome proxy correctness when using a |
| 584 proxy that supports QUIC.""" |
| 585 |
| 586 def __init__(self): |
| 587 super(ChromeProxyQuicSmoke, self).__init__(restart_after_each_page=True, |
| 588 metrics=metrics.ChromeProxyMetric()) |
| 589 |
| 590 def CustomizeBrowserOptions(self, options): |
| 591 super(ChromeProxyQuicSmoke, self).CustomizeBrowserOptions(options) |
| 592 options.AppendExtraBrowserArgs( |
| 593 '--enable-quic') |
| 594 options.AppendExtraBrowserArgs( |
| 595 '--data-reduction-proxy-http-proxies=https://proxy.googlezip.net:443') |
| 596 options.AppendExtraBrowserArgs( |
| 597 '--force-fieldtrials=DataReductionProxyUseQuic/Enabled') |
| 598 |
| 599 def AddResults(self, tab, results): |
| 600 # Map a page name to its AddResults func. |
| 601 page_to_metrics = { |
| 602 'header validation': [self._metrics.AddResultsForHeaderValidation], |
| 603 'compression: image': [ |
| 604 self._metrics.AddResultsForHeaderValidation, |
| 605 self._metrics.AddResultsForDataSaving, |
| 606 ], |
| 607 'compression: javascript': [ |
| 608 self._metrics.AddResultsForHeaderValidation, |
| 609 self._metrics.AddResultsForDataSaving, |
| 610 ], |
| 611 'compression: css': [ |
| 612 self._metrics.AddResultsForHeaderValidation, |
| 613 self._metrics.AddResultsForDataSaving, |
| 614 ], |
| 615 'bypass': [self._metrics.AddResultsForBypass], |
| 616 } |
| 617 if not self._page.name in page_to_metrics: |
| 618 raise page_test.MeasurementFailure( |
| 619 'Invalid page name (%s) in QUIC smoke. ' |
| 620 'Page name must be one of:\n%s' % ( |
| 621 self._page.name, page_to_metrics.keys())) |
| 622 for add_result in page_to_metrics[self._page.name]: |
| 623 add_result(tab, results) |
| 567 | 624 |
| 568 PROXIED = metrics.PROXIED | 625 PROXIED = metrics.PROXIED |
| 569 DIRECT = metrics.DIRECT | 626 DIRECT = metrics.DIRECT |
| 570 | 627 |
| 571 class ChromeProxyClientConfig(ChromeProxyValidation): | 628 class ChromeProxyClientConfig(ChromeProxyValidation): |
| 572 """Chrome proxy client configuration service validation.""" | 629 """Chrome proxy client configuration service validation.""" |
| 573 | 630 |
| 574 def __init__(self): | 631 def __init__(self): |
| 575 super(ChromeProxyClientConfig, self).__init__( | 632 super(ChromeProxyClientConfig, self).__init__( |
| 576 restart_after_each_page=True, | 633 restart_after_each_page=True, |
| 577 metrics=metrics.ChromeProxyMetric()) | 634 metrics=metrics.ChromeProxyMetric()) |
| 578 | 635 |
| 579 def CustomizeBrowserOptions(self, options): | 636 def CustomizeBrowserOptions(self, options): |
| 580 super(ChromeProxyClientConfig, self).CustomizeBrowserOptions(options) | 637 super(ChromeProxyClientConfig, self).CustomizeBrowserOptions(options) |
| 581 options.AppendExtraBrowserArgs( | 638 options.AppendExtraBrowserArgs( |
| 582 '--enable-data-reduction-proxy-config-client') | 639 '--enable-data-reduction-proxy-config-client') |
| 640 options.AppendExtraBrowserArgs('--disable-quic') |
| 583 | 641 |
| 584 def AddResults(self, tab, results): | 642 def AddResults(self, tab, results): |
| 585 self._metrics.AddResultsForClientConfig(tab, results) | 643 self._metrics.AddResultsForClientConfig(tab, results) |
| 586 | 644 |
| 587 class ChromeProxyVideoValidation(page_test.PageTest): | 645 class ChromeProxyVideoValidation(page_test.PageTest): |
| 588 """Validation for video pages. | 646 """Validation for video pages. |
| 589 | 647 |
| 590 Measures pages using metrics.ChromeProxyVideoMetric. Pages can be fetched | 648 Measures pages using metrics.ChromeProxyVideoMetric. Pages can be fetched |
| 591 either direct from the origin server or via the proxy. If a page is fetched | 649 either direct from the origin server or via the proxy. If a page is fetched |
| 592 both ways, then the PROXIED and DIRECT measurements are compared to ensure | 650 both ways, then the PROXIED and DIRECT measurements are compared to ensure |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 | 758 |
| 701 def CustomizeBrowserOptions(self, options): | 759 def CustomizeBrowserOptions(self, options): |
| 702 super(ChromeProxyPingback, self).CustomizeBrowserOptions(options) | 760 super(ChromeProxyPingback, self).CustomizeBrowserOptions(options) |
| 703 options.AppendExtraBrowserArgs( | 761 options.AppendExtraBrowserArgs( |
| 704 '--enable-data-reduction-proxy-force-pingback') | 762 '--enable-data-reduction-proxy-force-pingback') |
| 705 options.AppendExtraBrowserArgs( | 763 options.AppendExtraBrowserArgs( |
| 706 '--enable-stats-collection-bindings') | 764 '--enable-stats-collection-bindings') |
| 707 | 765 |
| 708 def AddResults(self, tab, results): | 766 def AddResults(self, tab, results): |
| 709 self._metrics.AddResultsForPingback(tab, results) | 767 self._metrics.AddResultsForPingback(tab, results) |
| 768 |
| 769 class ChromeProxyQuicTransaction(ChromeProxyValidation): |
| 770 """Chrome quic proxy usage validation when connecting to a proxy that |
| 771 supports QUIC.""" |
| 772 |
| 773 def __init__(self): |
| 774 super(ChromeProxyQuicTransaction, self).__init__( |
| 775 metrics=metrics.ChromeProxyMetric()) |
| 776 |
| 777 def CustomizeBrowserOptions(self, options): |
| 778 super(ChromeProxyQuicTransaction, self).CustomizeBrowserOptions(options) |
| 779 options.AppendExtraBrowserArgs( |
| 780 '--enable-quic') |
| 781 options.AppendExtraBrowserArgs( |
| 782 '--data-reduction-proxy-http-proxies=https://proxy.googlezip.net:443') |
| 783 options.AppendExtraBrowserArgs( |
| 784 '--force-fieldtrials=DataReductionProxyUseQuic/Enabled') |
| 785 options.AppendExtraBrowserArgs( |
| 786 '--enable-stats-collection-bindings') |
| 787 |
| 788 def AddResults(self, tab, results): |
| 789 self._metrics.AddResultsForQuicTransaction(tab, results) |
| OLD | NEW |