summaryrefslogtreecommitdiffstats
path: root/testing/marionette/harness/marionette_harness/tests/unit/test_teardown_context_preserved.py
blob: 59653393c860c3feb852b69041a4af2c7b2e9cab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from marionette_harness import MarionetteTestCase, SkipTest


class TestTearDownContext(MarionetteTestCase):
    def setUp(self):
        MarionetteTestCase.setUp(self)
        self.marionette.set_context(self.marionette.CONTEXT_CHROME)

    def tearDown(self):
        self.assertEqual(self.get_context(), self.marionette.CONTEXT_CHROME)
        MarionetteTestCase.tearDown(self)

    def get_context(self):
        return self.marionette._send_message("Marionette:GetContext", key="value")

    def test_skipped_teardown_ok(self):
        raise SkipTest("This should leave our teardown method in chrome context")