Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Unified Diff: tools/chrome_proxy/webdriver/bypass.py

Issue 2816823002: Fixing flaky integration test (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/chrome_proxy/webdriver/bypass.py
diff --git a/tools/chrome_proxy/webdriver/bypass.py b/tools/chrome_proxy/webdriver/bypass.py
index e046ce74bf3d32bc48da13cb687973f78c03a86b..7eb98e1c51a92a945893c53d12c5862b2dbe468c 100644
--- a/tools/chrome_proxy/webdriver/bypass.py
+++ b/tools/chrome_proxy/webdriver/bypass.py
@@ -126,14 +126,17 @@ class Bypass(IntegrationTest):
self.assertNotHasChromeProxyViaHeader(response)
self.assertEqual(u'http/1.1', response.protocol)
- # Check that the BlockTypePrimary histogram has a single entry in the
+ # Check that the BlockTypePrimary histogram has at least one entry in the
# MissingViaHeader4xx category (which is enum value 4), to make sure that
# the bypass was caused by the missing via header logic and not something
- # else.
+ # else. The favicon for this URL may also be fetched, but will return a
+ # 404.
histogram = test_driver.GetHistogram(
"DataReductionProxy.BlockTypePrimary")
- self.assertEqual(1, histogram['count'])
- self.assertIn({'count': 1, 'high': 5, 'low': 4}, histogram['buckets'])
+ self.assertNotEqual(0, histogram['count'])
+ self.assertEqual(1, len(histogram['buckets']))
+ self.assertEqual(5, histogram['buckets'][0]['high'])
+ self.assertEqual(4, histogram['buckets'][0]['low'])
# Verify that the Data Reduction Proxy understands the "exp" directive.
def testExpDirectiveBypass(self):
@@ -191,4 +194,4 @@ class Bypass(IntegrationTest):
self.assertEqual(80, response.port)
if __name__ == '__main__':
- IntegrationTest.RunAllTests()
+ IntegrationTest.RunAllTests()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698