Bug 160833

Summary: Allow a port to run tests with a custom device setup
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: New BugsAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, commit-queue, dbates, glenn, simon.fraser
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch dbates: review+

Simon Fraser (smfr)
Reported 2016-08-12 16:59:51 PDT
Allow a port to run tests with a custom device setup
Attachments
Patch (26.13 KB, patch)
2016-08-12 17:10 PDT, Simon Fraser (smfr)
no flags
Patch (27.29 KB, patch)
2016-08-12 18:03 PDT, Simon Fraser (smfr)
dbates: review+
Simon Fraser (smfr)
Comment 1 2016-08-12 17:10:05 PDT
Simon Fraser (smfr)
Comment 2 2016-08-12 18:03:48 PDT
Daniel Bates
Comment 3 2016-08-15 11:00:02 PDT
Comment on attachment 285988 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=285988&action=review It would be good if we had more test coverage for the changes. The changes look sane. > Tools/Scripts/webkitpy/layout_tests/controllers/manager.py:106 > + def _custom_device_for_test(self, test): > + for device_class in self._port.CUSTOM_DEVICE_CLASSES: > + directory_suffix = device_class + self._port.TEST_PATH_SEPARATOR > + if directory_suffix in test: > + return device_class > + return None We could add a test for this function in manager_unittest.py. > Tools/Scripts/webkitpy/layout_tests/controllers/manager.py:220 > + _log.debug('%s tests use device %s', len(custom_device_tests[device_class]), device_class) Nit: I know this is a debug logging. We could use pluralize() here to emit "test" or "tests". > Tools/Scripts/webkitpy/port/driver.py:56 > + return "DriverInput(test_name='%s', timeout=%s, image_hash=%s, should_run_pixel_test=%s'" % (self.test_name, self.timeout, self.image_hash, self.should_run_pixel_test) Nit: I believe we prefer using String.format() instead of the % operator towards making this code compatible with Python 3. I'm unclear of the status of our effort. > Tools/Scripts/webkitpy/port/ios.py:89 > + 'ipad': 'iPad Air'}, For your consideration, I suggest we put the "}," on its on own line. This has the benefit that when appending a new device type to the end of this dictionary that we do not need to modify this line. > Tools/Scripts/webkitpy/port/ios.py:92 > + 'ipad': 'iPad Retina'}, Ditto. > Tools/Scripts/webkitpy/port/port_testcase.py:254 > + print port Did you intend to add this line?
Simon Fraser (smfr)
Comment 4 2016-08-15 13:54:19 PDT
Note You need to log in before you can comment on or make changes to this bug.