testing/mozbase/mozrunner/tests/mozrunnertest.py

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/testing/mozbase/mozrunner/tests/mozrunnertest.py	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,33 @@
     1.4 +# This Source Code Form is subject to the terms of the Mozilla Public
     1.5 +# License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.6 +# You can obtain one at http://mozilla.org/MPL/2.0/.
     1.7 +
     1.8 +import os
     1.9 +import unittest
    1.10 +
    1.11 +import mozprofile
    1.12 +import mozrunner
    1.13 +
    1.14 +
    1.15 +@unittest.skipIf(not os.environ.get('BROWSER_PATH'),
    1.16 +                 'No binary has been specified.')
    1.17 +class MozrunnerTestCase(unittest.TestCase):
    1.18 +
    1.19 +    def setUp(self):
    1.20 +        self.pids = []
    1.21 +        self.threads = [ ]
    1.22 +
    1.23 +        self.profile = mozprofile.FirefoxProfile()
    1.24 +        self.runner = mozrunner.FirefoxRunner(self.profile)
    1.25 +
    1.26 +    def tearDown(self):
    1.27 +        for thread in self.threads:
    1.28 +            thread.join()
    1.29 +
    1.30 +        self.runner.cleanup()
    1.31 +
    1.32 +        # Clean-up any left over and running processes
    1.33 +        for pid in self.pids:
    1.34 +            # TODO: Bug 925408
    1.35 +            # mozprocess is not able yet to kill specific processes
    1.36 +            pass

mercurial