Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2016 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 from telemetry.page import page as page_module | |
| 5 from telemetry.page import shared_page_state | |
| 6 from telemetry import story | |
| 7 | |
| 8 | |
| 9 class _NoGpuSharedPageState(shared_page_state.SharedPageState): | |
| 10 def __init__(self, test, finder_options, story_set): | |
| 11 super(_NoGpuSharedPageState, self).__init__( | |
| 12 test, finder_options, story_set) | |
| 13 finder_options.browser_options.AppendExtraBrowserArgs( | |
| 14 ['--no-gpu']) | |
| 15 | |
| 16 | |
| 17 class _NoOverlaysSharedPageState(shared_page_state.SharedPageState): | |
| 18 def __init__(self, test, finder_options, story_set): | |
| 19 super(_NoOverlaysSharedPageState, self).__init__( | |
| 20 test, finder_options, story_set) | |
| 21 finder_options.browser_options.AppendExtraBrowserArgs( | |
| 22 ['--no-gpu']) | |
|
nednguyen
2016/06/06 18:07:23
Actually why is this flag the same as _NoGpuShared
erikchen
2016/06/06 18:10:20
copy paste error.
| |
| 23 | |
| 24 | |
| 25 class TrivialScrollingPage(page_module.Page): | |
| 26 | |
| 27 def __init__(self, page_set, shared_page_state_class): | |
| 28 super(TrivialScrollingPage, self).__init__( | |
| 29 url='file://trivial_sites/trivial_scrolling_page.html', | |
| 30 page_set=page_set, | |
| 31 name=self.__class__.__name__ + shared_page_state_class.__name__, | |
| 32 shared_page_state_class=shared_page_state_class) | |
| 33 | |
| 34 | |
| 35 class MacGpuTrivialScrollStorySet(story.StorySet): | |
| 36 | |
| 37 def __init__(self): | |
| 38 super(MacGpuTrivialScrollStorySet, self).__init__() | |
| 39 self.AddStory(TrivialScrollingPage(self, shared_page_state.SharedPageState)) | |
| 40 self.AddStory(TrivialScrollingPage(self, _NoOverlaysSharedPageState)) | |
| 41 self.AddStory(TrivialScrollingPage(self, _NoGpuSharedPageState)) | |
| 42 | |
| 43 @property | |
| 44 def allow_mixed_story_states(self): | |
| 45 # Return True here in order to be able to add the same tests with | |
| 46 # a different SharedPageState. | |
| 47 return True | |
| OLD | NEW |