[webkit-dev] DRT/WTR should clear the cache at the beginning of each test?

Ami Fischman fischman at chromium.org
Sat Oct 27 22:16:19 PDT 2012


On Sat, Oct 27, 2012 at 9:08 PM, Alexey Proskuryakov <ap at webkit.org> wrote:

> But visiting site A is not expected to affect behavior on site B, even
> though cache state was affected by site A.


LayoutTests/media/W3C/video/networkState/networkState_during_progress.html
is a counter-example (and is backed up the
spec<http://dev.w3.org/html5/spec/single-page.html#event-media-progress>),
or it would be if it didn't contain the new Date() + Math.random()
 workaround.

We can live in one of two worlds:
1) LayoutTests that concern themselves with specific network/loading
concerns need to use unique URLs to refer to static data; or
2) DRT clears JS-visible state between tests.
The pros/cons seem clear to me:
Pro#1: loading/caching code is coincidentally tested by (unknown) tests
that reuse URLs among themselves.
Con#1: requires additional cognitive load for all webkit developers; the
only way to write a test that won't be affected by future addition of
unrelated tests is to use unique URLs
Pro#2: principle of least-surprise is maintained; understanding DRT &
reading a test (and not every other test) is enough to understand its
behavior
Con#2: loading/caching code needs to be tested explicitly.
IMO (Pro#2 + -Con#1) >> (Pro#1 + -Con#2).

Are you saying you believe the inequality goes a different way, or am I
missing some other feature of your thesis?

Cheers,
-a
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20121027/d434f18b/attachment.html>


More information about the webkit-dev mailing list