diff options
author | bustamante <bustamante@google.com> | 2015-05-19 15:39:42 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-19 22:40:04 +0000 |
commit | d8c12436be2a7c39607fd078383f2519b0a4ac4b (patch) | |
tree | 4bbab14ec5736df39aee5f4d597e2e6905b71de4 | |
parent | 4d7a267e2f8b7a62963f4632bac8999df91627b6 (diff) | |
download | chromium_src-d8c12436be2a7c39607fd078383f2519b0a4ac4b.zip chromium_src-d8c12436be2a7c39607fd078383f2519b0a4ac4b.tar.gz chromium_src-d8c12436be2a7c39607fd078383f2519b0a4ac4b.tar.bz2 |
Update experiment test to only verify /exptest/... are bypassed
The exp_directive test verifies the experiment flag is passed to the
page, by bypassing any request to http://aws1.mdw.la/exptest/... when
the flag --data-reduction-proxy-experiment=test is set. Which works
as expected.
However the favicon request from http://aws1.mdw.la/favicon.ico won't
be bypassed, causing the test to fail. To fix the test, I'm adding an
optional url_pattern parameter to the bypass verification, that will
verify only /exptest/ urls are checked.
BUG=488232
Review URL: https://codereview.chromium.org/1141923004
Cr-Commit-Position: refs/heads/master@{#330644}
-rw-r--r-- | tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py | 2 | ||||
-rw-r--r-- | tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py b/tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py index 6e6af1d..8eb6cf6 100644 --- a/tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py +++ b/tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py @@ -288,7 +288,7 @@ class ChromeProxyExpDirective(ChromeProxyValidation): options.AppendExtraBrowserArgs('--data-reduction-proxy-experiment=test') def AddResults(self, tab, results): - self._metrics.AddResultsForBypass(tab, results) + self._metrics.AddResultsForBypass(tab, results, url_pattern='/exptest/') class ChromeProxyHTTPToDirectFallback(ChromeProxyValidation): diff --git a/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py b/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py index 793aceb..ec7bcd2 100644 --- a/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py +++ b/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py @@ -261,10 +261,16 @@ class ChromeProxyMetric(network_metrics.NetworkMetric): results.current_page, 'lo_fi_response', 'count', lo_fi_response_count)) super(ChromeProxyMetric, self).AddResults(tab, results) - def AddResultsForBypass(self, tab, results): + def AddResultsForBypass(self, tab, results, url_pattern=""): bypass_count = 0 + skipped_count = 0 for resp in self.IterResponses(tab): + # Only check the url's that contain the specified pattern. + if url_pattern and url_pattern not in resp.response.url: + skipped_count += 1 + continue + if resp.HasChromeProxyViaHeader(): r = resp.response raise ChromeProxyMetricException, ( @@ -276,8 +282,11 @@ class ChromeProxyMetric(network_metrics.NetworkMetric): raise ChromeProxyMetricException, ( 'Expected at least one response to be bypassed, but zero such ' 'responses were received.') + results.AddValue(scalar.ScalarValue( results.current_page, 'bypass', 'count', bypass_count)) + results.AddValue(scalar.ScalarValue( + results.current_page, 'skipped', 'count', skipped_count)) def AddResultsForCorsBypass(self, tab, results): eligible_response_count = 0 |