Index: infra/bots/recipe_modules/flavor/api.py |
diff --git a/infra/bots/recipe_modules/flavor/api.py b/infra/bots/recipe_modules/flavor/api.py |
index 83a3484bf7537a694d8aee846ffc91ad310144e5..b213647ae9251e332678d96f43a3a513a7951bdc 100644 |
--- a/infra/bots/recipe_modules/flavor/api.py |
+++ b/infra/bots/recipe_modules/flavor/api.py |
@@ -20,10 +20,12 @@ from . import xsan_flavor |
TEST_EXPECTED_SKP_VERSION = '42' |
+TEST_EXPECTED_SVG_VERSION = '42' |
TEST_EXPECTED_SK_IMAGE_VERSION = '42' |
VERSION_FILE_SK_IMAGE = 'SK_IMAGE_VERSION' |
VERSION_FILE_SKP = 'SKP_VERSION' |
+VERSION_FILE_SVG = 'SVG_VERSION' |
VERSION_NONE = -1 |
@@ -135,6 +137,7 @@ class SkiaFlavorApi(recipe_api.RecipeApi): |
self._copy_skps() |
self._copy_images() |
+ self._copy_svgs() |
def cleanup_steps(self): |
return self._f.cleanup_steps() |
@@ -211,3 +214,28 @@ class SkiaFlavorApi(recipe_api.RecipeApi): |
test_actual_version=self.m.properties.get( |
'test_downloaded_skp_version', TEST_EXPECTED_SKP_VERSION)) |
return version |
+ |
+ def _copy_svgs(self): |
+ """Download and copy the SVGs if needed.""" |
+ version_file = self.m.vars.infrabots_dir.join( |
+ 'assets', 'svg', 'VERSION') |
+ test_data = self.m.properties.get( |
+ 'test_downloaded_svg_version', TEST_EXPECTED_SVG_VERSION) |
+ version = self.m.run.readfile( |
+ version_file, |
+ name='Get downloaded SVG VERSION', |
+ test_data=test_data).rstrip() |
+ self.m.run.writefile( |
+ self.m.path.join(self.m.vars.tmp_dir, VERSION_FILE_SVG), |
+ version) |
+ self._copy_dir( |
+ version, |
+ VERSION_FILE_SVG, |
+ self.m.vars.tmp_dir, |
+ self.m.vars.local_svg_dir, |
+ self.device_dirs.svg_dir, |
+ test_expected_version=self.m.properties.get( |
+ 'test_downloaded_svg_version', TEST_EXPECTED_SVG_VERSION), |
+ test_actual_version=self.m.properties.get( |
+ 'test_downloaded_svg_version', TEST_EXPECTED_SVG_VERSION)) |
+ return version |