Skip to content

Commit

Permalink
Add fonts to VariantGrid params and default Variant params
Browse files Browse the repository at this point in the history
For fonts to be loaded from the templates for single-file test grids,
they must be visible from the grid as a whole, and they must be
aggregated for cases with different fonts declared in different
variants.

This change adds the `fonts` param to grids using `_param_set`, creates
it as an empty list when initializing a default variant.

In a follow-up CL in the stack, a test is created that requires the
loading of fonts and uses single-file variant grids.

Bug: 341213359
Change-Id: Id6d83d26ab4cfa9a98747d573926fc40a24ab565
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5635554
Reviewed-by: Jean-Philippe Gravel <[email protected]>
Commit-Queue: Andres Ricardo Perez <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1322188}
  • Loading branch information
AndresRPerez12 authored and pull[bot] committed Nov 18, 2024
1 parent 07a4a5c commit 1450302
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions html/canvas/tools/gentestutilsunion.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ def create_with_defaults(test: _TestParams) -> '_Variant':
'variant_name': '',
'images': [],
'svgimages': [],
'fonts': [],
}
params.update(test)
return _Variant(params)
Expand Down Expand Up @@ -639,6 +640,7 @@ def _get_grid_params(self) -> _TestParams:
'notes': self._unique_param('notes'),
'images': self._param_set('images'),
'svgimages': self._param_set('svgimages'),
'fonts': self._param_set('fonts'),
}
if self.template_type in (_TemplateType.REFERENCE,
_TemplateType.HTML_REFERENCE):
Expand Down

0 comments on commit 1450302

Please sign in to comment.