OLD | NEW |
---|---|
(Empty) | |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | |
2 # Use of this source code is governed by a BSD-style license that can be | |
3 # found in the LICENSE file. | |
4 | |
5 from telemetry.page import page as page_module | |
6 from telemetry.page import page_set as page_set_module | |
7 | |
8 | |
9 class VideoPage(page_module.Page): | |
10 """A test page containing a video. | |
11 | |
12 Attributes: | |
13 use_chrome_proxy: If true, fetches use the data reduction proxy. | |
14 Otherwise, fetches are sent directly to the origin. | |
sclittle
2015/04/11 00:13:02
nit: Indent this line 2 more spaces.
Tom Bergan
2015/05/01 23:48:28
Done.
| |
15 """ | |
16 | |
17 def __init__(self, url, page_set, use_chrome_proxy): | |
18 super(VideoPage, self).__init__(url=url, page_set=page_set) | |
19 self.use_chrome_proxy = use_chrome_proxy | |
20 | |
21 | |
22 class VideoPageSet(page_set_module.PageSet): | |
23 """ Base class for Chrome proxy video tests. """ | |
sclittle
2015/04/11 00:13:02
nit: Remove spaces between the """s and the text i
Tom Bergan
2015/05/01 23:48:28
Done.
| |
24 | |
25 def __init__(self, mode): | |
26 super(VideoPageSet, self).__init__() | |
27 urls_list = [ | |
28 'http://aws1.mdw.la/fwvideo/simple.html', | |
29 ] | |
30 for url in urls_list: | |
31 self._AddUserStoryForURL(url) | |
32 | |
33 def _AddUserStoryForURL(self, url): | |
34 raise NotImplementedError | |
35 | |
36 | |
37 class VideoDirectPageSet(VideoPageSet): | |
38 """ Chrome proxy video tests: direct fetch. """ | |
39 def __init__(self): | |
40 super(VideoDirectPageSet, self).__init__('direct') | |
41 | |
42 def _AddUserStoryForURL(self, url): | |
43 self.AddUserStory(VideoPage(url, self, False)) | |
44 | |
45 | |
46 class VideoProxiedPageSet(VideoPageSet): | |
47 """ Chrome proxy video tests: proxied fetch. """ | |
48 def __init__(self): | |
49 super(VideoProxiedPageSet, self).__init__('proxied') | |
50 | |
51 def _AddUserStoryForURL(self, url): | |
52 self.AddUserStory(VideoPage(url, self, True)) | |
53 | |
54 | |
55 class VideoComparePageSet(VideoPageSet): | |
56 """ Chrome proxy video tests: compare direct and proxied fetches. """ | |
57 def __init__(self): | |
58 super(VideoComparePageSet, self).__init__('compare') | |
59 | |
60 def _AddUserStoryForURL(self, url): | |
61 self.AddUserStory(VideoPage(url, self, False)) | |
62 self.AddUserStory(VideoPage(url, self, True)) | |
OLD | NEW |