1c47fbfef732fe271a24cdb151acef2779e5603d
[platform/framework/web/crosswalk.git] / src / tools / telemetry / telemetry / unittest / options_for_unittests.py
1 # Copyright 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 """This module provides the global variable options_for_unittests.
6
7 This is set to a BrowserOptions object by the test harness, or None
8 if unit tests are not running.
9
10 This allows multiple unit tests to use a specific
11 browser, in face of multiple options."""
12
13
14 _options = []
15
16
17 def Push(options):
18   _options.append(options)
19
20
21 def Pop():
22   return _options.pop()
23
24
25 def GetCopy():
26   if not AreSet():
27     return None
28   return _options[-1].Copy()
29
30
31 def AreSet():
32   return bool(_options)