Skip to content

Commit

Permalink
[GLib] In new API, update to base data directories in TestWebsiteData…
Browse files Browse the repository at this point in the history
… configuration test.

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

Reviewed by Michael Catanzaro.

In 260375@main, we use UnifiedOriginStorageLevel::Basic in the new
GLib API, which means that WebsiteDataStore::defaultLocalStorageDirectory
and WebsiteDataStore::defaultIndexedDBDatabaseDirectory are no longer
respected. Updating the dirs fixes the tests in the new API for WPE and
GTK; this essentially uses WebsiteDataStore:defaultGeneralStorageDirectory.

Some other helpful commit messages I found along the way were 253824@main,
259132@main and 260511@main; noting those here for historical purposes.

* Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp:
(testWebsiteDataConfiguration): Update to base directories per new API.
* Tools/TestWebKitAPI/glib/TestExpectations.json: remove failing WPE
test expectation that was added in a "meta gardening" bug ticket.

Canonical link: https://commits.webkit.org/266245@main
  • Loading branch information
abstractmachines authored and philn committed Jul 24, 2023
1 parent bc4e645 commit 85e47cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 8 additions & 2 deletions Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,12 @@ static void testWebsiteDataConfiguration(WebsiteDataTest* test, gconstpointer)
test->loadURI(kServer->getURIForPath("/empty").data());
test->waitUntilLoadFinished();
test->runJavaScriptAndWaitUntilFinished("window.localStorage.myproperty = 42;", nullptr);
GUniquePtr<char> localStorageDirectory(g_build_filename(Test::dataDirectory(), "localstorage", nullptr));
#if !ENABLE(2022_GLIB_API)
GUniquePtr<char> localStorageDirectory(g_build_filename(Test::dataDirectory(), "localstorage", nullptr));
g_assert_cmpstr(localStorageDirectory.get(), ==, webkit_website_data_manager_get_local_storage_directory(test->m_manager));
#endif
#if ENABLE(2022_GLIB_API)
GUniquePtr<char> localStorageDirectory(g_build_filename(Test::dataDirectory(), "storage", nullptr));
#endif
test->assertFileIsCreated(localStorageDirectory.get());
g_assert_true(g_file_test(localStorageDirectory.get(), G_FILE_TEST_IS_DIR));
Expand All @@ -194,9 +197,12 @@ static void testWebsiteDataConfiguration(WebsiteDataTest* test, gconstpointer)
test->loadURI(kServer->getURIForPath("/empty").data());
test->waitUntilLoadFinished();
test->runJavaScriptAndWaitUntilFinished("window.indexedDB.open('TestDatabase');", nullptr);
GUniquePtr<char> indexedDBDirectory(g_build_filename(Test::dataDirectory(), "databases", "indexeddb", nullptr));
#if !ENABLE(2022_GLIB_API)
GUniquePtr<char> indexedDBDirectory(g_build_filename(Test::dataDirectory(), "databases", "indexeddb", nullptr));
g_assert_cmpstr(indexedDBDirectory.get(), ==, webkit_website_data_manager_get_indexeddb_directory(test->m_manager));
#endif
#if ENABLE(2022_GLIB_API)
GUniquePtr<char> indexedDBDirectory(g_build_filename(Test::dataDirectory(), "storage", nullptr));
#endif
test->assertFileIsCreated(indexedDBDirectory.get());
g_assert_true(g_file_test(indexedDBDirectory.get(), G_FILE_TEST_IS_DIR));
Expand Down
3 changes: 0 additions & 3 deletions Tools/TestWebKitAPI/glib/TestExpectations.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@
"/webkit/WebKitWebsiteData/cache": {
"expected": {"gtk": {"status": ["PASS", "FAIL"], "bug": "webkit.org/b/254002"}}
},
"/webkit/WebKitWebsiteData/configuration": {
"expected": {"wpe": {"status": ["FAIL"], "bug": "webkit.org/b/256557"}}
},
"/webkit/WebKitWebsiteData/ephemeral": {
"expected": {"wpe": {"status": ["FAIL"], "bug": "webkit.org/b/256557"}}
},
Expand Down

0 comments on commit 85e47cd

Please sign in to comment.