tor-browser

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

test_chrome.py (1138B)


      1 from marionette_harness import MarionetteTestCase, WindowManagerMixin
      2 
      3 
      4 class ChromeTests(WindowManagerMixin, MarionetteTestCase):
      5    def setUp(self):
      6        super(ChromeTests, self).setUp()
      7 
      8    def tearDown(self):
      9        self.close_all_windows()
     10        super(ChromeTests, self).tearDown()
     11 
     12    def test_hang_until_timeout(self):
     13        with self.marionette.using_context("chrome"):
     14            new_window = self.open_window()
     15        self.marionette.switch_to_window(new_window)
     16 
     17        try:
     18            try:
     19                # Raise an exception type which should not be thrown by Marionette
     20                # while running this test. Otherwise it would mask eg. IOError as
     21                # thrown for a socket timeout.
     22                raise NotImplementedError(
     23                    "Exception should not cause a hang when "
     24                    "closing the chrome window in content "
     25                    "context"
     26                )
     27            finally:
     28                self.marionette.close_chrome_window()
     29                self.marionette.switch_to_window(self.start_window)
     30        except NotImplementedError:
     31            pass