Add ICU message format support
[chromium-blink-merge.git] / tools / chrome_proxy / integration_tests / chrome_proxy_pagesets / video.py
blob9ba03946fc5fcd9b1764e8c7cdcec2d542087cb9
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.
5 from telemetry.page import page as page_module
6 from telemetry.page import shared_page_state
7 from telemetry import story
10 class ControllableProxySharedState(shared_page_state.SharedPageState):
12 def WillRunStory(self, page):
13 if page.use_chrome_proxy:
14 self._finder_options.AppendExtraBrowserArgs('--enable-spdy-proxy-auth')
15 super(ControllableProxySharedState, self).WillRunStory(page)
18 class VideoPage(page_module.Page):
19 """A test page containing a video.
21 Attributes:
22 use_chrome_proxy: If true, fetches use the data reduction proxy.
23 Otherwise, fetches are sent directly to the origin.
24 """
26 def __init__(self, url, page_set, use_chrome_proxy):
27 super(VideoPage, self).__init__(
28 url=url, page_set=page_set,
29 shared_page_state_class=ControllableProxySharedState)
30 self.use_chrome_proxy = use_chrome_proxy
33 class VideoStorySet(story.StorySet):
34 """Base class for Chrome proxy video tests."""
36 def __init__(self, mode):
37 super(VideoStorySet, self).__init__()
38 urls_list = [
39 'http://check.googlezip.net/cacheable/video/buck_bunny_tiny.html',
41 for url in urls_list:
42 self._AddStoryForURL(url)
44 def _AddStoryForURL(self, url):
45 raise NotImplementedError
48 class VideoDirectStorySet(VideoStorySet):
49 """Chrome proxy video tests: direct fetch."""
50 def __init__(self):
51 super(VideoDirectStorySet, self).__init__('direct')
53 def _AddStoryForURL(self, url):
54 self.AddStory(VideoPage(url, self, False))
57 class VideoProxiedStorySet(VideoStorySet):
58 """Chrome proxy video tests: proxied fetch."""
59 def __init__(self):
60 super(VideoProxiedStorySet, self).__init__('proxied')
62 def _AddStoryForURL(self, url):
63 self.AddStory(VideoPage(url, self, True))
66 class VideoCompareStorySet(VideoStorySet):
67 """Chrome proxy video tests: compare direct and proxied fetches."""
68 def __init__(self):
69 super(VideoCompareStorySet, self).__init__('compare')
71 def _AddStoryForURL(self, url):
72 self.AddStory(VideoPage(url, self, False))
73 self.AddStory(VideoPage(url, self, True))