Exemplo n.º 1
0
 def setup_method(self, method):
     self.ffsetup = FFSetup(
         # browser_config
         {
             "env": {},
             "symbols_path": "",
             "preferences": {},
             "webserver": "",
             "extensions": []
         },
         # test_config
         {
             "preferences": {},
             "extensions": [],
             "profile": None
         })
Exemplo n.º 2
0
class TestFFSetup(object):

    def setup_method(self, method):
        self.ffsetup = FFSetup(
            # browser_config
            {
                "env": {},
                "symbols_path": "",
                "preferences": {},
                "webserver": "",
                "extensions": []
            },
            # test_config
            {
                "preferences": {},
                "extensions": [],
                "profile": None
            }
        )

        # setup proxy logger

    def test_clean(self):
        # tmp dir removed
        assert self.ffsetup._tmp_dir is not None
        assert os.path.exists(self.ffsetup._tmp_dir) is True

        self.ffsetup.clean()

        assert self.ffsetup._tmp_dir is not None
        assert os.path.exists(self.ffsetup._tmp_dir) is False

        # gecko profile also cleaned
        gecko_profile = mock.Mock()
        self.ffsetup.gecko_profile = gecko_profile

        self.ffsetup.clean()

        assert gecko_profile.clean.called is True
Exemplo n.º 3
0
class TestFFSetup(object):
    def setup_method(self, method):
        self.ffsetup = FFSetup(
            # browser_config
            {
                "env": {},
                "symbols_path": "",
                "preferences": {},
                "webserver": "",
                "extensions": []
            },
            # test_config
            {
                "preferences": {},
                "extensions": [],
                "profile": None
            })

        # setup proxy logger

    def test_clean(self):
        # tmp dir removed
        assert self.ffsetup._tmp_dir is not None
        assert os.path.exists(self.ffsetup._tmp_dir) is True

        self.ffsetup.clean()

        assert self.ffsetup._tmp_dir is not None
        assert os.path.exists(self.ffsetup._tmp_dir) is False

        # gecko profile also cleaned
        gecko_profile = mock.Mock()
        self.ffsetup.gecko_profile = gecko_profile

        self.ffsetup.clean()

        assert gecko_profile.clean.called is True
Exemplo n.º 4
0
    def runTest(self, browser_config, test_config):
        """
            Runs an url based test on the browser as specified in the
            browser_config dictionary

        Args:
            browser_config:  Dictionary of configuration options for the
                             browser (paths, prefs, etc)
            test_config   :  Dictionary of configuration for the given
                             test (url, cycles, counters, etc)

        """

        with FFSetup(browser_config, test_config) as setup:
            return self._runTest(browser_config, test_config, setup)
Exemplo n.º 5
0
 def setup_method(self, method):
     self.ffsetup = FFSetup(
         # browser_config
         {
             "env": {},
             "symbols_path": "",
             "preferences": {},
             "webserver": "",
             "extensions": []
         },
         # test_config
         {
             "preferences": {},
             "extensions": [],
             "profile": None
         }
     )
Exemplo n.º 6
0
    def runTest(self, browser_config, test_config):
        """
            Runs an url based test on the browser as specified in the
            browser_config dictionary

        Args:
            browser_config:  Dictionary of configuration options for the
                             browser (paths, prefs, etc)
            test_config   :  Dictionary of configuration for the given
                             test (url, cycles, counters, etc)

        """

        LOG.debug("operating with platform_type : %s" % self.platform_type)

        # Bug 1262954: winxp + e10s, disable hwaccel
        if self.platform_type == "win_" and browser_config['e10s']:
            prefs = browser_config['preferences']
            prefs['layers.acceleration.disabled'] = True

        with FFSetup(browser_config, test_config) as setup:
            return self._runTest(browser_config, test_config, setup)