tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_instance_factory.py (1240B)


      1 # Copyright 2014 The Chromium Authors
      2 # Use of this source code is governed by a BSD-style license that can be
      3 # found in the LICENSE file.
      4 
      5 
      6 from pylib.gtest import gtest_test_instance
      7 from pylib.hostside import hostside_test_instance
      8 from pylib.instrumentation import instrumentation_test_instance
      9 from pylib.junit import junit_test_instance
     10 from pylib.monkey import monkey_test_instance
     11 from pylib.utils import device_dependencies
     12 
     13 
     14 def CreateTestInstance(args, error_func):
     15 
     16  if args.command == 'gtest':
     17    return gtest_test_instance.GtestTestInstance(
     18        args, device_dependencies.GetDataDependencies, error_func)
     19  if args.command == 'hostside':
     20    return hostside_test_instance.HostsideTestInstance(
     21        args, error_func)
     22  if args.command == 'instrumentation':
     23    return instrumentation_test_instance.InstrumentationTestInstance(
     24        args, device_dependencies.GetDataDependencies, error_func)
     25  if args.command == 'junit':
     26    return junit_test_instance.JunitTestInstance(args, error_func)
     27  if args.command == 'monkey':
     28    return monkey_test_instance.MonkeyTestInstance(args, error_func)
     29 
     30  error_func('Unable to create %s test instance.' % args.command)
     31  raise RuntimeError('error_func must call exit inside.')