1 # Copyright (c) 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.
5 """A library for cross-platform browser tests."""
11 from telemetry.core.browser import Browser
12 from telemetry.core.browser_options import BrowserFinderOptions
13 from telemetry.core.tab import Tab
15 from telemetry.page.page_measurement import PageMeasurement
16 from telemetry.page.page_runner import Run as RunPage
20 # Find all local vars that are classes or functions and make sure they're in the
21 # __all__ array so they're included in docs.
25 if x in (inspect, os, sys):
27 m = sys.modules[__name__]
28 if (inspect.isclass(getattr(m, x)) or
29 inspect.isfunction(getattr(m, x))):
33 def RemoveAllStalePycFiles(base_dir):
34 for dirname, _, filenames in os.walk(base_dir):
35 if '.svn' in dirname or '.git' in dirname:
37 for filename in filenames:
38 root, ext = os.path.splitext(filename)
42 pyc_path = os.path.join(dirname, filename)
43 py_path = os.path.join(dirname, root + '.py')
44 if os.path.exists(py_path):
50 # Avoid race, in case we're running simultaneous instances.
53 if os.listdir(dirname):
57 os.removedirs(dirname)
59 # Avoid race, in case we're running simultaneous instances.
63 RemoveAllStalePycFiles(os.path.dirname(__file__))