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

Unified Diff: tools/telemetry/telemetry/unittest/options_for_unittests.py

Issue 382433002: [telemetry] OutputFormatter for unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move RestoreLoggingLevel to the right place.s Created 6 years, 5 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: tools/telemetry/telemetry/unittest/options_for_unittests.py
diff --git a/tools/telemetry/telemetry/unittest/options_for_unittests.py b/tools/telemetry/telemetry/unittest/options_for_unittests.py
index 331e25017d5752f98b6f2fcf065bbf890a3b62ed..1c47fbfef732fe271a24cdb151acef2779e5603d 100644
--- a/tools/telemetry/telemetry/unittest/options_for_unittests.py
+++ b/tools/telemetry/telemetry/unittest/options_for_unittests.py
@@ -11,23 +11,22 @@ This allows multiple unit tests to use a specific
browser, in face of multiple options."""
-_options = None
+_options = []
-def Set(options):
- global _options
+def Push(options):
+ _options.append(options)
- _options = options
+
+def Pop():
+ return _options.pop()
def GetCopy():
- if not _options:
+ if not AreSet():
return None
-
- return _options.Copy()
+ return _options[-1].Copy()
def AreSet():
- if _options:
- return True
- return False
+ return bool(_options)

Powered by Google App Engine
This is Rietveld 408576698