Index: tools/chrome_proxy/integration_tests/chrome_proxy_metrics_unittest.py |
diff --git a/tools/chrome_proxy/integration_tests/chrome_proxy_metrics_unittest.py b/tools/chrome_proxy/integration_tests/chrome_proxy_metrics_unittest.py |
index 3b2240bd9ce2ab0a64929d2628020c03fc271bc5..16ed6404b9bc73d6af6d67b5efa48b8fd9425d90 100644 |
--- a/tools/chrome_proxy/integration_tests/chrome_proxy_metrics_unittest.py |
+++ b/tools/chrome_proxy/integration_tests/chrome_proxy_metrics_unittest.py |
@@ -22,6 +22,16 @@ EVENT_HTML_DIRECT = network_unittest.NetworkMetricTest.MakeNetworkTimelineEvent( |
}, |
body=network_unittest.HTML_BODY) |
+# A BlockOnce response not via proxy. |
+EVENT_HTML_BLOCKONCE = ( |
+ network_unittest.NetworkMetricTest.MakeNetworkTimelineEvent( |
+ url='http://check.googlezip.net/blocksingle/', |
+ response_headers={ |
+ 'Content-Type': 'text/html', |
+ 'Content-Length': str(len(network_unittest.HTML_BODY)), |
+ }, |
+ body=network_unittest.HTML_BODY)) |
+ |
# An HTML via proxy. |
EVENT_HTML_PROXY_VIA = ( |
network_unittest.NetworkMetricTest.MakeNetworkTimelineEvent( |
@@ -264,14 +274,15 @@ class ChromeProxyMetricTest(unittest.TestCase): |
def testChromeProxyMetricForBlockOnce(self): |
metric = metrics.ChromeProxyMetric() |
- metric.SetEvents([EVENT_HTML_DIRECT, |
+ metric.SetEvents([EVENT_HTML_BLOCKONCE, |
+ EVENT_HTML_BLOCKONCE, |
EVENT_IMAGE_PROXY_VIA]) |
results = test_page_test_results.TestPageTestResults(self) |
metric.AddResultsForBlockOnce(None, results) |
results.AssertHasPageSpecificScalarValue('eligible_responses', 'count', 2) |
- results.AssertHasPageSpecificScalarValue('bypass', 'count', 1) |
- metric.SetEvents([EVENT_HTML_DIRECT, |
+ metric.SetEvents([EVENT_HTML_BLOCKONCE, |
+ EVENT_HTML_BLOCKONCE, |
EVENT_IMAGE_DIRECT]) |
exception_occurred = False |
try: |