Commit 9714965f authored by robertogden's avatar robertogden Committed by Commit bot

Add test to check for no compression for XHR video.

Video requests made by XHR should not be proxied.

BUG=688069

Review-Url: https://codereview.chromium.org/2676673004
Cr-Commit-Position: refs/heads/master@{#448052}
parent d33a67d4
......@@ -18,5 +18,27 @@ class Video(IntegrationTest):
for response in t.GetHTTPResponses():
self.assertHasChromeProxyViaHeader(response)
# Videos fetched via an XHR request should not be proxied.
def testNoCompressionOnXHR(self):
with TestDriver() as t:
t.AddChromeArg('--enable-spdy-proxy-auth')
# The test will actually use Javascript, so use a site that won't have any
# resources on it that could interfere.
t.LoadURL('http://check.googlezip.net/connect')
t.ExecuteJavascript(
'var xhr = new XMLHttpRequest();'
'xhr.open("GET", "/cacheable/video/data/buck_bunny_tiny.mp4", false);'
'xhr.send();'
'return;'
)
saw_video_response = False
for response in t.GetHTTPResponses():
if 'video' in response.response_headers['content-type']:
self.assertNotHasChromeProxyViaHeader(response)
saw_video_response = True
else:
self.assertHasChromeProxyViaHeader(response)
self.assertTrue(saw_video_response, 'No video request seen in test!')
if __name__ == '__main__':
IntegrationTest.RunAllTests()
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