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

Unified Diff: tools/chrome_proxy/integration_tests/chrome_proxy_pagesets/video.py

Issue 1065763002: Add data reduction proxy integration tests for video compression. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reviewer comment: removed unused class ChromeProxyLatency Created 5 years, 7 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
Index: tools/chrome_proxy/integration_tests/chrome_proxy_pagesets/video.py
diff --git a/tools/chrome_proxy/integration_tests/chrome_proxy_pagesets/video.py b/tools/chrome_proxy/integration_tests/chrome_proxy_pagesets/video.py
new file mode 100644
index 0000000000000000000000000000000000000000..51f005c2c31ffeafda5de0b3ab3a4c0ca1fbaeaa
--- /dev/null
+++ b/tools/chrome_proxy/integration_tests/chrome_proxy_pagesets/video.py
@@ -0,0 +1,62 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from telemetry.page import page as page_module
+from telemetry.page import page_set as page_set_module
+
+
+class VideoPage(page_module.Page):
+ """A test page containing a video.
+
+ Attributes:
+ use_chrome_proxy: If true, fetches use the data reduction proxy.
+ Otherwise, fetches are sent directly to the origin.
+ """
+
+ def __init__(self, url, page_set, use_chrome_proxy):
+ super(VideoPage, self).__init__(url=url, page_set=page_set)
+ self.use_chrome_proxy = use_chrome_proxy
+
+
+class VideoPageSet(page_set_module.PageSet):
+ """Base class for Chrome proxy video tests."""
+
+ def __init__(self, mode):
+ super(VideoPageSet, self).__init__()
+ urls_list = [
+ 'http://check.googlezip.net/cacheable/video/buck_bunny_tiny.html',
+ ]
+ for url in urls_list:
+ self._AddUserStoryForURL(url)
+
+ def _AddUserStoryForURL(self, url):
+ raise NotImplementedError
+
+
+class VideoDirectPageSet(VideoPageSet):
+ """Chrome proxy video tests: direct fetch."""
+ def __init__(self):
+ super(VideoDirectPageSet, self).__init__('direct')
+
+ def _AddUserStoryForURL(self, url):
+ self.AddUserStory(VideoPage(url, self, False))
+
+
+class VideoProxiedPageSet(VideoPageSet):
+ """Chrome proxy video tests: proxied fetch."""
+ def __init__(self):
+ super(VideoProxiedPageSet, self).__init__('proxied')
+
+ def _AddUserStoryForURL(self, url):
+ self.AddUserStory(VideoPage(url, self, True))
+
+
+class VideoComparePageSet(VideoPageSet):
+ """Chrome proxy video tests: compare direct and proxied fetches."""
+ def __init__(self):
+ super(VideoComparePageSet, self).__init__('compare')
+
+ def _AddUserStoryForURL(self, url):
+ self.AddUserStory(VideoPage(url, self, False))
+ self.AddUserStory(VideoPage(url, self, True))

Powered by Google App Engine
This is Rietveld 408576698