RESOLVED FIXED Bug 214475
[webkitcorepy] Add mocks.Time
https://bugs.webkit.org/show_bug.cgi?id=214475
Summary [webkitcorepy] Add mocks.Time
Jonathan Bedard
Reported 2020-07-17 07:34:39 PDT
Add a class which allows timeouts and time.sleep to function during unit testing without actually waiting.
Attachments
Patch (12.07 KB, patch)
2020-07-17 07:44 PDT, Jonathan Bedard
no flags
Patch (12.62 KB, patch)
2020-07-22 12:17 PDT, Jonathan Bedard
no flags
Patch (12.53 KB, patch)
2020-07-30 09:17 PDT, Jonathan Bedard
no flags
Patch (12.55 KB, patch)
2020-07-30 21:18 PDT, Jonathan Bedard
no flags
Patch (12.54 KB, patch)
2020-08-04 12:56 PDT, Jonathan Bedard
no flags
Patch (9.68 KB, patch)
2020-08-04 22:23 PDT, Jonathan Bedard
no flags
Patch (9.68 KB, patch)
2020-08-07 08:15 PDT, Jonathan Bedard
no flags
Patch for landing (9.69 KB, patch)
2020-08-07 11:56 PDT, Jonathan Bedard
no flags
Jonathan Bedard
Comment 1 2020-07-17 07:44:35 PDT
Jonathan Bedard
Comment 2 2020-07-22 12:17:28 PDT
Radar WebKit Bug Importer
Comment 3 2020-07-24 07:35:17 PDT
Jonathan Bedard
Comment 4 2020-07-30 09:17:45 PDT
Jonathan Bedard
Comment 5 2020-07-30 21:18:31 PDT
Jonathan Bedard
Comment 6 2020-08-04 12:56:48 PDT
Jonathan Bedard
Comment 7 2020-08-04 22:23:14 PDT
Jonathan Bedard
Comment 8 2020-08-07 08:15:53 PDT
dewei_zhu
Comment 9 2020-08-07 11:12:37 PDT
Comment on attachment 406176 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=406176&action=review > Tools/Scripts/libraries/webkitcorepy/webkitcorepy/mocks/time_.py:53 > + self.patches.append([ Interesting, I thought patches is a list of patch, but it's actually a list of patch list. Correct?
Jonathan Bedard
Comment 10 2020-08-07 11:24:12 PDT
Comment on attachment 406176 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=406176&action=review >> Tools/Scripts/libraries/webkitcorepy/webkitcorepy/mocks/time_.py:53 >> + self.patches.append([ > > Interesting, I thought patches is a list of patch, but it's actually a list of patch list. Correct? Yes! That lets us stack this context, so something like this: with mocks.Time: with mocks.Time: pass Not something generally want to do, but a caller may not know what it's callees are doing.
Jonathan Bedard
Comment 11 2020-08-07 11:56:23 PDT
Created attachment 406196 [details] Patch for landing
EWS
Comment 12 2020-08-07 12:24:31 PDT
Committed r265386: <https://trac.webkit.org/changeset/265386> All reviewed patches have been landed. Closing bug and clearing flags on attachment 406196 [details].
Note You need to log in before you can comment on or make changes to this bug.