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

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

Issue 2676673004: Add test to check no compression for XHR video (Closed)
Patch Set: Created 3 years, 11 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/video.py
diff --git a/tools/chrome_proxy/webdriver/video.py b/tools/chrome_proxy/webdriver/video.py
index a88022c7b19cf4986df63e0d70f5b1a2da44fb82..ef02a0f278e79020b58dfa4e5c31c197b248389b 100644
--- a/tools/chrome_proxy/webdriver/video.py
+++ b/tools/chrome_proxy/webdriver/video.py
@@ -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()
« 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