Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Unified Diff: tools/perf/benchmarks/benchmark_smoke_unittest.py

Issue 1428133005: [Telemetry] Allows concatenating multiple Disabled & Enabled decorators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Dave's comment Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/perf/benchmarks/blink_perf.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/benchmarks/benchmark_smoke_unittest.py
diff --git a/tools/perf/benchmarks/benchmark_smoke_unittest.py b/tools/perf/benchmarks/benchmark_smoke_unittest.py
index e8e7bd9c325b434bc73c21f89d37e4de3c1e7c7f..c0a7b012cea3c32ed24df954845034faccde41f2 100644
--- a/tools/perf/benchmarks/benchmark_smoke_unittest.py
+++ b/tools/perf/benchmarks/benchmark_smoke_unittest.py
@@ -137,23 +137,18 @@ def load_tests(loader, standard_tests, pattern):
# Merge decorators.
for attribute in ['_enabled_strings', '_disabled_strings']:
# Do set union of attributes to eliminate duplicates.
- merged_attributes = list(set(getattr(method, attribute, []) +
- getattr(benchmark, attribute, [])))
+ merged_attributes = getattr(method, attribute, set()).union(
+ getattr(benchmark, attribute, set()))
if merged_attributes:
setattr(method, attribute, merged_attributes)
- # Handle the case where the benchmark is Enabled/Disabled everywhere.
- if (getattr(method, attribute, None) == [] or
- getattr(benchmark, attribute, None) == []):
- setattr(method, attribute, [])
-
# Disable some tests on android platform only.
if sys.modules[benchmark.__module__] in _ANDROID_BLACK_LIST_MODULES:
- method._disabled_strings.append('android')
+ method._disabled_strings.add('android')
# TODO(bashi): Remove once crrev.com/1266833004 is landed.
if benchmark.Name() == 'memory.blink_memory_mobile':
- method._disabled_strings.append('android')
+ method._disabled_strings.add('android')
setattr(BenchmarkSmokeTest, benchmark.Name(), method)
« no previous file with comments | « no previous file | tools/perf/benchmarks/blink_perf.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698