Commit 4671c00c authored by Amy Qiu's avatar Amy Qiu Committed by Commit Bot

Merge tough_pinch_zoom_cases into rendering page sets

Move tough_pinch_zoom_cases into the rendering folder and refactor to
inherit from RenderingStory

Bug: 849392
Change-Id: I6496aacc50aa730843d677e73c89f3025b0799ba
Reviewed-on: https://chromium-review.googlesource.com/1087726
Commit-Queue: Amy Qiu <amyqiu@google.com>
Reviewed-by: default avatarNed Nguyen <nednguyen@google.com>
Cr-Commit-Position: refs/heads/master@{#564941}
parent 6e373bd3
...@@ -168,6 +168,7 @@ crbug.com/653993 [ Android_Webview ] rendering.mobile/maps_perf_test [ Skip ] ...@@ -168,6 +168,7 @@ crbug.com/653993 [ Android_Webview ] rendering.mobile/maps_perf_test [ Skip ]
[ All ] rendering.mobile/paper_shadow [ Skip ] # Polymer test, needs to be modernized. [ All ] rendering.mobile/paper_shadow [ Skip ] # Polymer test, needs to be modernized.
[ All ] rendering.mobile/paper_tabs [ Skip ] # Polymer test, needs to be modernized. [ All ] rendering.mobile/paper_tabs [ Skip ] # Polymer test, needs to be modernized.
[ All ] rendering.mobile/paper_toggle_button [ Skip ] # Polymer test, needs to be modernized. [ All ] rendering.mobile/paper_toggle_button [ Skip ] # Polymer test, needs to be modernized.
crbug.com/822925 [ Android_Webview ] rendering.mobile/yahoo_games_pinch [ Skip ]
# Benchmark: smoothness.gpu_rasterization.polymer # Benchmark: smoothness.gpu_rasterization.polymer
[ All ] smoothness.gpu_rasterization.polymer/* [ Skip ] # Test needs to be modernized. [ All ] smoothness.gpu_rasterization.polymer/* [ Skip ] # Test needs to be modernized.
......
...@@ -203,6 +203,60 @@ ...@@ -203,6 +203,60 @@
}, },
"many_planets_deep": { "many_planets_deep": {
"DEFAULT": "tough_webgl_cases_006.wprgo" "DEFAULT": "tough_webgl_cases_006.wprgo"
},
"blogspot_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"espn_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"facebook_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"linkedin_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"twitter_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"weather_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"booking_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"yahoo_games_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"yahoo_news_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"yahoo_sports_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"amazon_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"cnn_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"ebay_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"youtube_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"gmail_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"google_search_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"google_calendar_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"google_image_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
} }
}, },
"description": "Describes the Web Page Replay archives for a story set. Don't edit by hand! Use record_wpr for updating.", "description": "Describes the Web Page Replay archives for a story set. Don't edit by hand! Use record_wpr for updating.",
......
...@@ -590,6 +590,60 @@ ...@@ -590,6 +590,60 @@
}, },
"paper_toggle_button": { "paper_toggle_button": {
"DEFAULT": "polymer_001.wprgo" "DEFAULT": "polymer_001.wprgo"
},
"blogspot_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"espn_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"facebook_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"linkedin_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"twitter_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"weather_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"booking_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"yahoo_games_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"yahoo_news_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"yahoo_sports_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"amazon_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"cnn_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"ebay_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"youtube_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"gmail_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"google_search_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"google_calendar_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
},
"google_image_pinch": {
"DEFAULT": "tough_pinch_zoom_cases_000.wprgo"
} }
}, },
"description": "Describes the Web Page Replay archives for a story set. Don't edit by hand! Use record_wpr for updating.", "description": "Describes the Web Page Replay archives for a story set. Don't edit by hand! Use record_wpr for updating.",
......
...@@ -9,6 +9,12 @@ from telemetry.page import shared_page_state ...@@ -9,6 +9,12 @@ from telemetry.page import shared_page_state
class RenderingSharedState(shared_page_state.SharedPageState): class RenderingSharedState(shared_page_state.SharedPageState):
def CanRunOnBrowser(self, browser_info, page): def CanRunOnBrowser(self, browser_info, page):
if page.TAGS and story_tags.PINCH_ZOOM in page.TAGS:
os_name = self.platform.GetOSName()
if os_name == 'linux' or os_name == 'win':
logging.warning('Pinch zoom pages only for Mac, skipping test')
return False
if page.TAGS and story_tags.REQUIRED_WEBGL in page.TAGS: if page.TAGS and story_tags.REQUIRED_WEBGL in page.TAGS:
assert hasattr(page, 'skipped_gpus') assert hasattr(page, 'skipped_gpus')
......
...@@ -19,6 +19,8 @@ FASTPATH = Tag( ...@@ -19,6 +19,8 @@ FASTPATH = Tag(
'fastpath', 'Fast path stories.') 'fastpath', 'Fast path stories.')
REQUIRED_WEBGL = Tag( REQUIRED_WEBGL = Tag(
'required_webgl', 'Stories that are skipped if no webgl support') 'required_webgl', 'Stories that are skipped if no webgl support')
PINCH_ZOOM = Tag(
'pinch_zoom', 'Stories that only run on Mac for desktop cases')
def _ExtractAllTags(): def _ExtractAllTags():
......
# Copyright 2014 The Chromium Authors. All rights reserved. # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
from telemetry.page import page as page_module
from telemetry.page import shared_page_state from telemetry.page import shared_page_state
from telemetry import story from telemetry import story
from page_sets.rendering import rendering_shared_state
class ToughPinchZoomCasesPage(page_module.Page): from page_sets.rendering import rendering_story
from page_sets.rendering import story_tags
def __init__(self, url, page_set, name):
super(ToughPinchZoomCasesPage, self).__init__(
url=url, page_set=page_set, name=name, class ToughPinchZoomPage(rendering_story.RenderingStory):
shared_page_state_class=shared_page_state.SharedDesktopPageState) ABSTRACT_STORY = True
self.target_scale_factor = page_set.target_scale_factor TAGS = [story_tags.GPU_RASTERIZATION, story_tags.PINCH_ZOOM]
def __init__(self,
page_set,
name_suffix='',
extra_browser_args=None,
shared_page_state_class=shared_page_state.SharedDesktopPageState):
super(ToughPinchZoomPage, self).__init__(
page_set=page_set,
name_suffix=name_suffix,
extra_browser_args=extra_browser_args,
shared_page_state_class=shared_page_state_class)
# The maximum Android zoom level is chosen as 7x, which may seem to exceed
# the 5x value specified in WebPreferences::default_maximum_page_scale_factor.
# However, as desktop sites on Android start at less than 1x scale
# (up to 0.25x), a value of 7x does not exceed the 5x limit.
if self.IsMobilePlatform(shared_page_state_class):
self.target_scale_factor = 7.0
# The maximum Desktop zoom level is 4x
else:
self.target_scale_factor = 4.0
def IsMobilePlatform(self, shared_page_state_class):
return (shared_page_state_class ==
rendering_shared_state.MobileRenderingSharedState)
def RunPinchGesture(self, action_runner, left_anchor_ratio=0.5, def RunPinchGesture(self, action_runner, left_anchor_ratio=0.5,
top_anchor_ratio=0.5, scale_factor=None, top_anchor_ratio=0.5, scale_factor=None,
...@@ -34,247 +58,266 @@ class ToughPinchZoomCasesPage(page_module.Page): ...@@ -34,247 +58,266 @@ class ToughPinchZoomCasesPage(page_module.Page):
current_scale_factor *= 1/2.0 current_scale_factor *= 1/2.0
self.RunPinchGesture(action_runner, scale_factor=1/2.0) self.RunPinchGesture(action_runner, scale_factor=1/2.0)
class GoogleSearchPage(ToughPinchZoomCasesPage): class GoogleSearchPinchZoomPage(ToughPinchZoomPage):
""" Why: top google property; a google tab is often open. """ """ Why: top google property; a google tab is often open. """
def __init__(self, page_set): BASE_NAME = 'google_search_pinch'
super(GoogleSearchPage, self).__init__( URL = 'https://www.google.com/#hl=en&q=barack+obama'
name='google_search_pinch',
url='https://www.google.com/#hl=en&q=barack+obama',
page_set=page_set)
def RunNavigateSteps(self, action_runner): def RunNavigateSteps(self, action_runner):
super(GoogleSearchPage, self).RunNavigateSteps(action_runner) super(GoogleSearchPinchZoomPage, self).RunNavigateSteps(action_runner)
action_runner.WaitForElement(text='Next') action_runner.WaitForElement(text='Next')
class GmailPage(ToughPinchZoomCasesPage): class GmailPinchZoomPage(ToughPinchZoomPage):
""" Why: productivity, top google properties """ """ Why: productivity, top google properties """
def __init__(self, page_set): BASE_NAME = 'gmail_pinch'
super(GmailPage, self).__init__( URL = 'https://mail.google.com/mail/'
name='gmail_pinch',
url='https://mail.google.com/mail/',
page_set=page_set)
def RunNavigateSteps(self, action_runner): def RunNavigateSteps(self, action_runner):
super(GmailPage, self).RunNavigateSteps(action_runner) super(GmailPinchZoomPage, self).RunNavigateSteps(action_runner)
action_runner.WaitForJavaScriptCondition( action_runner.WaitForJavaScriptCondition(
'window.gmonkey !== undefined &&' 'window.gmonkey !== undefined &&'
'document.getElementById("gb") !== null') 'document.getElementById("gb") !== null')
class GoogleCalendarPage(ToughPinchZoomCasesPage): class GoogleCalendarPinchZoomPage(ToughPinchZoomPage):
""" Why: productivity, top google properties """ """ Why: productivity, top google properties """
def __init__(self, page_set): BASE_NAME = 'google_calendar_pinch'
super(GoogleCalendarPage, self).__init__( URL = 'https://www.google.com/calendar/'
name='google_calendar_pinch',
url='https://www.google.com/calendar/',
page_set=page_set)
def RunNavigateSteps(self, action_runner): def RunNavigateSteps(self, action_runner):
super(GoogleCalendarPage, self).RunNavigateSteps(action_runner) super(GoogleCalendarPinchZoomPage, self).RunNavigateSteps(action_runner)
action_runner.Wait(2) action_runner.Wait(2)
class GoogleImageSearchPage(ToughPinchZoomCasesPage):
class GoogleImagePinchZoomPage(ToughPinchZoomPage):
""" Why: tough image case; top google properties """ """ Why: tough image case; top google properties """
def __init__(self, page_set): BASE_NAME = 'google_image_pinch'
super(GoogleImageSearchPage, self).__init__( URL = 'https://www.google.com/search?q=cats&tbm=isch'
name='google_image_pinch',
url='https://www.google.com/search?q=cats&tbm=isch',
page_set=page_set)
class YoutubePage(ToughPinchZoomCasesPage): class YoutubePinchZoomPage(ToughPinchZoomPage):
""" Why: #3 (Alexa global) """ """ Why: #3 (Alexa global) """
def __init__(self, page_set): BASE_NAME = 'youtube_pinch'
super(YoutubePage, self).__init__( URL = 'http://www.youtube.com'
name='youtube_pinch',
url='http://www.youtube.com',
page_set=page_set)
def RunNavigateSteps(self, action_runner): def RunNavigateSteps(self, action_runner):
super(YoutubePage, self).RunNavigateSteps(action_runner) super(YoutubePinchZoomPage, self).RunNavigateSteps(action_runner)
action_runner.Wait(2) action_runner.Wait(2)
class BlogSpotPage(ToughPinchZoomCasesPage):
class BlogSpotPinchZoomPage(ToughPinchZoomPage):
""" """
Why: #11 (Alexa global), google property; some blogger layouts have infinite Why: #11 (Alexa global), google property; some blogger layouts have infinite
scroll but more interesting scroll but more interesting
""" """
def __init__(self, page_set): BASE_NAME = 'blogspot_pinch'
super(BlogSpotPage, self).__init__( URL = 'http://googlewebmastercentral.blogspot.com/'
name='blogspot_pinch',
url='http://googlewebmastercentral.blogspot.com/',
page_set=page_set)
def RunNavigateSteps(self, action_runner): def RunNavigateSteps(self, action_runner):
super(BlogSpotPage, self).RunNavigateSteps(action_runner) super(BlogSpotPinchZoomPage, self).RunNavigateSteps(action_runner)
action_runner.WaitForElement(text='accessibility') action_runner.WaitForElement(text='accessibility')
class FacebookPage(ToughPinchZoomCasesPage): class FacebookPinchZoomPage(ToughPinchZoomPage):
""" Why: top social,Public profile """ """ Why: top social,Public profile """
def __init__(self, page_set): BASE_NAME = 'facebook_pinch'
super(FacebookPage, self).__init__( URL = 'http://www.facebook.com/barackobama'
name='facebook_pinch',
url='http://www.facebook.com/barackobama',
page_set=page_set)
def RunNavigateSteps(self, action_runner): def RunNavigateSteps(self, action_runner):
super(FacebookPage, self).RunNavigateSteps(action_runner) super(FacebookPinchZoomPage, self).RunNavigateSteps(action_runner)
action_runner.WaitForElement(text='About') action_runner.WaitForElement(text='About')
class LinkedinPage(ToughPinchZoomCasesPage): class LinkedinPinchZoomPage(ToughPinchZoomPage):
""" Why: #12 (Alexa global),Public profile """ """ Why: #12 (Alexa global),Public profile """
def __init__(self, page_set): BASE_NAME = 'linkedin_pinch'
super(LinkedinPage, self).__init__( URL = 'http://www.linkedin.com/in/linustorvalds'
name='linkedin_pinch',
url='http://www.linkedin.com/in/linustorvalds',
page_set=page_set)
class TwitterPage(ToughPinchZoomCasesPage): class TwitterPinchZoomPage(ToughPinchZoomPage):
""" Why: #8 (Alexa global),Picked an interesting page """ """ Why: #8 (Alexa global),Picked an interesting page """
def __init__(self, page_set): BASE_NAME = 'twitter_pinch'
super(TwitterPage, self).__init__( URL = 'https://twitter.com/katyperry'
name='twitter_pinch',
url='https://twitter.com/katyperry',
page_set=page_set)
def RunNavigateSteps(self, action_runner): def RunNavigateSteps(self, action_runner):
super(TwitterPage, self).RunNavigateSteps(action_runner) super(TwitterPinchZoomPage, self).RunNavigateSteps(action_runner)
action_runner.Wait(2) action_runner.Wait(2)
class ESPNPage(ToughPinchZoomCasesPage):
class ESPNPinchZoomPage(ToughPinchZoomPage):
""" Why: #1 sports """ """ Why: #1 sports """
def __init__(self, page_set): BASE_NAME = 'espn_pinch'
super(ESPNPage, self).__init__( URL = 'http://espn.go.com/nba'
name='espn_pinch',
url='http://espn.go.com/nba',
page_set=page_set)
class WeatherDotComPage(ToughPinchZoomCasesPage): class WeatherDotComPinchZoomPage(ToughPinchZoomPage):
""" Why: #7 (Alexa news); #27 total time spent,Picked interesting page """ """ Why: #7 (Alexa news); #27 total time spent,Picked interesting page """
def __init__(self, page_set): BASE_NAME = 'weather_pinch'
super(WeatherDotComPage, self).__init__( URL = 'http://www.weather.com/weather/right-now/Mountain+View+CA+94043'
name='weather_pinch',
# pylint: disable=line-too-long
url='http://www.weather.com/weather/right-now/Mountain+View+CA+94043',
page_set=page_set)
class YahooGamePage(ToughPinchZoomCasesPage): class YahooGamePinchZoomPage(ToughPinchZoomPage):
""" Why: #1 games according to Alexa (with actual games in it) """ """ Why: #1 games according to Alexa (with actual games in it) """
def __init__(self, page_set): BASE_NAME = 'yahoo_games_pinch'
super(YahooGamePage, self).__init__( URL = 'http://games.yahoo.com'
name='yahoo_games_pinch',
url='http://games.yahoo.com',
page_set=page_set)
def RunNavigateSteps(self, action_runner): def RunNavigateSteps(self, action_runner):
super(YahooGamePage, self).RunNavigateSteps(action_runner) super(YahooGamePinchZoomPage, self).RunNavigateSteps(action_runner)
action_runner.Wait(2) action_runner.Wait(2)
class YahooNewsPinchZoomPage(ToughPinchZoomPage):
""" Why: #1 news worldwide (Alexa global) """
BASE_NAME = 'yahoo_news_pinch'
URL = 'http://news.yahoo.com'
class CnnPinchZoomPage(ToughPinchZoomPage):
""" Why: #2 news worldwide """
BASE_NAME = 'cnn_pinch'
URL = 'http://www.cnn.com'
class AmazonPinchZoomPage(ToughPinchZoomPage):
"""
Why: #1 world commerce website by visits; #3 commerce in the US by
time spent
"""
BASE_NAME = 'amazon_pinch'
URL = 'http://www.amazon.com'
class EBayPinchZoomPage(ToughPinchZoomPage):
""" Why: #1 commerce website by time spent by users in US"""
BASE_NAME = 'ebay_pinch'
URL = 'http://www.ebay.com'
class BookingPinchZoomPage(ToughPinchZoomPage):
""" Why: #1 Alexa recreation"""
BASE_NAME = 'booking_pinch'
URL = 'http://booking.com'
class YahooSportsPinchZoomPage(ToughPinchZoomPage):
""" Why: #1 Alexa sports"""
BASE_NAME = 'yahoo_sports_pinch'
URL = 'http://sports.yahoo.com/'
# TODO(crbug.com/760553):remove this class after
# smoothness.tough_pinch_zoom_cases benchmark is completely
# replaced by rendering benchmarks
class ToughPinchZoomCasesPageSet(story.StorySet): class ToughPinchZoomCasesPageSet(story.StorySet):
""" Set of pages that are tricky to pinch-zoom """ """ Set of pages that are tricky to pinch-zoom """
def __init__(self, target_scale_factor): def __init__(self, shared_page_state_class):
super(ToughPinchZoomCasesPageSet, self).__init__( super(ToughPinchZoomCasesPageSet, self).__init__(
archive_data_file='data/tough_pinch_zoom_cases.json', archive_data_file='../data/tough_pinch_zoom_cases.json',
cloud_storage_bucket=story.PARTNER_BUCKET) cloud_storage_bucket=story.PARTNER_BUCKET)
self.target_scale_factor = target_scale_factor self.AddStory(GoogleSearchPinchZoomPage(
page_set=self,
self.AddStory(GoogleSearchPage(self)) shared_page_state_class=shared_page_state_class))
self.AddStory(GmailPage(self)) self.AddStory(GmailPinchZoomPage(
self.AddStory(GoogleCalendarPage(self)) page_set=self,
self.AddStory(GoogleImageSearchPage(self)) shared_page_state_class=shared_page_state_class))
self.AddStory(YoutubePage(self)) self.AddStory(GoogleCalendarPinchZoomPage(
self.AddStory(BlogSpotPage(self)) page_set=self,
self.AddStory(FacebookPage(self)) shared_page_state_class=shared_page_state_class))
self.AddStory(LinkedinPage(self)) self.AddStory(GoogleImagePinchZoomPage(
self.AddStory(TwitterPage(self)) page_set=self,
self.AddStory(ESPNPage(self)) shared_page_state_class=shared_page_state_class))
self.AddStory(YoutubePinchZoomPage(
# Why: #1 news worldwide (Alexa global) page_set=self,
self.AddStory(ToughPinchZoomCasesPage(url='http://news.yahoo.com', shared_page_state_class=shared_page_state_class))
page_set=self, self.AddStory(BlogSpotPinchZoomPage(
name='yahoo_news_pinch')) page_set=self,
# Why: #2 news worldwide shared_page_state_class=shared_page_state_class))
self.AddStory(ToughPinchZoomCasesPage(url='http://www.cnn.com', self.AddStory(FacebookPinchZoomPage(
page_set=self, page_set=self,
name='cnn_pinch')) shared_page_state_class=shared_page_state_class))
self.AddStory(LinkedinPinchZoomPage(
self.AddStory(WeatherDotComPage(self)) page_set=self,
shared_page_state_class=shared_page_state_class))
# Why: #1 world commerce website by visits; #3 commerce in the US by time self.AddStory(TwitterPinchZoomPage(
# spent page_set=self,
self.AddStory(ToughPinchZoomCasesPage(url='http://www.amazon.com', shared_page_state_class=shared_page_state_class))
page_set=self, self.AddStory(ESPNPinchZoomPage(
name='amazon_pinch')) page_set=self,
shared_page_state_class=shared_page_state_class))
# Why: #1 commerce website by time spent by users in US self.AddStory(YahooGamePinchZoomPage(
self.AddStory(ToughPinchZoomCasesPage(url='http://www.ebay.com', page_set=self,
page_set=self, shared_page_state_class=shared_page_state_class))
name='ebay_pinch')) self.AddStory(YahooNewsPinchZoomPage(
page_set=self,
self.AddStory(YahooGamePage(self)) shared_page_state_class=shared_page_state_class))
self.AddStory(CnnPinchZoomPage(
# Why: #1 Alexa recreation page_set=self,
self.AddStory(ToughPinchZoomCasesPage(url='http://booking.com', shared_page_state_class=shared_page_state_class))
page_set=self, self.AddStory(AmazonPinchZoomPage(
name='booking_pinch')) page_set=self,
shared_page_state_class=shared_page_state_class))
# Why: #1 Alexa sports self.AddStory(EBayPinchZoomPage(
self.AddStory(ToughPinchZoomCasesPage(url='http://sports.yahoo.com/', page_set=self,
page_set=self, shared_page_state_class=shared_page_state_class))
name='yahoo_sports_pinch')) self.AddStory(WeatherDotComPinchZoomPage(
page_set=self,
shared_page_state_class=shared_page_state_class))
self.AddStory(YahooSportsPinchZoomPage(
page_set=self,
shared_page_state_class=shared_page_state_class))
self.AddStory(BookingPinchZoomPage(
page_set=self,
shared_page_state_class=shared_page_state_class))
class AndroidToughPinchZoomCasesPageSet(ToughPinchZoomCasesPageSet): class AndroidToughPinchZoomCasesPageSet(ToughPinchZoomCasesPageSet):
"""
ToughPinchZoomCasesPageSet using the maximum Android zoom level. This is
chosen as 7x, which may seem to exceed the 5x value specified in
WebPreferences::default_maximum_page_scale_factor. However, as desktop sites
on Android start at less than 1x scale (up to 0.25x), a value of 7x does not
exceed the 5x limit.
"""
def __init__(self): def __init__(self):
super(AndroidToughPinchZoomCasesPageSet, self).__init__(7.0) super(AndroidToughPinchZoomCasesPageSet, self).__init__(
rendering_shared_state.MobileRenderingSharedState)
class DesktopToughPinchZoomCasesPageSet(ToughPinchZoomCasesPageSet): class DesktopToughPinchZoomCasesPageSet(ToughPinchZoomCasesPageSet):
""" ToughPinchZoomCasesPageSet using the maximum desktop zoom level """
def __init__(self): def __init__(self):
super(DesktopToughPinchZoomCasesPageSet, self).__init__(4.0) super(DesktopToughPinchZoomCasesPageSet, self).__init__(
rendering_shared_state.DesktopRenderingSharedState)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment