Bug 142848

Summary: Test disk cache behavior when using back navigation cache policy
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: Page LoadingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, japhet
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 142831    
Attachments:
Description Flags
patch
cdumez: review+, cdumez: commit-queue-
patch cdumez: review+, cdumez: commit-queue-

Description Antti Koivisto 2015-03-18 17:04:41 PDT
Add testing support and a test matrix.
Comment 1 Antti Koivisto 2015-03-18 17:12:53 PDT
Created attachment 248990 [details]
patch
Comment 2 Chris Dumez 2015-03-18 17:21:12 PDT
Comment on attachment 248990 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=248990&action=review

> Source/WebCore/testing/Internals.idl:49
> +    void setOverrideCachePolicy(unsigned short policy);

Would make the tests more readable if we used an IDL enum argument (or at least add static constants on Internals).
Comment 3 Antti Koivisto 2015-03-18 18:00:04 PDT
Created attachment 248997 [details]
patch
Comment 4 Chris Dumez 2015-03-18 18:36:59 PDT
Comment on attachment 248997 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=248997&action=review

Still LGTM.

> LayoutTests/http/tests/cache/disk-cache-validation.html:-42
> -runTests(generateTests(testMatrix));

Not strictly related but OK.
Comment 5 Chris Dumez 2015-03-18 20:08:58 PDT
Antti, it looks like http/tests/cache/disk-cache-validation.html and http/tests/cache/disk-cache-validation-back-navigation-policy.html may cause each other to be flaky. If I run each test on their own, they run fine.

However, if I run the whole http/ folder, http/tests/cache/disk-cache-validation.html is flaky with the following diff:
http://pastebin.com/1n2spiVB
Comment 6 Chris Dumez 2015-03-18 20:12:59 PDT
Comment on attachment 248997 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=248997&action=review

> Source/WebCore/testing/Internals.cpp:442
> +void Internals::setOverrideCachePolicy(const String& policy)

You probably want to clear the override cache policy from Internals::resetToConsistentState() to avoid flakiness.
Comment 7 Antti Koivisto 2015-03-18 20:58:38 PDT
> You probably want to clear the override cache policy from
> Internals::resetToConsistentState() to avoid flakiness.

The field is in the FrameLoader which is per-document and doesn't affect any other tests. There shouldn't be need for this.
Comment 8 Chris Dumez 2015-03-18 21:44:51 PDT
(In reply to comment #7)
> > You probably want to clear the override cache policy from
> > Internals::resetToConsistentState() to avoid flakiness.
> 
> The field is in the FrameLoader which is per-document and doesn't affect any
> other tests. There shouldn't be need for this.

It seems to fix the flakiness for me locally though.
Comment 9 Antti Koivisto 2015-03-18 22:22:37 PDT
https://trac.webkit.org/r181728