Commit 4f9d384d authored by Doug Arnett's avatar Doug Arnett Committed by Commit Bot

Adds InforBar histogram checks for LitePage integration tests

Adds both a positive check and negative check.

Bug: 787185
Change-Id: I4a5c9c450d4500604bbfc4690f7ef6fcc643c87a
Reviewed-on: https://chromium-review.googlesource.com/804198Reviewed-by: default avatarRyan Sturm <ryansturm@chromium.org>
Commit-Queue: Doug Arnett <dougarnett@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521066}
parent 6655ab1a
...@@ -60,6 +60,10 @@ class LitePage(IntegrationTest): ...@@ -60,6 +60,10 @@ class LitePage(IntegrationTest):
# Verify that a Lite Page response for the main frame was seen. # Verify that a Lite Page response for the main frame was seen.
self.assertEqual(1, lite_page_responses) self.assertEqual(1, lite_page_responses)
# Verify previews info bar recorded
histogram = test_driver.GetHistogram('Previews.InfoBarAction.LitePage', 5)
self.assertEqual(1, histogram['count'])
# Checks that a Lite Page is served and the force_lite_page experiment # Checks that a Lite Page is served and the force_lite_page experiment
# directive is provided when always-on. # directive is provided when always-on.
# Note: this test is only on M-60+ which supports exp=force_lite_page # Note: this test is only on M-60+ which supports exp=force_lite_page
...@@ -289,6 +293,14 @@ class LitePage(IntegrationTest): ...@@ -289,6 +293,14 @@ class LitePage(IntegrationTest):
self.assertTrue(lite_page_responses == 1 or page_policies_responses == 1) self.assertTrue(lite_page_responses == 1 or page_policies_responses == 1)
# Verify a previews info bar recorded
if (lite_page_responses == 1):
histogram = test_driver.GetHistogram(
'Previews.InfoBarAction.LitePage', 5)
else:
histogram = test_driver.GetHistogram('Previews.InfoBarAction.LoFi', 5)
self.assertEqual(1, histogram['count'])
# Checks that the server does not provide a preview (neither Lite Page nor # Checks that the server does not provide a preview (neither Lite Page nor
# fallback to LoFi) for a fast connection. # fallback to LoFi) for a fast connection.
# Note: this test is for the CPAT protocol change in M-61. # Note: this test is for the CPAT protocol change in M-61.
...@@ -325,6 +337,12 @@ class LitePage(IntegrationTest): ...@@ -325,6 +337,12 @@ class LitePage(IntegrationTest):
self.assertNotIn('chrome-proxy-accept-transform', self.assertNotIn('chrome-proxy-accept-transform',
response.request_headers) response.request_headers)
# Verify no previews info bar recorded
histogram = test_driver.GetHistogram('Previews.InfoBarAction.LitePage', 5)
self.assertEqual(histogram, {})
histogram = test_driver.GetHistogram('Previews.InfoBarAction.LoFi', 5)
self.assertEqual(histogram, {})
# Checks that the server provides a preview (either Lite Page or fallback # Checks that the server provides a preview (either Lite Page or fallback
# to LoFi) for a "heavy" page over a 3G connection. # to LoFi) for a "heavy" page over a 3G connection.
@ChromeVersionEqualOrAfterM(61) @ChromeVersionEqualOrAfterM(61)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment