Exemplo n.º 1
0
    def buildProfile(self, options):
        restoreRemotePaths = self.switchToLocalPaths(options)
        if options.testingModulesDir:
            try:
                self._dm.pushDir(options.testingModulesDir, self.remoteModulesDir)
                self._dm.chmodDir(self.remoteModulesDir)
            except devicemanager.DMError:
                self.log.error(
                    "Automation Error: Unable to copy test modules to device.")
                raise
            savedTestingModulesDir = options.testingModulesDir
            options.testingModulesDir = self.remoteModulesDir
        else:
            savedTestingModulesDir = None
        manifest = MochitestDesktop.buildProfile(self, options)
        if savedTestingModulesDir:
            options.testingModulesDir = savedTestingModulesDir
        self.localProfile = options.profilePath
        self._dm.removeDir(self.remoteProfile)

        try:
            self._dm.pushDir(options.profilePath, self.remoteProfile)
            self._dm.chmodDir(self.remoteProfile)
        except devicemanager.DMError:
            self.log.error(
                "Automation Error: Unable to copy profile to device.")
            raise

        restoreRemotePaths()
        options.profilePath = self.remoteProfile
        return manifest
Exemplo n.º 2
0
    def buildProfile(self):
        """
           Build a profile locally, keep it locally for use by servers and
           push a copy to the remote profile-copy directory.

           This is similar to buildProfile in runtestsremote.py.
        """
        self.options.extraPrefs.append('browser.search.suggest.enabled=true')
        self.options.extraPrefs.append('browser.search.suggest.prompted=true')
        self.options.extraPrefs.append('layout.css.devPixelsPerPx=1.0')
        self.options.extraPrefs.append('browser.chrome.dynamictoolbar=false')
        self.options.extraPrefs.append('browser.snippets.enabled=false')
        self.options.extraPrefs.append('browser.casting.enabled=true')
        self.options.extraPrefs.append('extensions.autoupdate.enabled=false')
        manifest = MochitestDesktop.buildProfile(self, self.options)
        self.localProfile = self.options.profilePath
        self.log.debug("Profile created at %s" % self.localProfile)
        # some files are not needed for robocop; save time by not pushing
        shutil.rmtree(os.path.join(self.localProfile, 'webapps'))
        desktop_extensions = ['*****@*****.**', '*****@*****.**', '*****@*****.**']
        for ext in desktop_extensions:
            shutil.rmtree(os.path.join(self.localProfile, 'extensions', 'staged', ext))
        os.remove(os.path.join(self.localProfile, 'userChrome.css'))
        try:
            self.dm.pushDir(self.localProfile, self.remoteProfileCopy)
        except devicemanager.DMError:
            self.log.error(
                "Automation Error: Unable to copy profile to device.")
            raise

        return manifest
Exemplo n.º 3
0
    def buildProfile(self, options):
        restoreRemotePaths = self.switchToLocalPaths(options)
        manifest = MochitestDesktop.buildProfile(self, options)
        self.localProfile = options.profilePath
        self._dm.removeDir(self.remoteProfile)

        try:
            self._dm.pushDir(options.profilePath, self.remoteProfile)
        except devicemanager.DMError:
            self.log.error(
                "Automation Error: Unable to copy profile to device.")
            raise

        restoreRemotePaths()
        options.profilePath = self.remoteProfile
        return manifest
Exemplo n.º 4
0
    def buildProfile(self):
        """
           Build a profile locally, keep it locally for use by servers and
           push a copy to the remote profile-copy directory.

           This is similar to buildProfile in runtestsremote.py.
        """
        self.options.extraPrefs.append('browser.search.suggest.enabled=true')
        self.options.extraPrefs.append('browser.search.suggest.prompted=true')
        self.options.extraPrefs.append('layout.css.devPixelsPerPx=1.0')
        self.options.extraPrefs.append('browser.chrome.dynamictoolbar=false')
        self.options.extraPrefs.append('browser.snippets.enabled=false')
        self.options.extraPrefs.append('browser.casting.enabled=true')
        self.options.extraPrefs.append('extensions.autoupdate.enabled=false')

        # Override the telemetry init delay for integration testing.
        self.options.extraPrefs.append('toolkit.telemetry.initDelay=1')

        self.options.extensionsToExclude.extend([
            '*****@*****.**',
            '*****@*****.**',
            '*****@*****.**',
            '*****@*****.**',
        ])

        manifest = MochitestDesktop.buildProfile(self, self.options)
        self.localProfile = self.options.profilePath
        self.log.debug("Profile created at %s" % self.localProfile)
        # some files are not needed for robocop; save time by not pushing
        os.remove(os.path.join(self.localProfile, 'userChrome.css'))
        try:
            self.dm.pushDir(self.localProfile, self.remoteProfileCopy)
        except mozdevice.DMError:
            self.log.error(
                "Automation Error: Unable to copy profile to device.")
            raise

        return manifest
Exemplo n.º 5
0
    def buildProfile(self, options):
        restoreRemotePaths = self.switchToLocalPaths(options)
        if options.testingModulesDir:
            try:
                self.device.push(options.testingModulesDir, self.remoteModulesDir)
                self.device.chmod(self.remoteModulesDir, recursive=True)
            except Exception:
                self.log.error(
                    "Automation Error: Unable to copy test modules to device."
                )
                raise
            savedTestingModulesDir = options.testingModulesDir
            options.testingModulesDir = self.remoteModulesDir
        else:
            savedTestingModulesDir = None
        manifest = MochitestDesktop.buildProfile(self, options)
        if savedTestingModulesDir:
            options.testingModulesDir = savedTestingModulesDir
        self.localProfile = options.profilePath

        restoreRemotePaths()
        options.profilePath = self.remoteProfile
        return manifest
Exemplo n.º 6
0
    def buildProfile(self):
        """
           Build a profile locally, keep it locally for use by servers and
           push a copy to the remote profile-copy directory.

           This is similar to buildProfile in runtestsremote.py.
        """
        self.options.extraPrefs.append('browser.search.suggest.enabled=true')
        self.options.extraPrefs.append('browser.search.suggest.prompted=true')
        self.options.extraPrefs.append('layout.css.devPixelsPerPx=1.0')
        self.options.extraPrefs.append('browser.chrome.dynamictoolbar=false')
        self.options.extraPrefs.append('browser.snippets.enabled=false')
        self.options.extraPrefs.append('extensions.autoupdate.enabled=false')

        # Override the telemetry init delay for integration testing.
        self.options.extraPrefs.append('toolkit.telemetry.initDelay=1')

        self.options.extensionsToExclude.extend([
            '*****@*****.**',
            '*****@*****.**',
            '*****@*****.**',
            '*****@*****.**',
        ])

        manifest = MochitestDesktop.buildProfile(self, self.options)
        self.localProfile = self.options.profilePath
        self.log.debug("Profile created at %s" % self.localProfile)
        # some files are not needed for robocop; save time by not pushing
        os.remove(os.path.join(self.localProfile, 'userChrome.css'))
        try:
            self.dm.pushDir(self.localProfile, self.remoteProfileCopy)
        except mozdevice.DMError:
            self.log.error(
                "Automation Error: Unable to copy profile to device.")
            raise

        return manifest