1 # Copyright (c) 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.
5 """PyAuto media test base. Handles PyAuto initialization and path setup.
7 Required to ensure each media test can load the appropriate libraries. Each
8 test must include this snippet:
10 # This should be at the top
15 # This should be at the bottom.
16 if __name__ == '__main__':
25 """Add paths required for loading PyAuto and other utilities to sys.path."""
26 media_dir = os.path.abspath(os.path.dirname(__file__))
27 sys.path.append(media_dir)
28 sys.path.append(os.path.normpath(os.path.join(media_dir, os.pardir)))
30 # Add psutil library path.
31 # TODO(dalecurtis): This should only be added for tests which use psutil.
32 sys.path.append(os.path.normpath(os.path.join(
33 media_dir, os.pardir, os.pardir, os.pardir, os.pardir,
34 'third_party', 'psutil')))
40 import pyauto_functional
41 Main = pyauto_functional.Main