Example #1
0
 def tearDown(self):
     try:
         self.browser.switch_to()
         self.identity_popup.close(force=True)
         self.windows.close_all([self.browser])
     finally:
         FirefoxTestCase.tearDown(self)
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.locationbar = self.browser.navbar.locationbar
        self.identity_popup = self.locationbar.identity_popup

        self.url = 'https://mozqa.com/data/firefox/security/mixedcontent.html'
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.locationbar = self.browser.navbar.locationbar
        self.identity_popup = self.locationbar.identity_popup

        self.url = 'https://mozqa.com/data/firefox/security/mixedcontent.html'
Example #4
0
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.test_data = (
            {
                'url': 'https://ssl-dv.mozqa.com',
                'identity': '',
                'type': 'secure'
            },
            {
                'url': 'https://ssl-ev.mozqa.com/',
                'identity': 'Mozilla Corporation',
                'type': 'secure-ev'
            },
            {
                'url': 'https://ssl-ov.mozqa.com/',
                'identity': '',
                'type': 'secure'
            }
        )

        # Set browser to restore previous session
        self.prefs.set_pref('browser.startup.page', 3)

        self.locationbar = self.browser.navbar.locationbar
        self.identity_popup = self.locationbar.identity_popup
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.url = 'https://ssl-dv.mozqa.com/data/firefox/security/unencryptedsearch.html'
        self.test_string = 'mozilla'

        self.prefs.set_pref('security.warn_submit_insecure', True)
 def tearDown(self):
     try:
         self.browser.switch_to()
         self.identity_popup.close(force=True)
         self.windows.close_all([self.browser])
     finally:
         FirefoxTestCase.tearDown(self)
Example #7
0
    def setUp(self, is_fallback=False):
        FirefoxTestCase.setUp(self)
        self.software_update = SoftwareUpdate(lambda: self.marionette)

        # Bug 604364 - Preparation to test multiple update steps
        self.current_update_index = 0

        self.staging_directory = self.software_update.staging_directory

        # If requested modify the default update channel. It will be active
        # after the next restart of the application
        # Bug 1142805 - Modify file via Python directly
        if self.update_channel:
            # Backup the original content and the path of the channel-prefs.js file
            self.default_update_channel = {
                'content': self.software_update.update_channel.file_contents,
                'path': self.software_update.update_channel.file_path,
            }
            self.software_update.update_channel.default_channel = self.update_channel

        # If requested modify the list of allowed MAR channels
        # Bug 1142805 - Modify file via Python directly
        if self.update_mar_channels:
            # Backup the original content and the path of the update-settings.ini file
            self.default_mar_channels = {
                'content':
                self.software_update.mar_channels.config_file_contents,
                'path': self.software_update.mar_channels.config_file_path,
            }
            self.software_update.mar_channels.add_channels(
                self.update_mar_channels)

        # Bug 1142805 - Until we don't modify the channel-prefs.js and update-settings.ini
        # files before Firefox gets started, a restart of Firefox is necessary to
        # accept the new update channel.
        self.restart()

        # Dictionary which holds the information for each update
        self.updates = [{
            'build_pre': self.software_update.build_info,
            'build_post': None,
            'fallback': is_fallback,
            'patch': {},
            'success': False,
        }]

        self.assertEqual(self.software_update.update_channel.default_channel,
                         self.software_update.update_channel.channel)

        self.assertTrue(
            self.update_mar_channels.issubset(
                self.software_update.mar_channels.channels),
            'Allowed MAR channels have been set: expected "{}" in "{}"'.format(
                ', '.join(self.update_mar_channels),
                ', '.join(self.software_update.mar_channels.channels)))

        # Check if the user has permissions to run the update
        self.assertTrue(
            self.software_update.allowed,
            'Current user has permissions to update the application.')
 def tearDown(self):
     try:
         self.autocomplete_results.close(force=True)
         self.marionette.clear_pref(self.PREF_SUGGEST_SEARCHES)
         self.marionette.clear_pref(self.PREF_SUGGEST_BOOKMARK)
     finally:
         FirefoxTestCase.tearDown(self)
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.locationbar = self.browser.navbar.locationbar
        self.identity_popup = self.locationbar.identity_popup

        self.url = self.marionette.absolute_url('layout/mozilla.html')
Example #10
0
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.locationbar = self.browser.navbar.locationbar
        self.identity_popup = self.browser.navbar.locationbar.identity_popup

        self.url = 'https://ssl-dv.mozqa.com'
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.locationbar = self.browser.navbar.locationbar
        self.identity_popup = self.browser.navbar.locationbar.identity_popup

        self.url = 'https://ssl-dv.mozqa.com'
Example #12
0
    def setUp(self):
        FirefoxTestCase.setUp(self)
        self.software_update = SoftwareUpdate(lambda: self.marionette)

        self.saved_mar_channels = self.software_update.mar_channels.channels
        self.software_update.mar_channels.channels = set(
            ['expected', 'channels'])
Example #13
0
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.prefs.set_pref('extensions.install.requireSecureOrigin', False)

        self.addons_url = self.marionette.absolute_url('addons/extensions/')
        self.utils.permissions.add(self.marionette.baseurl, 'install')
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.prefs.set_pref("extensions.install.requireSecureOrigin", False)

        self.addons_url = self.marionette.absolute_url("addons/extensions/")
        self.utils.permissions.add(self.marionette.baseurl, "install")
Example #15
0
 def tearDown(self):
     try:
         self.autocomplete_results.close(force=True)
         self.marionette.clear_pref(self.PREF_SUGGEST_SEARCHES)
         self.marionette.clear_pref(self.PREF_SUGGEST_BOOKMARK)
     finally:
         FirefoxTestCase.tearDown(self)
Example #16
0
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.locationbar = self.browser.navbar.locationbar
        self.identity_popup = self.locationbar.identity_popup

        self.url = self.marionette.absolute_url('layout/mozilla.html')
 def tearDown(self):
     try:
         self.utils.permissions.remove('https://www.itisatrap.org',
                                       'safe-browsing')
         self.browser.tabbar.close_all_tabs([self.browser.tabbar.tabs[0]])
     finally:
         FirefoxTestCase.tearDown(self)
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.url = 'https://ssl-dv.mozqa.com/data/firefox/security/unencryptedsearch.html'
        self.test_string = 'mozilla'

        self.prefs.set_pref('security.warn_submit_insecure', True)
Example #19
0
    def tearDown(self):
        try:
            self.utils.permissions.remove(self.addons_url, "install")

            if self.browser.notification:
                self.browser.notification.close(force=True)
        finally:
            FirefoxTestCase.tearDown(self)
 def tearDown(self, *args, **kwargs):
     try:
         self._check_and_fix_leaked_rules()
         self._check_and_fix_leaked_rules_in_rules_file()
         self._check_and_fix_ignoring_errors()
         self._check_gecko_log()
     finally:
         FirefoxTestCase.tearDown(self, *args, **kwargs)
    def setUp(self):
        FirefoxTestCase.setUp(self)

        # Set Browser Preferences
        self.marionette.enforce_gecko_prefs(self.browser_prefs)

        # Get safebrowsing path where downloaded data gets stored
        self.sb_files_path = os.path.join(self.marionette.instance.profile.profile, 'safebrowsing')
Example #22
0
    def tearDown(self):
        try:
            self.utils.permissions.remove(self.addons_url, 'install')

            if self.browser.notification:
                self.browser.notification.close(force=True)
        finally:
            FirefoxTestCase.tearDown(self)
    def setUp(self):
        FirefoxTestCase.setUp(self)

        # Use a fake local support URL
        support_url = 'about:blank?'
        self.prefs.set_pref('app.support.baseURL', support_url)

        self.pb_url = support_url + 'private-browsing'
Example #24
0
 def tearDown(self):
     try:
         self.utils.permissions.remove('https://www.itisatrap.org', 'safe-browsing')
         self.browser.tabbar.close_all_tabs([self.browser.tabbar.tabs[0]])
         self.marionette.clear_pref('browser.safebrowsing.malware.enabled')
         self.marionette.clear_pref('browser.safebrowsing.phishing.enabled')
     finally:
         FirefoxTestCase.tearDown(self)
    def setUp(self):
        FirefoxTestCase.setUp(self)

        # Use a fake local support URL
        support_url = 'about:blank?'
        self.prefs.set_pref('app.support.baseURL', support_url)

        self.pb_url = support_url + 'private-browsing'
Example #26
0
 def tearDown(self, *args, **kwargs):
     try:
         self._check_and_fix_leaked_rules()
         self._check_and_fix_leaked_rules_in_rules_file()
         self._check_and_fix_ignoring_errors()
         self._check_gecko_log()
     finally:
         FirefoxTestCase.tearDown(self, *args, **kwargs)
Example #27
0
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.new_pref = 'marionette.unittest.set_pref'
        self.unknown_pref = 'marionette.unittest.unknown'

        self.bool_pref = 'browser.tabs.loadBookmarksInBackground'
        self.int_pref = 'browser.tabs.maxOpenBeforeWarn'
        self.string_pref = 'browser.newtab.url'
Example #28
0
 def tearDown(self):
     try:
         self.autocomplete_results.close(force=True)
     except NoSuchElementException:
         # TODO: A NoSuchElementException is thrown here when tests accessing the
         # autocomplete_results element are skipped.
         pass
     finally:
         FirefoxTestCase.tearDown(self)
Example #29
0
 def tearDown(self):
     try:
         self.marionette.clear_pref('marionette.unittest.set_pref')
         self.marionette.clear_pref('marionette.unittest.unknown')
         self.marionette.clear_pref('browser.tabs.loadBookmarksInBackground')
         self.marionette.clear_pref('browser.tabs.maxOpenBeforeWarn')
         self.marionette.clear_pref('browser.startup.homepage')
     finally:
         FirefoxTestCase.tearDown(self)
Example #30
0
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.new_pref = 'marionette.unittest.set_pref'
        self.unknown_pref = 'marionette.unittest.unknown'

        self.bool_pref = 'browser.tabs.loadBookmarksInBackground'
        self.int_pref = 'browser.tabs.maxOpenBeforeWarn'
        self.string_pref = 'browser.newtab.url'
Example #31
0
 def tearDown(self):
     try:
         self.windows.close_all([self.browser])
         self.browser.tabbar.close_all_tabs([self.browser.tabbar.tabs[0]])
         self.browser.switch_to()
         self.identity_popup.close(force=True)
         self.marionette.clear_pref('browser.startup.page')
     finally:
         FirefoxTestCase.tearDown(self)
Example #32
0
 def tearDown(self):
     try:
         self.autocomplete_results.close(force=True)
     except NoSuchElementException:
         # TODO: A NoSuchElementException is thrown here when tests accessing the
         # autocomplete_results element are skipped.
         pass
     finally:
         FirefoxTestCase.tearDown(self)
Example #33
0
    def setUp(self):
        FirefoxTestCase.setUp(self)

        # Set Browser Preferences
        self.marionette.enforce_gecko_prefs(self.browser_prefs)

        # Get safebrowsing path where downloaded data gets stored
        self.sb_files_path = os.path.join(
            self.marionette.instance.profile.profile, 'safebrowsing')
 def tearDown(self):
     try:
         self.windows.close_all([self.browser])
         self.browser.tabbar.close_all_tabs([self.browser.tabbar.tabs[0]])
         self.browser.switch_to()
         self.identity_popup.close(force=True)
         self.marionette.clear_pref("browser.startup.page")
     finally:
         FirefoxTestCase.tearDown(self)
Example #35
0
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.locationbar = self.browser.navbar.locationbar
        self.identity_popup = self.locationbar.identity_popup

        self.url = 'https://ssl-ev.mozqa.com'

        with self.marionette.using_context('content'):
            self.marionette.navigate(self.url)
    def setUp(self):
        FirefoxTestCase.setUp(self)

        # Force the preferences for the new profile
        enforce_prefs = self.prefs_safebrowsing
        enforce_prefs.update(self.prefs_provider_update_time)
        self.marionette.enforce_gecko_prefs(enforce_prefs)

        self.safebrowsing_path = os.path.join(self.marionette.instance.profile.profile, "safebrowsing")
        self.safebrowsing_files = self.get_safebrowsing_files()
Example #37
0
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.locationbar = self.browser.navbar.locationbar
        self.identity_popup = self.locationbar.identity_popup

        self.url = 'https://ssl-ev.mozqa.com'

        with self.marionette.using_context('content'):
            self.marionette.navigate(self.url)
    def tearDown(self):
        try:
            self.marionette.clear_pref("extensions.install.requireSecureOrigin")
            self.marionette.clear_pref("xpinstall.signatures.required")

            self.utils.permissions.remove(self.addons_url, "install")

            if self.browser.notification:
                self.browser.notification.close(force=True)
        finally:
            FirefoxTestCase.tearDown(self)
Example #39
0
    def setUp(self):
        FirefoxTestCase.setUp(self)

        # Force the preferences for the new profile
        enforce_prefs = self.prefs_safebrowsing
        enforce_prefs.update(self.prefs_provider_update_time)
        self.marionette.enforce_gecko_prefs(enforce_prefs)

        self.safebrowsing_path = os.path.join(
            self.marionette.instance.profile.profile, 'safebrowsing')
        self.safebrowsing_files = self.get_safebrowsing_files()
Example #40
0
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.new_pref = 'marionette.unittest.set_pref'
        self.unknown_pref = 'marionette.unittest.unknown'

        self.bool_pref = 'browser.tabs.loadBookmarksInBackground'
        self.int_pref = 'browser.tabs.maxOpenBeforeWarn'
        # Consider using new test preferences
        # See Bug 1303863 Comment #32
        self.string_pref = 'browser.startup.homepage'
    def tearDown(self):
        # Close the autocomplete results
        try:
            if self.bookmark_panel:
                self.marionette.execute_script("""
                  arguments[0].hidePopup();
                """, script_args=[self.bookmark_panel])

            self.browser.navbar.locationbar.autocomplete_results.close()
            self.places.restore_default_bookmarks()
        finally:
            FirefoxTestCase.tearDown(self)
Example #42
0
    def tearDown(self):
        try:
            self.marionette.clear_pref(
                'extensions.install.requireSecureOrigin')
            self.marionette.clear_pref('xpinstall.signatures.required')

            self.utils.permissions.remove(self.addons_url, 'install')

            if self.browser.notification:
                self.browser.notification.close(force=True)
        finally:
            FirefoxTestCase.tearDown(self)
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.url = 'https://tlsv1-0.mozqa.com'

        self.utils.sanitize({"sessions": True})

        # Disable SSL 3.0, TLS 1.0 and TLS 1.1 for secure connections
        # by forcing the use of TLS 1.2
        # see: http://kb.mozillazine.org/Security.tls.version.*#Possible_values_and_their_effects
        self.prefs.set_pref('security.tls.version.min', 3)
        self.prefs.set_pref('security.tls.version.max', 3)
Example #44
0
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.url = 'https://tlsv1-0.mozqa.com'

        self.utils.sanitize({"sessions": True})

        # Disable SSL 3.0, TLS 1.0 and TLS 1.1 for secure connections
        # by forcing the use of TLS 1.2
        # see: http://kb.mozillazine.org/Security.tls.version.*#Possible_values_and_their_effects
        self.prefs.set_pref('security.tls.version.min', 3)
        self.prefs.set_pref('security.tls.version.max', 3)
    def setUp(self):
        FirefoxTestCase.setUp(self)

        def opener(win):
            self.marionette.execute_script("""
              let updatePrompt = Components.classes["@mozilla.org/updates/update-prompt;1"]
                                 .createInstance(Components.interfaces.nsIUpdatePrompt);
              updatePrompt.checkForUpdates();
            """)

        self.dialog = self.browser.open_window(
            callback=opener, expected_window_class=UpdateWizardDialog)
        self.wizard = self.dialog.wizard
Example #46
0
    def tearDown(self):
        try:
            self.browser.tabbar.close_all_tabs(
                [self.browser.tabbar.selected_tab])

            # Print results for now until we have treeherder integration
            output = pprint.pformat(self.updates)
            self.logger.info('Update test results: \n{}'.format(output))

        finally:
            FirefoxTestCase.tearDown(self)

            self.restore_config_files()
Example #47
0
    def __init__(self, *args, **kwargs):
        FirefoxTestCase.__init__(self, *args, **kwargs)

        self.target_buildid = kwargs.pop('update_target_buildid')
        self.target_version = kwargs.pop('update_target_version')

        self.update_channel = kwargs.pop('update_channel')
        self.default_update_channel = None

        self.update_mar_channels = set(kwargs.pop('update_mar_channels'))
        self.default_mar_channels = None

        self.updates = []
Example #48
0
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.urls = [
            # Invalid cert page
            'https://ssl-expired.mozqa.com',
            # Secure page
            'https://ssl-ev.mozqa.com/',
            # Insecure page
            'http://www.mozqa.com'
        ]

        self.identity_box = self.browser.navbar.locationbar.identity_box
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.urls = [
            # Invalid cert page
            'https://ssl-expired.mozqa.com',
            # Secure page
            'https://ssl-ev.mozqa.com/',
            # Insecure page
            'http://www.mozqa.com'
        ]

        self.identity_box = self.browser.navbar.locationbar.identity_box
Example #50
0
    def setUp(self):
        FirefoxTestCase.setUp(self)

        def opener(win):
            self.marionette.execute_script("""
              let updatePrompt = Components.classes["@mozilla.org/updates/update-prompt;1"]
                                 .createInstance(Components.interfaces.nsIUpdatePrompt);
              updatePrompt.checkForUpdates();
            """)

        self.dialog = self.browser.open_window(callback=opener,
                                               expected_window_class=UpdateWizardDialog)
        self.wizard = self.dialog.wizard
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.bookmark_panel = None
        self.test_urls = [self.marionette.absolute_url('layout/mozilla_grants.html')]

        # Disable search suggestions to only get results for history and bookmarks
        self.prefs.set_pref(self.PREF_SUGGEST_SEARCHES, False)

        with self.marionette.using_context('content'):
            self.marionette.navigate('about:blank')

        self.places.remove_all_history()
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.url = 'https://mozqa.com/data/firefox/security/mixed_content_blocked/index.html'

        self.test_elements = [
            ('result1', 'Insecure script one'),
            ('result2', 'Insecure script from iFrame'),
            ('result3', 'Insecure plugin'),
            ('result4', 'Insecure stylesheet'),
        ]

        self.locationbar = self.browser.navbar.locationbar
        self.identity_popup = self.locationbar.identity_popup
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.url = 'https://mozqa.com/data/firefox/security/mixed_content_blocked/index.html'

        self.test_elements = [
            ('result1', 'Insecure script one'),
            ('result2', 'Insecure script from iFrame'),
            ('result3', 'Insecure plugin'),
            ('result4', 'Insecure stylesheet'),
        ]

        self.locationbar = self.browser.navbar.locationbar
        self.identity_popup = self.locationbar.identity_popup
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.test_data = (
            {"url": "https://ssl-dv.mozqa.com", "identity": "", "type": "secure"},
            {"url": "https://ssl-ev.mozqa.com/", "identity": "Mozilla Corporation", "type": "secure-ev"},
            {"url": "https://ssl-ov.mozqa.com/", "identity": "", "type": "secure"},
        )

        # Set browser to restore previous session
        self.prefs.set_pref("browser.startup.page", 3)

        self.locationbar = self.browser.navbar.locationbar
        self.identity_popup = self.locationbar.identity_popup
Example #55
0
    def setUp(self):
        FirefoxTestCase.setUp(self)

        self.navbar = self.browser.navbar
        self.url = self.marionette.absolute_url('layout/mozilla.html')

        with self.marionette.using_context('content'):
            self.marionette.navigate('about:blank')

        # TODO: check why self.places.remove_all_history() does not work here
        self.marionette.execute_script("""
            let count = gBrowser.sessionHistory.count;
            gBrowser.sessionHistory.PurgeHistory(count);
        """)
    def setUp(self):
        FirefoxTestCase.setUp(self)

        # Disable suggestions for searches and bookmarks to get results only for history
        self.prefs.set_pref(self.PREF_SUGGEST_SEARCHES, False)
        self.prefs.set_pref(self.PREF_SUGGEST_BOOKMARK, False)

        self.places.remove_all_history()

        self.test_urls = [self.marionette.absolute_url('layout/mozilla.html')]

        self.test_string = 'mozilla'
        self.test_favicon = 'mozilla_favicon.ico'

        self.autocomplete_results = self.browser.navbar.locationbar.autocomplete_results