OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 | 5 |
6 # pylint: disable=W0201 | 6 # pylint: disable=W0201 |
7 | 7 |
8 | 8 |
9 from recipe_engine import recipe_api | 9 from recipe_engine import recipe_api |
10 | 10 |
11 from . import android_flavor | 11 from . import android_flavor |
12 from . import cmake_flavor | 12 from . import cmake_flavor |
13 from . import coverage_flavor | 13 from . import coverage_flavor |
14 from . import default_flavor | 14 from . import default_flavor |
15 from . import gn_android_flavor | 15 from . import gn_android_flavor |
16 from . import gn_flavor | 16 from . import gn_flavor |
17 from . import ios_flavor | 17 from . import ios_flavor |
18 from . import pdfium_flavor | 18 from . import pdfium_flavor |
19 from . import valgrind_flavor | 19 from . import valgrind_flavor |
20 from . import xsan_flavor | |
21 | 20 |
22 | 21 |
23 TEST_EXPECTED_SKP_VERSION = '42' | 22 TEST_EXPECTED_SKP_VERSION = '42' |
24 TEST_EXPECTED_SVG_VERSION = '42' | 23 TEST_EXPECTED_SVG_VERSION = '42' |
25 TEST_EXPECTED_SK_IMAGE_VERSION = '42' | 24 TEST_EXPECTED_SK_IMAGE_VERSION = '42' |
26 | 25 |
27 VERSION_FILE_SK_IMAGE = 'SK_IMAGE_VERSION' | 26 VERSION_FILE_SK_IMAGE = 'SK_IMAGE_VERSION' |
28 VERSION_FILE_SKP = 'SKP_VERSION' | 27 VERSION_FILE_SKP = 'SKP_VERSION' |
29 VERSION_FILE_SVG = 'SVG_VERSION' | 28 VERSION_FILE_SVG = 'SVG_VERSION' |
30 | 29 |
(...skipping 16 matching lines...) Expand all Loading... |
47 | 46 |
48 | 47 |
49 def is_pdfium(builder_cfg): | 48 def is_pdfium(builder_cfg): |
50 return 'PDFium' in builder_cfg.get('extra_config', '') | 49 return 'PDFium' in builder_cfg.get('extra_config', '') |
51 | 50 |
52 | 51 |
53 def is_valgrind(builder_cfg): | 52 def is_valgrind(builder_cfg): |
54 return 'Valgrind' in builder_cfg.get('extra_config', '') | 53 return 'Valgrind' in builder_cfg.get('extra_config', '') |
55 | 54 |
56 | 55 |
57 def is_xsan(builder_cfg): | |
58 return ('ASAN' in builder_cfg.get('extra_config', '') or | |
59 'MSAN' in builder_cfg.get('extra_config', '') or | |
60 'TSAN' in builder_cfg.get('extra_config', '')) | |
61 | |
62 | |
63 class SkiaFlavorApi(recipe_api.RecipeApi): | 56 class SkiaFlavorApi(recipe_api.RecipeApi): |
64 def get_flavor(self, builder_cfg): | 57 def get_flavor(self, builder_cfg): |
65 """Return a flavor utils object specific to the given builder.""" | 58 """Return a flavor utils object specific to the given builder.""" |
66 gn_android = gn_android_flavor.GNAndroidFlavorUtils(self.m) | 59 gn_android = gn_android_flavor.GNAndroidFlavorUtils(self.m) |
67 if gn_android.supported(): | 60 if gn_android.supported(): |
68 return gn_android | 61 return gn_android |
69 | 62 |
70 gn = gn_flavor.GNFlavorUtils(self.m) | 63 gn = gn_flavor.GNFlavorUtils(self.m) |
71 if gn.supported(): | 64 if gn.supported(): |
72 return gn | 65 return gn |
73 | 66 |
74 if is_android(builder_cfg): | 67 if is_android(builder_cfg): |
75 return android_flavor.AndroidFlavorUtils(self.m) | 68 return android_flavor.AndroidFlavorUtils(self.m) |
76 elif is_cmake(builder_cfg): | 69 elif is_cmake(builder_cfg): |
77 return cmake_flavor.CMakeFlavorUtils(self.m) | 70 return cmake_flavor.CMakeFlavorUtils(self.m) |
78 elif is_ios(builder_cfg): | 71 elif is_ios(builder_cfg): |
79 return ios_flavor.iOSFlavorUtils(self.m) | 72 return ios_flavor.iOSFlavorUtils(self.m) |
80 elif is_pdfium(builder_cfg): | 73 elif is_pdfium(builder_cfg): |
81 return pdfium_flavor.PDFiumFlavorUtils(self.m) | 74 return pdfium_flavor.PDFiumFlavorUtils(self.m) |
82 elif is_valgrind(builder_cfg): | 75 elif is_valgrind(builder_cfg): |
83 return valgrind_flavor.ValgrindFlavorUtils(self.m) | 76 return valgrind_flavor.ValgrindFlavorUtils(self.m) |
84 elif is_xsan(builder_cfg): | |
85 return xsan_flavor.XSanFlavorUtils(self.m) | |
86 elif builder_cfg.get('configuration') == 'Coverage': | 77 elif builder_cfg.get('configuration') == 'Coverage': |
87 return coverage_flavor.CoverageFlavorUtils(self.m) | 78 return coverage_flavor.CoverageFlavorUtils(self.m) |
88 else: | 79 else: |
89 return default_flavor.DefaultFlavorUtils(self.m) | 80 return default_flavor.DefaultFlavorUtils(self.m) |
90 | 81 |
91 def setup(self): | 82 def setup(self): |
92 self._f = self.get_flavor(self.m.vars.builder_cfg) | 83 self._f = self.get_flavor(self.m.vars.builder_cfg) |
93 | 84 |
94 def step(self, name, cmd, **kwargs): | 85 def step(self, name, cmd, **kwargs): |
95 return self._f.step(name, cmd, **kwargs) | 86 return self._f.step(name, cmd, **kwargs) |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 version, | 226 version, |
236 VERSION_FILE_SVG, | 227 VERSION_FILE_SVG, |
237 self.m.vars.tmp_dir, | 228 self.m.vars.tmp_dir, |
238 self.m.vars.local_svg_dir, | 229 self.m.vars.local_svg_dir, |
239 self.device_dirs.svg_dir, | 230 self.device_dirs.svg_dir, |
240 test_expected_version=self.m.properties.get( | 231 test_expected_version=self.m.properties.get( |
241 'test_downloaded_svg_version', TEST_EXPECTED_SVG_VERSION), | 232 'test_downloaded_svg_version', TEST_EXPECTED_SVG_VERSION), |
242 test_actual_version=self.m.properties.get( | 233 test_actual_version=self.m.properties.get( |
243 'test_downloaded_svg_version', TEST_EXPECTED_SVG_VERSION)) | 234 'test_downloaded_svg_version', TEST_EXPECTED_SVG_VERSION)) |
244 return version | 235 return version |
OLD | NEW |