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

Unified Diff: tools/testrunner/local/utils.py

Issue 2203013002: [test] Enable test status filtering by variant (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Nits Created 4 years, 4 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
« no previous file with comments | « tools/testrunner/local/testsuite_unittest.py ('k') | tools/testrunner/local/variants.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testrunner/local/utils.py
diff --git a/tools/testrunner/local/utils.py b/tools/testrunner/local/utils.py
index c880dfc34ebd83dc465efe5d9166559e442e8566..3e79e44afa22bff5fb623d1cb5451b5d9cf04b81 100644
--- a/tools/testrunner/local/utils.py
+++ b/tools/testrunner/local/utils.py
@@ -136,3 +136,24 @@ def URLRetrieve(source, destination):
pass
with open(destination, 'w') as f:
f.write(urllib2.urlopen(source).read())
+
+
+class FrozenDict(dict):
+ def __setitem__(self, *args, **kwargs):
+ raise Exception('Tried to mutate a frozen dict')
+
+ def update(self, *args, **kwargs):
+ raise Exception('Tried to mutate a frozen dict')
+
+
+def Freeze(obj):
+ if isinstance(obj, dict):
+ return FrozenDict((k, Freeze(v)) for k, v in obj.iteritems())
+ elif isinstance(obj, set):
+ return frozenset(obj)
+ elif isinstance(obj, list):
+ return tuple(Freeze(item) for item in obj)
+ else:
+ # Make sure object is hashable.
+ hash(obj)
+ return obj
« no previous file with comments | « tools/testrunner/local/testsuite_unittest.py ('k') | tools/testrunner/local/variants.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698