WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED CONFIGURATION CHANGED
176962
webkitpy: Provide accessor for device type
https://bugs.webkit.org/show_bug.cgi?id=176962
Summary
webkitpy: Provide accessor for device type
Jonathan Bedard
Reported
2017-09-14 15:35:01 PDT
Provide a function to ask a device what type it is. The device type will be of the form 'iPhone 5s' or 'iPad Air.' For simulator, this device type will be derivative of the device name. For example, 'iPhone 5s WebKit Tester 1' has a device type of 'iPhone 5s'.
Attachments
Patch
(7.31 KB, patch)
2017-09-14 15:37 PDT
,
Jonathan Bedard
no flags
Details
Formatted Diff
Diff
Patch
(2.76 KB, patch)
2017-09-18 11:00 PDT
,
Jonathan Bedard
no flags
Details
Formatted Diff
Diff
Patch
(2.76 KB, patch)
2017-09-18 11:07 PDT
,
Jonathan Bedard
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2017-09-14 15:35:43 PDT
<
rdar://problem/34444987
>
Jonathan Bedard
Comment 2
2017-09-14 15:37:52 PDT
Created
attachment 320836
[details]
Patch
Daniel Bates
Comment 3
2017-09-18 09:57:56 PDT
Comment on
attachment 320836
[details]
Patch This patch assumes the convention that the name of the simulator will contain the name of the device. This is a convention. The name of a simulator device is arbitrary; => we should not parse the device name to determine the device type it corresponds to. Moreover, we do not have to resort to such manipulation. The command "simctl list" prints the list of device types under the "== Device Types ==" section and the parsing code in simulator.py knows how to parse this section. We need to teach the parsing code to pass the human readable name corresponding to the device type when instantiating a SimulatedDevice object.
Jonathan Bedard
Comment 4
2017-09-18 10:22:23 PDT
(In reply to Daniel Bates from
comment #3
)
> Comment on
attachment 320836
[details]
> Patch > > This patch assumes the convention that the name of the simulator will > contain the name of the device. This is a convention. The name of a > simulator device is arbitrary; => we should not parse the device name to > determine the device type it corresponds to. Moreover, we do not have to > resort to such manipulation. The command "simctl list" prints the list of > device types under the "== Device Types ==" section and the parsing code in > simulator.py knows how to parse this section. We need to teach the parsing > code to pass the human readable name corresponding to the device type when > instantiating a SimulatedDevice object.
We need a map of device UDIDs to device types. The 'device types' section only provides a mapping of device type to simulator runtime type. I discovered this morning that this information is stored in the device.plist, which seems like the best place to retrieve this information from, I will update this patch.
Jonathan Bedard
Comment 5
2017-09-18 11:00:58 PDT
Created
attachment 321110
[details]
Patch
Jonathan Bedard
Comment 6
2017-09-18 11:07:32 PDT
Created
attachment 321111
[details]
Patch
Jonathan Bedard
Comment 7
2017-09-18 11:07:56 PDT
(In reply to Jonathan Bedard from
comment #6
)
> Created
attachment 321111
[details]
> Patch
Looking for deviceType, not runtime.
Daniel Bates
Comment 8
2017-09-18 12:33:49 PDT
Would it be sufficient to be able to track the device type of devices we (webkitpy/webkitperl) created? Or do we need to be able to compute the device type for an arbitrary simulator device?
Jonathan Bedard
Comment 9
2017-09-18 12:45:04 PDT
(In reply to Daniel Bates from
comment #8
)
> Would it be sufficient to be able to track the device type of devices we > (webkitpy/webkitperl) created? Or do we need to be able to compute the > device type for an arbitrary simulator device?
We support running on the currently running simulator (meaning webkitpy isn't managing the device), so we do need to be able to compute the device type for an arbitrary simulator. I memoized the function so that we only do the computation once.
Jonathan Bedard
Comment 10
2018-03-27 16:40:57 PDT
This was addressed when we shifted to the new simulator manager class <
https://bugs.webkit.org/show_bug.cgi?id=180555
>.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug