Upstream version 8.37.180.0
[platform/framework/web/crosswalk.git] / src / tools / telemetry / telemetry / __init__.py
1 # Copyright 2013 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 """A library for cross-platform browser tests."""
6
7 import inspect
8 import logging
9 import os
10 import sys
11
12 # Ensure Python >= 2.7.
13 if sys.version_info < (2, 7):
14   print >> sys.stderr, 'Need Python 2.7 or greater.'
15   sys.exit(-1)
16
17 from telemetry.util import global_hooks
18 global_hooks.InstallHooks()
19
20 from telemetry.core.browser import Browser
21 from telemetry.core.browser_options import BrowserFinderOptions
22 from telemetry.core.tab import Tab
23
24 from telemetry.page.page_measurement import PageMeasurement
25 from telemetry.page.page_runner import Run as RunPage
26
27
28 __all__ = []
29
30 # Find all local vars that are classes or functions and make sure they're in the
31 # __all__ array so they're included in docs.
32 for x in dir():
33   if x.startswith('_'):
34     continue
35   if x in (inspect, os, sys):
36     continue
37   m = sys.modules[__name__]
38   if (inspect.isclass(getattr(m, x)) or
39       inspect.isfunction(getattr(m, x))):
40     __all__.append(x)