File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ class Size(OrderedEnum):
6969
7070class ViewportProfile (Enum ):
7171 HUB_ROUND_SMALL = "HUB_ROUND_SMALL"
72+ HUB_LANDSCAPE_SMALL = "HUB_LANDSCAPE_SMALL"
7273 HUB_LANDSCAPE_MEDIUM = "HUB_LANDSCAPE_MEDIUM"
7374 HUB_LANDSCAPE_LARGE = "HUB_LANDSCAPE_LARGE"
7475 MOBILE_LANDSCAPE_SMALL = "MOBILE_LANDSCAPE_SMALL"
@@ -180,6 +181,13 @@ def get_viewport_profile(request_envelope):
180181 and pixel_height_size_group is Size .XSMALL ):
181182 return ViewportProfile .HUB_ROUND_SMALL
182183
184+ elif (shape is Shape .RECTANGLE
185+ and orientation is Orientation .LANDSCAPE
186+ and dpi_group is Density .LOW
187+ and pixel_width_size_group <= Size .MEDIUM
188+ and pixel_height_size_group <= Size .XSMALL ):
189+ return ViewportProfile .HUB_LANDSCAPE_SMALL
190+
183191 elif (shape is Shape .RECTANGLE
184192 and orientation is Orientation .LANDSCAPE
185193 and dpi_group is Density .LOW
Original file line number Diff line number Diff line change @@ -252,6 +252,20 @@ def test_viewport_map_to_hub_round_small(self):
252252 is viewport .ViewportProfile .HUB_ROUND_SMALL ), (
253253 "Viewport profile couldn't resolve HUB_ROUND_SMALL" )
254254
255+ def test_viewport_map_to_hub_landscape_small (self ):
256+ viewport_state = ViewportState (
257+ shape = Shape .RECTANGLE ,
258+ dpi = float (160 ),
259+ current_pixel_width = float (960 ),
260+ current_pixel_height = float (480 ))
261+ test_request_env = RequestEnvelope (
262+ context = Context (
263+ viewport = viewport_state ))
264+
265+ assert (viewport .get_viewport_profile (test_request_env )
266+ is viewport .ViewportProfile .HUB_LANDSCAPE_SMALL ), (
267+ "Viewport profile couldn't resolve HUB_LANDSCAPE_SMALL" )
268+
255269 def test_viewport_map_to_hub_landscape_medium (self ):
256270 viewport_state = ViewportState (
257271 shape = Shape .RECTANGLE ,
You can’t perform that action at this time.
0 commit comments