Commit ef93a320 authored by Ali Juma's avatar Ali Juma Committed by Commit Bot

Add an iOS port to blinkpy

This adds an iOS port to blinkpy to allow sharing logic for running
WPTs using 'wpt run'. In particular, the goal is to share logic for
managing expectations and for running tests on a bot.

Change-Id: I6e9b5bddc1f20494b7d9124a7027777c53e38e93
Bug: 673423
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1739390Reviewed-by: default avatarRobert Ma <robertma@chromium.org>
Commit-Queue: Ali Juma <ajuma@chromium.org>
Cr-Commit-Position: refs/heads/master@{#684770}
parent 69a132f9
...@@ -71,6 +71,7 @@ class ParseError(Exception): ...@@ -71,6 +71,7 @@ class ParseError(Exception):
_PLATFORM_TOKENS_LIST = [ _PLATFORM_TOKENS_LIST = [
'Android', 'Android',
'Fuchsia', 'Fuchsia',
'IOS', 'IOS12.2', 'IOS13.0',
'Linux', 'Linux',
'Mac', 'Mac10.10', 'Mac10.11', 'Retina', 'Mac10.12', 'Mac10.13', 'Mac', 'Mac10.10', 'Mac10.11', 'Retina', 'Mac10.12', 'Mac10.13',
'Win', 'Win7', 'Win10' 'Win', 'Win7', 'Win10'
......
...@@ -134,6 +134,9 @@ class Port(object): ...@@ -134,6 +134,9 @@ class Port(object):
('trusty', 'x86_64'), ('trusty', 'x86_64'),
('fuchsia', 'x86_64'), ('fuchsia', 'x86_64'),
('ios12.2', 'x86_64'),
('ios13.0', 'x86_64'),
) )
CONFIGURATION_SPECIFIER_MACROS = { CONFIGURATION_SPECIFIER_MACROS = {
...@@ -141,6 +144,7 @@ class Port(object): ...@@ -141,6 +144,7 @@ class Port(object):
'win': ['win7', 'win10'], 'win': ['win7', 'win10'],
'linux': ['trusty'], 'linux': ['trusty'],
'fuschia': ['fuchsia'], 'fuschia': ['fuchsia'],
'ios': ['ios12.2', 'ios13.0'],
} }
# List of ports open on the host that the tests will connect to. When tests # List of ports open on the host that the tests will connect to. When tests
......
...@@ -39,6 +39,7 @@ class PortFactory(object): ...@@ -39,6 +39,7 @@ class PortFactory(object):
PORT_CLASSES = ( PORT_CLASSES = (
'android.AndroidPort', 'android.AndroidPort',
'fuchsia.FuchsiaPort', 'fuchsia.FuchsiaPort',
'ios.IOSPort',
'linux.LinuxPort', 'linux.LinuxPort',
'mac.MacPort', 'mac.MacPort',
'mock_drt.MockDRTPort', 'mock_drt.MockDRTPort',
......
# Copyright (C) 2019 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""Chromium iOS implementation of the Port interface."""
import logging
from blinkpy.web_tests.port import base
_log = logging.getLogger(__name__)
class IOSPort(base.Port):
SUPPORTED_VERSIONS = ('ios12.2', 'ios13.0')
port_name = 'ios'
FALLBACK_PATHS = {}
FALLBACK_PATHS['ios13.0'] = ['ios']
FALLBACK_PATHS['ios12.2'] = ['ios12.2', 'ios']
def __init__(self, host, port_name, **kwargs):
super(IOSPort, self).__init__(host, port_name, **kwargs)
self._architecture = 'x86_64'
self._version = port_name[port_name.index('ios-') + len('ios-'):]
assert self._version in self.SUPPORTED_VERSIONS
def operating_system(self):
return 'ios'
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment