tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_teardown_context_preserved.py (815B)


      1 # This Source Code Form is subject to the terms of the Mozilla Public
      2 # License, v. 2.0. If a copy of the MPL was not distributed with this
      3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
      4 
      5 from marionette_harness import MarionetteTestCase, SkipTest
      6 
      7 
      8 class TestTearDownContext(MarionetteTestCase):
      9    def setUp(self):
     10        MarionetteTestCase.setUp(self)
     11        self.marionette.set_context(self.marionette.CONTEXT_CHROME)
     12 
     13    def tearDown(self):
     14        self.assertEqual(self.get_context(), self.marionette.CONTEXT_CHROME)
     15        MarionetteTestCase.tearDown(self)
     16 
     17    def get_context(self):
     18        return self.marionette._send_message("Marionette:GetContext", key="value")
     19 
     20    def test_skipped_teardown_ok(self):
     21        raise SkipTest("This should leave our teardown method in chrome context")