Bug 185386
Summary: | webkitpy: Don't pass "platform" string to VersionNameMap member functions | ||
---|---|---|---|
Product: | WebKit | Reporter: | Daniel Bates <dbates> |
Component: | Tools / Tests | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | jbedard, lforschler, rniwa |
Priority: | P2 | ||
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=185387 |
Daniel Bates
VersionNameMap is confusing to use. One of the issues is that various VersionNameMap functions, including the constructor, take a "platform" that could either be a string that represents the OS name (e.g. High Sierra) or a PlatformInfo object. You need to read the code of each function to know what data type the function argument named "platform" should be.
Expect a PlatformInfo object to be passed for "platform":
VersionNameMap.__init__()
VersionNameMap.map()
Expect a string for "platform":
VersionNameMap.to_name()
VersionNameMap.names()
VersionNameMap.mapping_for_platform()
On another note, it seems weird that VersionNameMap is instantiated with a PlatformInfo for the purpose of querying the platform for the OS name and its member functions can also take an OS name to override the OS name computed in the constructor.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Jonathan Bedard
I'm very much open to changing these names. Possible candidate:
platform_info and platform_name
As for why we allow overriding the os_name, it's for iOS. When doing iOS simulator and device testing, we need to retrieve information about the version before we've instantiated the PlatformInfo object for the device. So we need to extract iOS version information from a Mac VersionNameMap.
Jonathan Bedard
This change will be blocked by <https://bugs.webkit.org/show_bug.cgi?id=185387>.