RESOLVED FIXED 208260
TestWebKitAPI and WebKitTestRunner should have bundle identifiers
https://bugs.webkit.org/show_bug.cgi?id=208260
Summary TestWebKitAPI and WebKitTestRunner should have bundle identifiers
Kate Cheney
Reported 2020-02-26 13:55:22 PST
This is useful for testing layout and api cases where a bundle identifier is needed, so we don't have to manually set it each time.
Attachments
Patch (7.43 KB, patch)
2020-02-26 14:10 PST, Kate Cheney
no flags
Patch for landing (8.40 KB, patch)
2020-02-26 14:58 PST, Kate Cheney
no flags
Patch (39.89 KB, patch)
2020-02-27 08:03 PST, Kate Cheney
no flags
Patch (40.86 KB, patch)
2020-02-27 14:00 PST, Kate Cheney
no flags
Patch (41.58 KB, patch)
2020-02-27 14:27 PST, Kate Cheney
no flags
Patch (41.53 KB, patch)
2020-02-27 15:37 PST, Kate Cheney
no flags
Radar WebKit Bug Importer
Comment 1 2020-02-26 13:55:57 PST
Kate Cheney
Comment 2 2020-02-26 14:10:42 PST
Tim Horton
Comment 3 2020-02-26 14:14:23 PST
Comment on attachment 391779 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=391779&action=review > Tools/TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig:27 > +PRODUCT_BUNDLE_IDENTIFIER = com.apple.TestWebKitAPI; I wonder if these should be com.apple.WebKit.* like the subprocesses are > Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:5333 > + CREATE_INFOPLIST_SECTION_IN_BINARY = YES; > + INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; You should move these two lines to the xcconfig, not here. > Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:5342 > + CREATE_INFOPLIST_SECTION_IN_BINARY = YES; > + INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; Ditto > Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:1291 > + CREATE_INFOPLIST_SECTION_IN_BINARY = YES; > + INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; Ditto etc etc etc
Kate Cheney
Comment 4 2020-02-26 14:58:28 PST
Created attachment 391784 [details] Patch for landing
Kate Cheney
Comment 5 2020-02-26 14:59:16 PST
(In reply to Tim Horton from comment #3) > Comment on attachment 391779 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=391779&action=review > > > Tools/TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig:27 > > +PRODUCT_BUNDLE_IDENTIFIER = com.apple.TestWebKitAPI; > > I wonder if these should be com.apple.WebKit.* like the subprocesses are > Good call. > > Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:5333 > > + CREATE_INFOPLIST_SECTION_IN_BINARY = YES; > > + INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; > > You should move these two lines to the xcconfig, not here. > > > Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:5342 > > + CREATE_INFOPLIST_SECTION_IN_BINARY = YES; > > + INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; > > Ditto > > > Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:1291 > > + CREATE_INFOPLIST_SECTION_IN_BINARY = YES; > > + INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; > > Ditto etc etc etc Done! Thanks Tim.
WebKit Commit Bot
Comment 6 2020-02-26 15:30:54 PST
Comment on attachment 391784 [details] Patch for landing Clearing flags on attachment: 391784 Committed r257522: <https://trac.webkit.org/changeset/257522>
WebKit Commit Bot
Comment 7 2020-02-26 15:30:55 PST
All reviewed patches have been landed. Closing bug.
Ryan Haddad
Comment 8 2020-02-26 17:37:16 PST
This change caused 16 API test failures on the bots: https://build.webkit.org/builders/Apple-Catalina-Release-WK2-Tests/builds/3268 Please let API test EWS bots complete before re-landing.
Ryan Haddad
Comment 9 2020-02-26 17:38:17 PST
Reverted r257522 for reason: Caused 16 API test failures on the bots Committed r257540: <https://trac.webkit.org/changeset/257540>
Kate Cheney
Comment 10 2020-02-27 08:03:05 PST
Kate Cheney
Comment 11 2020-02-27 08:08:51 PST
Letting EWS run. Adding a bundle ID changes the file path for TestWebKitAPI website data, so this patch updates the expectations for tests which need to know it. There should probably be a central place where tests can construct the default path the same way the default WebsiteDataStore does instead of hardcoding it each time. That would avoid test failures like these if the default path changes in the future.
Jonathan Bedard
Comment 12 2020-02-27 08:14:21 PST
(In reply to katherine_cheney from comment #11) > Letting EWS run. > > Adding a bundle ID changes the file path for TestWebKitAPI website data, so > this patch updates the expectations for tests which need to know it. There > should probably be a central place where tests can construct the default > path the same way the default WebsiteDataStore does instead of hardcoding it > each time. That would avoid test failures like these if the default path > changes in the future. We should be careful about this. That 'central place' needs to be in testing code, not WebKit, because we have had bugs where we used the wrong default data store, and we want API tests to catch that sort of thing.
Kate Cheney
Comment 13 2020-02-27 14:00:52 PST
Kate Cheney
Comment 14 2020-02-27 14:27:28 PST
Tim Horton
Comment 15 2020-02-27 15:13:50 PST
Comment on attachment 391918 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=391918&action=review > Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:456 > + NSURL *defaultResourceLoadStatisticsFilePath = [NSURL fileURLWithPath:[@"~/Library/WebKit/com.apple.WebKit.TestWebKitAPI/WebsiteData/ResourceLoadStatistics/full_browsing_session_resourceLog.plist" stringByExpandingTildeInPath] isDirectory:NO]; I wonder if we should have a helper for "give me a path inside TWKAPI's library dir" > Tools/TestWebKitAPI/Tests/mac/SetAndUpdateCacheModel.mm:49 > +static void resetTestState() > +{ > + WebPreferences *standardPreferences = [WebPreferences standardPreferences]; > + [standardPreferences setCacheModel:WebCacheModelDocumentViewer]; > +} > + > TEST(WebKitLegacy, SetAndUpdateCacheModelInitialModel) > { > + resetTestState(); > + > EXPECT_EQ((int)WebCacheModelDocumentViewer, (int)[WebView _cacheModel]); > I think the point of this test is to test the default value, so it's wrong to set it to something beforehand. Can you instead /delete/ the default, so we fall back to the default-default?
Tim Horton
Comment 16 2020-02-27 15:19:15 PST
(In reply to Tim Horton from comment #15) > Comment on attachment 391918 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=391918&action=review > > > Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:456 > > + NSURL *defaultResourceLoadStatisticsFilePath = [NSURL fileURLWithPath:[@"~/Library/WebKit/com.apple.WebKit.TestWebKitAPI/WebsiteData/ResourceLoadStatistics/full_browsing_session_resourceLog.plist" stringByExpandingTildeInPath] isDirectory:NO]; > > I wonder if we should have a helper for "give me a path inside TWKAPI's > library dir" ... oh, you already said that
Kate Cheney
Comment 17 2020-02-27 15:35:43 PST
(In reply to Tim Horton from comment #15) > Comment on attachment 391918 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=391918&action=review > > > Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:456 > > + NSURL *defaultResourceLoadStatisticsFilePath = [NSURL fileURLWithPath:[@"~/Library/WebKit/com.apple.WebKit.TestWebKitAPI/WebsiteData/ResourceLoadStatistics/full_browsing_session_resourceLog.plist" stringByExpandingTildeInPath] isDirectory:NO]; > > I wonder if we should have a helper for "give me a path inside TWKAPI's > library dir" > > > Tools/TestWebKitAPI/Tests/mac/SetAndUpdateCacheModel.mm:49 > > +static void resetTestState() > > +{ > > + WebPreferences *standardPreferences = [WebPreferences standardPreferences]; > > + [standardPreferences setCacheModel:WebCacheModelDocumentViewer]; > > +} > > + > > TEST(WebKitLegacy, SetAndUpdateCacheModelInitialModel) > > { > > + resetTestState(); > > + > > EXPECT_EQ((int)WebCacheModelDocumentViewer, (int)[WebView _cacheModel]); > > > > I think the point of this test is to test the default value, so it's wrong > to set it to something beforehand. > > Can you instead /delete/ the default, so we fall back to the default-default? Yes. Very good idea.
Kate Cheney
Comment 18 2020-02-27 15:37:35 PST
WebKit Commit Bot
Comment 19 2020-02-27 19:43:25 PST
Comment on attachment 391933 [details] Patch Clearing flags on attachment: 391933 Committed r257614: <https://trac.webkit.org/changeset/257614>
WebKit Commit Bot
Comment 20 2020-02-27 19:43:27 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.