tor-browser

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

test_chrome_pagesource.py (1036B)


      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 import os
      6 import sys
      7 
      8 from marionette_harness import MarionetteTestCase, WindowManagerMixin
      9 
     10 # add this directory to the path
     11 sys.path.append(os.path.dirname(__file__))
     12 
     13 from chrome_handler_mixin import ChromeHandlerMixin
     14 
     15 
     16 class TestPageSourceChrome(ChromeHandlerMixin, WindowManagerMixin, MarionetteTestCase):
     17    def setUp(self):
     18        super(TestPageSourceChrome, self).setUp()
     19        self.marionette.set_context("chrome")
     20 
     21        new_window = self.open_chrome_window(self.chrome_base_url + "test_xul.xhtml")
     22        self.marionette.switch_to_window(new_window)
     23 
     24    def tearDown(self):
     25        self.close_all_windows()
     26        super(TestPageSourceChrome, self).tearDown()
     27 
     28    def testShouldReturnXULDetails(self):
     29        source = self.marionette.page_source
     30        self.assertIn('<checkbox id="testBox" label="box"', source)