Ejemplo n.º 1
0
Archivo: ios.py Proyecto: sevr73/webkit
    def check_sys_deps(self, needs_http):
        if not self.simulator_runtime.available:
            _log.error(
                'The iOS Simulator runtime with identifier "{0}" cannot be used because it is unavailable.'
                .format(self.simulator_runtime.identifier))
            return False
        testing_device = self.testing_device  # May create a new simulator device

        # testing_device will fail to boot if it is already booted. We assume that if testing_device
        # is booted that it was booted by the iOS Simulator app (as opposed to simctl). So, quit the
        # iOS Simulator app to shutdown testing_device.
        self._executive.run_command([
            'osascript', '-e',
            'tell application id "com.apple.iphonesimulator" to quit'
        ])
        Simulator.wait_until_device_is_in_state(testing_device.udid,
                                                Simulator.DeviceState.SHUTDOWN)

        if not Simulator.check_simulator_device_and_erase_if_needed(
                self.host, testing_device.udid):
            _log.error(
                'Unable to boot the simulator device with UDID {0}.'.format(
                    testing_device.udid))
            return False
        return super(IOSSimulatorPort, self).check_sys_deps(needs_http)
Ejemplo n.º 2
0
    def check_sys_deps(self, needs_http):
        if not self.simulator_runtime.available:
            _log.error('The iOS Simulator runtime with identifier "{0}" cannot be used because it is unavailable.'.format(self.simulator_runtime.identifier))
            return False
        testing_device = self.testing_device  # May create a new simulator device

        if not Simulator.check_simulator_device_and_erase_if_needed(self.host, testing_device.udid):
            _log.error('Unable to boot the simulator device with UDID {0}.'.format(testing_device.udid))
            return False
        return super(IOSSimulatorPort, self).check_sys_deps(needs_http)
Ejemplo n.º 3
0
    def check_sys_deps(self, needs_http):
        if not self.simulator_runtime.available:
            _log.error('The iOS Simulator runtime with identifier "{0}" cannot be used because it is unavailable.'.format(self.simulator_runtime.identifier))
            return False
        testing_device = self.testing_device  # May create a new simulator device

        if not Simulator.check_simulator_device_and_erase_if_needed(self.host, testing_device.udid):
            _log.error('Unable to boot the simulator device with UDID {0}.'.format(testing_device.udid))
            return False
        return super(IOSSimulatorPort, self).check_sys_deps(needs_http)
Ejemplo n.º 4
0
    def check_sys_deps(self, needs_http):
        if not self.simulator_runtime.available:
            _log.error('The iOS Simulator runtime with identifier "{0}" cannot be used because it is unavailable.'.format(self.simulator_runtime.identifier))
            return False
        testing_device = self.testing_device  # May create a new simulator device

        # testing_device will fail to boot if it is already booted. We assume that if testing_device
        # is booted that it was booted by the iOS Simulator app (as opposed to simctl). So, quit the
        # iOS Simulator app to shutdown testing_device.
        self._executive.run_command(['osascript', '-e', 'tell application id "com.apple.iphonesimulator" to quit'])
        Simulator.wait_until_device_is_in_state(testing_device.udid, Simulator.DeviceState.SHUTDOWN)

        if not Simulator.check_simulator_device_and_erase_if_needed(self.host, testing_device.udid):
            _log.error('Unable to boot the simulator device with UDID {0}.'.format(testing_device.udid))
            return False
        return super(IOSSimulatorPort, self).check_sys_deps(needs_http)
Ejemplo n.º 5
0
    def check_sys_deps(self, needs_http):
        if not self.simulator_runtime.available:
            _log.error(
                'The iOS Simulator runtime with identifier "{0}" cannot be used because it is unavailable.'.format(
                    self.simulator_runtime.identifier
                )
            )
            return False
        for i in xrange(self.child_processes()):
            # FIXME: This creates the devices sequentially, doing this in parallel can improve performance.
            testing_device = self.testing_device(i)
            _log.debug("Verifying Simulator{0} with UDID {1}.".format(i, testing_device.udid))

            # FIXME: This is very slow, especially for mulitple simulators, we probably do not need
            # this checking as we are re-creating new simulator apps and devices in every run.
            if not Simulator.check_simulator_device_and_erase_if_needed(self.host, testing_device.udid):
                _log.error("Unable to boot the simulator device with UDID {0}.".format(testing_device.udid))
                return False
        return super(IOSSimulatorPort, self).check_sys_deps(needs_http)