Beispiel #1
0
    def __init__(self, host, port_name, **kwargs):
        super(ChromiumAndroidPort, self).__init__(host, port_name, **kwargs)

        if not hasattr(self._options, 'additional_drt_flag'):
            self._options.additional_drt_flag = []
        self._options.additional_drt_flag.append('--encode-binary')

        # The Chromium port for Android always uses the hardware GPU path.
        self._options.additional_drt_flag.append('--enable-hardware-gpu')

        # Shard ref tests so that they run together to avoid repeatedly driver restarts.
        self._options.shard_ref_tests = True

        self._operating_system = 'android'
        self._version = 'icecreamsandwich'
        self._original_governor = None
        self._android_base_dir = None

        self._host_port = factory.PortFactory(host).get('chromium', **kwargs)

        self._adb_command = ['adb']
        adb_args = self.get_option('adb_args')
        if adb_args:
            self._adb_command += shlex.split(adb_args)
        self._drt_retry_after_killed = 0
Beispiel #2
0
 def get_port(self, target=None, configuration=None, files=None):
     host = MockHost()
     wkf = WebKitFinder(host.filesystem)
     files = files or {}
     for path, contents in files.items():
         host.filesystem.write_text_file(wkf.path_from_chromium_base(path), contents)
     options = MockOptions(target=target, configuration=configuration)
     return factory.PortFactory(host).get(options=options)
Beispiel #3
0
 def __init__(self, host, **kwargs):
     pfx = 'dryrun-'
     if 'port_name' in kwargs:
         if kwargs['port_name'].startswith(pfx):
             kwargs['port_name'] = kwargs['port_name'][len(pfx):]
         else:
             kwargs['port_name'] = None
     self.__delegate = factory.PortFactory(host).get(**kwargs)
Beispiel #4
0
 def assert_port(self,
                 port_name=None,
                 os_name=None,
                 os_version=None,
                 options=None,
                 cls=None):
     host = MockSystemHost(os_name=os_name, os_version=os_version)
     port = factory.PortFactory(host).get(port_name, options=options)
     self.assertTrue(isinstance(port, cls))
Beispiel #5
0
 def test_get_from_builder_name(self):
     host = MockHost()
     host.builders = BuilderList({
         'My Fake Mac10.12 Builder': {
             'port_name': 'mac-mac10.12',
             'specifiers': ['Mac10.12', 'Release'],
         }
     })
     self.assertEqual(
         factory.PortFactory(host).get_from_builder_name(
             'My Fake Mac10.12 Builder').name(), 'mac-mac10.12')
Beispiel #6
0
 def get_port(self, target=None, configuration=None, files=None):
     host = MockHost()
     finder = PathFinder(host.filesystem)
     files = files or {}
     for path, contents in files.items():
         host.filesystem.write_text_file(
             finder.path_from_chromium_base(path), contents)
     options = optparse.Values({
         'target': target,
         'configuration': configuration
     })
     return factory.PortFactory(host).get(options=options)
Beispiel #7
0
    def __init__(self, host, port_name, **kwargs):
        super(ChromiumAndroidPort, self).__init__(host, port_name, **kwargs)

        self._operating_system = 'android'
        self._version = 'icecreamsandwich'

        self._host_port = factory.PortFactory(host).get('chromium', **kwargs)
        self._server_process_constructor = self._android_server_process_constructor

        if hasattr(self._options, 'adb_device'):
            self._devices = self._options.adb_device
        else:
            self._devices = []
Beispiel #8
0
    def __init__(self, host, port_name, **kwargs):
        _import_fuchsia_runner()
        super(FuchsiaPort, self).__init__(host, port_name, **kwargs)

        self._operating_system = 'fuchsia'
        self._version = 'sdk'

        # TODO(sergeyu): Add support for arm64.
        self._architecture = 'x86_64'

        self.server_process_constructor = FuchsiaServerProcess

        # Used to implement methods that depend on the host platform.
        self._host_port = factory.PortFactory(host).get(**kwargs)

        self._target_host = self.get_option('fuchsia_target')
        self._zircon_logger = None
Beispiel #9
0
    def __init__(self, host, port_name, **kwargs):
        chromium.ChromiumPort.__init__(self, host, port_name, **kwargs)

        # The Chromium port for Android always uses the hardware GPU path.
        self._options.enable_hardware_gpu = True

        self._operating_system = 'android'
        self._version = 'icecreamsandwich'
        self._original_governor = None
        self._android_base_dir = None

        self._host_port = factory.PortFactory(host).get('chromium', **kwargs)

        self._adb_command = ['adb']
        adb_args = self.get_option('adb_args')
        if adb_args:
            self._adb_command += shlex.split(adb_args)
        self._drt_retry_after_killed = 0
Beispiel #10
0
    def __init__(self, host, port_name, **kwargs):
        super(ChromiumAndroidPort, self).__init__(host, port_name, **kwargs)

        self._operating_system = 'android'
        self._version = 'icecreamsandwich'

        self._host_port = factory.PortFactory(host).get('chromium', **kwargs)
        self._server_process_constructor = self._android_server_process_constructor

        if self.driver_name() == 'content_shell':
            self._driver_details = ContentShellDriverDetails()
        else:
            self._driver_details = DumpRenderTreeDriverDetails()

        if hasattr(self._options, 'adb_device') and len(self._options.adb_device):
            self._devices = [self._options.adb_device]
        else:
            self._devices = []

        AndroidCommands.set_adb_command_path_options(['adb',
            self.path_from_chromium_base('third_party', 'android_tools', 'sdk', 'platform-tools', 'adb')])
Beispiel #11
0
    def __init__(self, host, port_name, **kwargs):
        _import_android_packages_if_necessary()
        super(AndroidPort, self).__init__(host, port_name, **kwargs)

        self._operating_system = 'android'
        self._version = 'kitkat'

        self._host_port = factory.PortFactory(host).get(**kwargs)
        self.server_process_constructor = self._android_server_process_constructor

        if not self.get_option('disable_breakpad'):
            self._dump_reader = DumpReaderAndroid(host, self._build_path())

        if self.driver_name() != self.CONTENT_SHELL_NAME:
            raise AssertionError(
                'Layout tests on Android only support content_shell as the driver.'
            )

        self._driver_details = ContentShellDriverDetails()

        # Initialize the AndroidDevices class which tracks available devices.
        default_devices = None
        if hasattr(self._options, 'adb_devices') and len(
                self._options.adb_devices):
            default_devices = self._options.adb_devices

        self._debug_logging = self.get_option('android_logging')
        self._devices = AndroidDevices(default_devices, self._debug_logging)

        devil_chromium.Initialize(output_directory=self._build_path(),
                                  adb_path=self._path_from_chromium_base(
                                      'third_party', 'android_tools', 'sdk',
                                      'platform-tools', 'adb'))
        devil_env.config.InitializeLogging(
            logging.DEBUG if self._debug_logging
            and self.get_option('debug_rwt_logging') else logging.WARNING)

        prepared_devices = self.get_option('prepared_devices', [])
        for serial in prepared_devices:
            self._devices.set_device_prepared(serial)
Beispiel #12
0
    def __init__(self, host, port_name, **kwargs):
        super(AndroidPort, self).__init__(host, port_name, **kwargs)

        self._operating_system = 'android'
        self._version = 'icecreamsandwich'

        self._host_port = factory.PortFactory(host).get('chromium', **kwargs)
        self._server_process_constructor = self._android_server_process_constructor

        if self.driver_name() != self.CONTENT_SHELL_NAME:
            raise AssertionError('Layout tests on Android only support content_shell as the driver.')

        self._driver_details = ContentShellDriverDetails()

        # Initialize the AndroidDevices class which tracks available devices.
        default_device = None
        if hasattr(self._options, 'adb_device') and len(self._options.adb_device):
            default_device = self._options.adb_device

        self._devices = AndroidDevices(self._executive, default_device)

        # Tell AndroidCommands where to search for the "adb" command.
        AndroidCommands.set_adb_command_path_options(['adb',
            self.path_from_chromium_base('third_party', 'android_tools', 'sdk', 'platform-tools', 'adb')])
Beispiel #13
0
 def test_unknown_specified(self):
     with self.assertRaises(NotImplementedError):
         factory.PortFactory(MockHost()).get(port_name='unknown')
Beispiel #14
0
 def test_get_from_builder_name(self):
     self.assertEqual(
         factory.PortFactory(MockSystemHost()).get_from_builder_name(
             'WebKit Mac10.7').name(), 'chromium-mac-lion')
Beispiel #15
0
 def test_unknown_default(self):
     self.assertRaises(
         NotImplementedError,
         factory.PortFactory(MockSystemHost(os_name='vms')).get)
Beispiel #16
0
 def test_unknown_specified(self):
     self.assertRaises(NotImplementedError,
                       factory.PortFactory(MockSystemHost()).get,
                       port_name='unknown')
Beispiel #17
0
 def __init__(self, host, port_name, **kwargs):
     self.__delegate = factory.PortFactory(host).get(
         port_name.replace('dryrun-', ''), **kwargs)
 def test_get_from_builder_name(self):
     self.assertEqual(
         factory.PortFactory(
             MockHost()).get_from_builder_name('WebKit Mac10.11').name(),
         'mac-mac10.11')
Beispiel #19
0
 def test_unknown_default(self):
     with self.assertRaises(NotImplementedError):
         factory.PortFactory(MockHost(os_name='vms')).get()