Exemple #1
0
    def __init__(self, **kwargs):
        # if no server root is specified, use the packaged resources
        if not kwargs.get('server_root'):
            kwargs['server_root'] = os.path.abspath(os.path.join(
                os.path.dirname(__file__), 'resources'))

        def gather_debug(test, status):
            rv = {}
            marionette = test._marionette_weakref()

            # In the event we're gathering debug without starting a session, skip marionette commands
            if marionette.session is not None:
                try:
                    marionette.switch_to_frame()
                    marionette.push_permission('settings-read', True)
                    marionette.push_permission('settings-api-read', True)
                    rv['settings'] = json.dumps(marionette.execute_async_script("""
  var req = window.navigator.mozSettings.createLock().get('*');
  req.onsuccess = function() {
    marionetteScriptFinished(req.result);
  }""", sandbox='system'), sort_keys=True, indent=4, separators=(',', ': '))
                except:
                    logger = mozlog.structured.get_default_logger()
                    if not logger:
                        logger = mozlog.getLogger('gaiatest')
                    logger.warning('Failed to gather test failure debug.', exc_info=True)
            return rv

        BaseMarionetteTestRunner.__init__(self, result_callbacks=[gather_debug], **kwargs)
        GaiaTestRunnerMixin.__init__(self, **kwargs)
        HTMLReportingTestRunnerMixin.__init__(self, name=__name__,
                                              version=__version__, **kwargs)
        TreeherderTestRunnerMixin.__init__(self, **kwargs)
        self.test_handlers = [GaiaTestCase]
Exemple #2
0
 def __init__(self, **kwargs):
     # if no server root is specified, use the packaged resources
     if not kwargs.get('server_root'):
         kwargs['server_root'] = os.path.abspath(os.path.join(
             os.path.dirname(__file__), 'resources'))
     BaseMarionetteTestRunner.__init__(self, **kwargs)
     GaiaTestRunnerMixin.__init__(self, **kwargs)
     HTMLReportingTestRunnerMixin.__init__(self, name=__name__,
                                           version=__version__, **kwargs)
     TreeherderTestRunnerMixin.__init__(self, **kwargs)
     self.test_handlers = [GaiaTestCase]
Exemple #3
0
 def __init__(self, **kwargs):
     # if no server root is specified, use the packaged resources
     if not kwargs.get('server_root'):
         kwargs['server_root'] = os.path.abspath(
             os.path.join(os.path.dirname(__file__), 'resources'))
     BaseMarionetteTestRunner.__init__(self, **kwargs)
     GaiaTestRunnerMixin.__init__(self, **kwargs)
     HTMLReportingTestRunnerMixin.__init__(self,
                                           name=__name__,
                                           version=__version__,
                                           **kwargs)
     TreeherderTestRunnerMixin.__init__(self, **kwargs)
     self.test_handlers = [GaiaTestCase]
Exemple #4
0
    def __init__(self, **kwargs):
        # if no server root is specified, use the packaged resources
        if not kwargs.get('server_root'):
            kwargs['server_root'] = os.path.abspath(
                os.path.join(os.path.dirname(__file__), 'resources'))

        def gather_debug(test, status):
            rv = {}
            marionette = test._marionette_weakref()

            # In the event we're gathering debug without starting a session, skip marionette commands
            if marionette.session is not None:
                try:
                    marionette.switch_to_frame()
                    rv['settings'] = json.dumps(
                        marionette.execute_async_script("""
SpecialPowers.pushPermissions([
  {type: 'settings-read', allow: true, context: document},
  {type: 'settings-api-read', allow: true, context: document},
], function() {
  var req = window.navigator.mozSettings.createLock().get('*');
  req.onsuccess = function() {
    marionetteScriptFinished(req.result);
  }
});""",
                                                        special_powers=True),
                        sort_keys=True,
                        indent=4,
                        separators=(',', ': '))
                except:
                    logger = mozlog.structured.get_default_logger()
                    if not logger:
                        logger = mozlog.getLogger('gaiatest')
                    logger.warning('Failed to gather test failure debug.',
                                   exc_info=True)
            return rv

        BaseMarionetteTestRunner.__init__(self,
                                          result_callbacks=[gather_debug],
                                          **kwargs)
        GaiaTestRunnerMixin.__init__(self, **kwargs)
        HTMLReportingTestRunnerMixin.__init__(self,
                                              name=__name__,
                                              version=__version__,
                                              **kwargs)
        TreeherderTestRunnerMixin.__init__(self, **kwargs)
        self.test_handlers = [GaiaTestCase]
Exemple #5
0
    def __init__(self, **kwargs):
        # if no server root is specified, use the packaged resources
        if not kwargs.get("server_root"):
            kwargs["server_root"] = os.path.abspath(os.path.join(os.path.dirname(__file__), "resources"))

        def gather_debug(test, status):
            rv = {}
            marionette = test._marionette_weakref()

            # In the event we're gathering debug without starting a session, skip marionette commands
            if marionette.session is not None:
                try:
                    marionette.switch_to_frame()
                    rv["settings"] = json.dumps(
                        marionette.execute_async_script(
                            """
SpecialPowers.pushPermissions([
  {type: 'settings-read', allow: true, context: document},
  {type: 'settings-api-read', allow: true, context: document},
], function() {
  var req = window.navigator.mozSettings.createLock().get('*');
  req.onsuccess = function() {
    marionetteScriptFinished(req.result);
  }
});""",
                            special_powers=True,
                        ),
                        sort_keys=True,
                        indent=4,
                        separators=(",", ": "),
                    )
                except:
                    logger = mozlog.structured.get_default_logger()
                    if not logger:
                        logger = mozlog.getLogger("gaiatest")
                    logger.warning("Failed to gather test failure debug.", exc_info=True)
            return rv

        BaseMarionetteTestRunner.__init__(self, result_callbacks=[gather_debug], **kwargs)
        GaiaTestRunnerMixin.__init__(self, **kwargs)
        HTMLReportingTestRunnerMixin.__init__(self, name=__name__, version=__version__, **kwargs)
        TreeherderTestRunnerMixin.__init__(self, **kwargs)
        self.test_handlers = [GaiaTestCase]