Skip to content

Commit

Permalink
[WPE][GTK] Cleanup disk cache at the beginning of `WebKitWebsiteData/…
Browse files Browse the repository at this point in the history
…cache` API test

https://bugs.webkit.org/show_bug.cgi?id=260524

Reviewed by Michael Catanzaro.

If the test fails somewhere in the middle for some reason, the disk
cache won't be deleted. Any subsequent runs will then always fail at
the beginning of the test.

This patch ensures that the disk cache is cleared every time we run
the test.

* Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp:
(testWebsiteDataCache):
* Tools/TestWebKitAPI/glib/TestExpectations.json:

Canonical link: https://commits.webkit.org/267289@main
  • Loading branch information
obyknovenius committed Aug 25, 2023
1 parent 2ec1a7e commit 2347502
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,9 @@ static void testWebsiteDataEphemeral(WebViewTest* test, gconstpointer)
static void testWebsiteDataCache(WebsiteDataTest* test, gconstpointer)
{
static const WebKitWebsiteDataTypes cacheTypes = static_cast<WebKitWebsiteDataTypes>(WEBKIT_WEBSITE_DATA_MEMORY_CACHE | WEBKIT_WEBSITE_DATA_DISK_CACHE);

test->clear(cacheTypes, 0);

GList* dataList = test->fetch(cacheTypes);
g_assert_null(dataList);

Expand Down
2 changes: 1 addition & 1 deletion Tools/TestWebKitAPI/glib/TestExpectations.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"TestWebsiteData": {
"subtests": {
"/webkit/WebKitWebsiteData/cache": {
"expected": {"wpe": {"status": ["FAIL", "CRASH", "PASS"], "bug": "webkit.org/b/260524"}}
"expected": {"wpe": {"status": ["CRASH", "PASS"], "bug": "webkit.org/b/260524"}}
}
}
},
Expand Down

0 comments on commit 2347502

Please sign in to comment.