Make service worker's unit tests more unit tests |
||
Issue descriptionCurrently several unit tests internally creates real ServiceWorkerRegistration and ServiceWorkerVersion for unit testing, and they kicks StartWorker procedure before starting the tests. However, it needs various classes like ServiceWorkerProviderHost, ServiceWorkerDispatcherHost and ServiceWorkerStorage, so it looks like integration tests rather than unit tests. I think we should have - more unit test like unit tests with mocking minimal set of objects - small integration tests like what we currently call unit tests
,
Aug 24
shimazu: Would you like to keep this open or close it? I think this is something that can be done on a case-by-case basis and doesn't need an open bug, especially since it hasn't gotten traction in one year. I do agree many of our unit tests are overly tangled and especially there is common setup code copy/pasted throughout. However in Chromium a unit test is basically anything that's not a browser test (which starts up the browser), so there's a wide definition of "unit test". It's not necessarily testing a single class in isolation: https://www.chromium.org/developers/testing/running-tests#TOC-Unit-tests-and-Browser-tests
,
Aug 24
Thanks for pinging me :) > I think this is something that can be done on a case-by-case basis and doesn't need an open bug, especially since it hasn't gotten traction in one year. I agree with it. However, honestly I still want to explore better shape of unit tests. I'm expecting that it might lead more isolated architecture or better lifetime aware relationships between classes. I'm not sure if we really can do that, but I'd like to keep this open for a while.
,
Aug 24
Makes sense. Assigning to shimazu@. |
||
►
Sign in to add a comment |
||
Comment 1 by sheriffbot@chromium.org
, Aug 23Status: Untriaged (was: Available)