RESOLVED FIXED 238269
Introduce an SPI to get website data directory for origin and use it in API tests
https://bugs.webkit.org/show_bug.cgi?id=238269
Summary Introduce an SPI to get website data directory for origin and use it in API t...
Sihui Liu
Reported 2022-03-23 10:09:55 PDT
...
Attachments
Patch (70.54 KB, patch)
2022-03-23 10:26 PDT, Sihui Liu
ews-feeder: commit-queue-
Patch (70.47 KB, patch)
2022-03-23 11:14 PDT, Sihui Liu
no flags
Patch for landing (69.64 KB, patch)
2022-03-24 22:58 PDT, Sihui Liu
no flags
Patch for landing (69.70 KB, patch)
2022-03-24 23:49 PDT, Sihui Liu
no flags
Sihui Liu
Comment 1 2022-03-23 10:26:18 PDT
Sihui Liu
Comment 2 2022-03-23 11:14:56 PDT
Alex Christensen
Comment 3 2022-03-23 12:51:05 PDT
Comment on attachment 455523 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=455523&action=review > Source/WebKit/ChangeLog:12 > + storage), we need to update these tests with new paths, otherwise the tests will check the wrong paths. Let's > + just add an SPI so these tests can get the paths in use dynamically, which would avoid test breakage when > + we do website data migration. As we do this, we should also add tests that write data to the old location and verify that the migration happens successfully. > Source/WebKit/NetworkProcess/storage/NetworkStorageManager.cpp:653 > + removeOriginStorageManagerIfPossible(origin); Why is this done in a function that just gets the directory?
Sihui Liu
Comment 4 2022-03-23 14:16:30 PDT
(In reply to Alex Christensen from comment #3) > Comment on attachment 455523 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=455523&action=review > > > Source/WebKit/ChangeLog:12 > > + storage), we need to update these tests with new paths, otherwise the tests will check the wrong paths. Let's > > + just add an SPI so these tests can get the paths in use dynamically, which would avoid test breakage when > > + we do website data migration. > > As we do this, we should also add tests that write data to the old location > and verify that the migration happens successfully. We have test for migration, e.g. WebKit.MigrateLocalStorageDataToGeneralStorageDirectory, where we still use hardcoded paths (since we want to ensure files are moved correctly from old locations to new locations.) > > > Source/WebKit/NetworkProcess/storage/NetworkStorageManager.cpp:653 > > + removeOriginStorageManagerIfPossible(origin); > > Why is this done in a function that just gets the directory? Because localOriginStorageManager(origin) may create a new OriginStorageManager to get directory, and we don't want to hold the object if it is not in use after getting directory.
Chris Dumez
Comment 5 2022-03-23 15:39:48 PDT
Comment on attachment 455523 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=455523&action=review > Source/WebKit/Scripts/webkit/messages.py:965 > + 'WebKit::WebsiteDataType': ['"WebsiteDataType.h"'], Why is this needed? The header name matches the class name so it shouldn't be needed. > Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm:854 > + _websiteDataStore->originDirectoryForTesting(origin, topOrigin, *websiteDataType, [completionHandlerCopy](auto result) { completionHandlerCopy = WTFMove(completionHandlerCopy)
Sihui Liu
Comment 6 2022-03-24 22:58:43 PDT
Created attachment 455727 [details] Patch for landing
EWS
Comment 7 2022-03-24 22:59:47 PDT
Tools/Scripts/svn-apply failed to apply attachment 455727 [details] to trunk. Please resolve the conflicts and upload a new patch.
Sihui Liu
Comment 8 2022-03-24 23:49:23 PDT
Created attachment 455730 [details] Patch for landing
EWS
Comment 9 2022-03-25 01:55:25 PDT
Committed r291851 (248863@main): <https://commits.webkit.org/248863@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 455730 [details].
Radar WebKit Bug Importer
Comment 10 2022-03-25 01:56:16 PDT
Note You need to log in before you can comment on or make changes to this bug.