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

Unified Diff: content/test/gpu/gpu_tests/gpu_test_expectations.py

Issue 2400373002: Fix GpuRasterization.BlueBox expectation. (Closed)
Patch Set: Slight cleanup. Created 4 years, 2 months 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
Index: content/test/gpu/gpu_tests/gpu_test_expectations.py
diff --git a/content/test/gpu/gpu_tests/gpu_test_expectations.py b/content/test/gpu/gpu_tests/gpu_test_expectations.py
index dd4a2385e11dd0fac5854e72b05a378819c05c88..9df6f00736c167bfa7fae30e4b28016f22c79483 100644
--- a/content/test/gpu/gpu_tests/gpu_test_expectations.py
+++ b/content/test/gpu/gpu_tests/gpu_test_expectations.py
@@ -43,7 +43,22 @@ class GpuExpectation(test_expectations.Expectation):
if isinstance(condition, tuple):
c0 = condition[0].lower()
if c0 in GPU_CONDITIONS:
- self.device_id_conditions.append((c0, condition[1]))
+ device = condition[1]
+ if isinstance(device, str):
+ # If the device is parseable as an int, that's not allowed.
+ # It's too easy to make a mistake specifying the device ID
+ # as a string instead of an int.
+ was_int = False
+ try:
+ int(device, 0)
+ was_int = True
+ except Exception:
+ pass
+ if was_int:
+ raise ValueError(
+ 'Device id %s should have been specified as an integer' %
+ condition[1])
+ self.device_id_conditions.append((c0, device))
else:
raise ValueError('Unknown expectation condition: "%s"' % c0)
else:

Powered by Google App Engine
This is Rietveld 408576698