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 7import inspect 8import logging 9import os 10import sys 11 12# Ensure Python >= 2.7. 13if sys.version_info < (2, 7): 14 print >> sys.stderr, 'Need Python 2.7 or greater.' 15 sys.exit(-1) 16 17from telemetry.util import global_hooks 18global_hooks.InstallHooks() 19 20from telemetry.core.browser import Browser 21from telemetry.core.browser_options import BrowserFinderOptions 22from telemetry.core.tab import Tab 23 24from telemetry.page.page_measurement import PageMeasurement 25from 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. 32for 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) 41