Changeset 258672 in webkit
- Timestamp:
- Mar 18, 2020 6:26:16 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r258669 r258672 1 2020-03-18 John Wilander <wilander@apple.com> 2 3 WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener() should call its ephemeral counterpart when appropriate 4 https://bugs.webkit.org/show_bug.cgi?id=209245 5 <rdar://problem/60511121> 6 7 Reviewed by Chris Dumez. 8 9 There are new tests added for the code change. The rest of these change are to better 10 align test cases with asynchronous TestRunner functions that landed in 11 https://trac.webkit.org/changeset/258566 and https://trac.webkit.org/changeset/258598. 12 13 While working on the new tests, I found a crasher which Chris Dumez fixed in 14 https://trac.webkit.org/changeset/258562, so there's a dependency on that change. 15 16 * http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction-database.html: 17 * http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction.html: 18 * http/tests/resourceLoadStatistics/count-third-party-script-import-in-worker-database.html: 19 * http/tests/resourceLoadStatistics/count-third-party-script-import-in-worker.html: 20 * http/tests/resourceLoadStatistics/count-third-party-script-loads-database.html: 21 * http/tests/resourceLoadStatistics/count-third-party-script-loads.html: 22 * http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.php: 23 * http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.php: 24 * http/tests/resourceLoadStatistics/dont-count-third-party-image-as-third-party-script-database.html: 25 * http/tests/resourceLoadStatistics/dont-count-third-party-image-as-third-party-script.html: 26 * http/tests/resourceLoadStatistics/grandfathering-database.html: 27 * http/tests/resourceLoadStatistics/grandfathering.html: 28 * http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.php: 29 * http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.php: 30 * http/tests/storageAccess/deny-storage-access-under-opener-ephemeral-expected.txt: Added. 31 * http/tests/storageAccess/deny-storage-access-under-opener-ephemeral.html: Added. 32 * http/tests/storageAccess/deny-storage-access-under-opener-if-auto-dismiss-ephemeral-expected.txt: Added. 33 * http/tests/storageAccess/deny-storage-access-under-opener-if-auto-dismiss-ephemeral.html: Added. 34 * http/tests/storageAccess/grant-storage-access-under-opener-at-popup-user-gesture-ephemeral-expected.txt: Added. 35 * http/tests/storageAccess/grant-storage-access-under-opener-at-popup-user-gesture-ephemeral.html: Added. 36 1 37 2020-03-18 Ryan Haddad <ryanhaddad@apple.com> 2 38 -
trunk/LayoutTests/http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction-database.html
r252210 r258672 69 69 if (document.location.host === partitionHost && document.location.hash == "" && window.testRunner && window.internals) { 70 70 testRunner.setUseITPDatabase(true); 71 testRunner.waitUntilDone(); 71 72 setEnableFeature(true, function() { 72 testRunner.waitUntilDone();73 73 testRunner.dumpChildFramesAsText(); 74 74 document.location.hash = "step1"; -
trunk/LayoutTests/http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction.html
r234440 r258672 68 68 69 69 if (document.location.host === partitionHost && document.location.hash == "" && window.testRunner && window.internals) { 70 testRunner.waitUntilDone(); 70 71 setEnableFeature(true, function() { 71 testRunner.waitUntilDone();72 72 testRunner.dumpChildFramesAsText(); 73 73 document.location.hash = "step1"; -
trunk/LayoutTests/http/tests/resourceLoadStatistics/count-third-party-script-import-in-worker-database.html
r252641 r258672 27 27 case "": 28 28 if (window.testRunner && window.internals) { 29 testRunner.waitUntilDone(); 29 30 setEnableFeature(true, function() { 30 31 testRunner.setUseITPDatabase(true); 31 testRunner.waitUntilDone();32 32 testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true); 33 33 testRunner.installStatisticsDidScanDataRecordsCallback(finishTest); -
trunk/LayoutTests/http/tests/resourceLoadStatistics/count-third-party-script-import-in-worker.html
r252641 r258672 27 27 case "": 28 28 if (window.testRunner && window.internals) { 29 testRunner.waitUntilDone(); 29 30 setEnableFeature(true, function() { 30 testRunner.waitUntilDone();31 31 testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true); 32 32 testRunner.installStatisticsDidScanDataRecordsCallback(finishTest); -
trunk/LayoutTests/http/tests/resourceLoadStatistics/count-third-party-script-loads-database.html
r252641 r258672 23 23 case "": 24 24 if (window.testRunner && window.internals) { 25 testRunner.waitUntilDone(); 25 26 setEnableFeature(true, function() { 26 27 testRunner.setUseITPDatabase(true); 27 testRunner.waitUntilDone();28 28 testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true); 29 29 testRunner.installStatisticsDidScanDataRecordsCallback(finishTest); -
trunk/LayoutTests/http/tests/resourceLoadStatistics/count-third-party-script-loads.html
r252641 r258672 23 23 case "": 24 24 if (window.testRunner && window.internals) { 25 testRunner.waitUntilDone(); 25 26 setEnableFeature(true, function() { 26 testRunner.waitUntilDone();27 27 testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true); 28 28 testRunner.installStatisticsDidScanDataRecordsCallback(finishTest); -
trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-database.php
r251402 r258672 58 58 function runTest() { 59 59 switch (document.location.hash) { 60 case "": 61 if (document.location.origin !== prevalentOrigin) 62 testFailed("Test is not starting out on " + prevalentOrigin + "."); 63 64 testRunner.setUseITPDatabase(true); 65 setEnableFeature(true, function () { 66 if (testRunner.isStatisticsPrevalentResource(prevalentOrigin)) 67 testFailed(prevalentOrigin + " was classified as prevalent resource before the test starts."); 68 document.location.hash = "step1"; 69 runTest(); 70 }); 60 71 case "#step1": 61 72 setSessionCookie(); … … 97 108 } 98 109 } 99 100 if (document.location.hash === "") {101 if (document.location.origin !== prevalentOrigin)102 testFailed("Test is not starting out on " + prevalentOrigin + ".");103 104 testRunner.setUseITPDatabase(true);105 setEnableFeature(true, function () {106 if (testRunner.isStatisticsPrevalentResource(prevalentOrigin))107 testFailed(prevalentOrigin + " was classified as prevalent resource before the test starts.");108 document.location.hash = "step1";109 });110 }111 110 </script> 112 111 </body> -
trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.php
r251402 r258672 58 58 function runTest() { 59 59 switch (document.location.hash) { 60 case "": 61 if (document.location.origin !== prevalentOrigin) 62 testFailed("Test is not starting out on " + prevalentOrigin + "."); 63 64 setEnableFeature(true, function () { 65 if (testRunner.isStatisticsPrevalentResource(prevalentOrigin)) 66 testFailed(prevalentOrigin + " was classified as prevalent resource before the test starts."); 67 document.location.hash = "step1"; 68 runTest(); 69 }); 60 70 case "#step1": 61 71 setSessionCookie(); … … 97 107 } 98 108 } 99 100 if (document.location.hash === "") {101 if (document.location.origin !== prevalentOrigin)102 testFailed("Test is not starting out on " + prevalentOrigin + ".");103 setEnableFeature(true, function () {104 if (testRunner.isStatisticsPrevalentResource(prevalentOrigin))105 testFailed(prevalentOrigin + " was classified as prevalent resource before the test starts.");106 document.location.hash = "step1";107 });108 }109 109 </script> 110 110 </body> -
trunk/LayoutTests/http/tests/resourceLoadStatistics/dont-count-third-party-image-as-third-party-script-database.html
r252641 r258672 23 23 case "": 24 24 if (window.testRunner && window.internals) { 25 testRunner.waitUntilDone(); 25 26 setEnableFeature(true, function() { 26 27 testRunner.setUseITPDatabase(true); 27 testRunner.waitUntilDone();28 28 testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true); 29 29 testRunner.installStatisticsDidScanDataRecordsCallback(finishTest); -
trunk/LayoutTests/http/tests/resourceLoadStatistics/dont-count-third-party-image-as-third-party-script.html
r252641 r258672 23 23 case "": 24 24 if (window.testRunner && window.internals) { 25 testRunner.waitUntilDone(); 25 26 setEnableFeature(true, function() { 26 testRunner.waitUntilDone();27 27 testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true); 28 28 testRunner.installStatisticsDidScanDataRecordsCallback(finishTest); -
trunk/LayoutTests/http/tests/resourceLoadStatistics/grandfathering-database.html
r252210 r258672 101 101 if (document.location.hash === "" && window.testRunner && window.internals) { 102 102 testRunner.setUseITPDatabase(true); 103 testRunner.waitUntilDone(); 103 104 setEnableFeature(true, function() { 104 105 testRunner.setStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval(false); 105 106 testRunner.setStatisticsMinimumTimeBetweenDataRecordsRemoval(0); 106 107 107 testRunner.waitUntilDone();108 108 testRunner.dumpChildFramesAsText(); 109 109 document.location.hash = "step1"; -
trunk/LayoutTests/http/tests/resourceLoadStatistics/grandfathering.html
r234440 r258672 99 99 100 100 if (document.location.hash === "" && window.testRunner && window.internals) { 101 testRunner.waitUntilDone(); 101 102 setEnableFeature(true, function() { 102 103 testRunner.setStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval(false); 103 104 testRunner.setStatisticsMinimumTimeBetweenDataRecordsRemoval(0); 104 105 105 testRunner.waitUntilDone();106 106 testRunner.dumpChildFramesAsText(); 107 107 document.location.hash = "step1"; -
trunk/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-database.php
r251402 r258672 58 58 function runTest() { 59 59 switch (document.location.hash) { 60 case "": 61 if (document.location.origin !== prevalentOrigin) 62 testFailed("Test is not starting out on " + prevalentOrigin + "."); 63 testRunner.setUseITPDatabase(true); 64 setEnableFeature(true, function () { 65 if (testRunner.isStatisticsPrevalentResource(prevalentOrigin)) 66 testFailed(prevalentOrigin + " was classified as prevalent resource before the test starts."); 67 document.location.hash = "step1"; 68 runTest(); 69 }); 70 break; 60 71 case "#step1": 61 72 testRunner.setStatisticsHasHadUserInteraction(prevalentOrigin, true, function() { … … 99 110 } 100 111 } 101 102 if (document.location.hash === "") {103 if (document.location.origin !== prevalentOrigin)104 testFailed("Test is not starting out on " + prevalentOrigin + ".");105 testRunner.setUseITPDatabase(true);106 setEnableFeature(true, function () {107 if (testRunner.isStatisticsPrevalentResource(prevalentOrigin))108 testFailed(prevalentOrigin + " was classified as prevalent resource before the test starts.");109 document.location.hash = "step1";110 });111 }112 112 </script> 113 113 </body> -
trunk/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.php
r251402 r258672 58 58 function runTest() { 59 59 switch (document.location.hash) { 60 case "": 61 if (document.location.origin !== prevalentOrigin) 62 testFailed("Test is not starting out on " + prevalentOrigin + "."); 63 setEnableFeature(true, function () { 64 if (testRunner.isStatisticsPrevalentResource(prevalentOrigin)) 65 testFailed(prevalentOrigin + " was classified as prevalent resource before the test starts."); 66 document.location.hash = "step1"; 67 runTest(); 68 }); 69 break; 60 70 case "#step1": 61 71 testRunner.setStatisticsHasHadUserInteraction(prevalentOrigin, true, function() { … … 99 109 } 100 110 } 101 102 if (document.location.hash === "") {103 if (document.location.origin !== prevalentOrigin)104 testFailed("Test is not starting out on " + prevalentOrigin + ".");105 setEnableFeature(true, function () {106 if (testRunner.isStatisticsPrevalentResource(prevalentOrigin))107 testFailed(prevalentOrigin + " was classified as prevalent resource before the test starts.");108 document.location.hash = "step1";109 });110 }111 111 </script> 112 112 </body> -
trunk/Source/WebKit/ChangeLog
r258671 r258672 1 2020-03-18 John Wilander <wilander@apple.com> 2 3 WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener() should call its ephemeral counterpart when appropriate 4 https://bugs.webkit.org/show_bug.cgi?id=209245 5 <rdar://problem/60511121> 6 7 Reviewed by Chris Dumez. 8 9 This change makes sure that WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener() 10 calls WebResourceLoadStatisticsStore::requestStorageAccessUnderOpenerEphemeral() for ephemeral 11 sessions. 12 13 Tests: http/tests/storageAccess/deny-storage-access-under-opener-ephemeral.html 14 http/tests/storageAccess/deny-storage-access-under-opener-if-auto-dismiss-ephemeral.html 15 http/tests/storageAccess/grant-storage-access-under-opener-at-popup-user-gesture-ephemeral.html 16 17 * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: 18 (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener): 19 1 20 2020-03-18 Brent Fulgham <bfulgham@apple.com> 2 21 -
trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp
r258448 r258672 485 485 ASSERT(RunLoop::isMain()); 486 486 487 if (isEphemeral()) 488 return requestStorageAccessUnderOpenerEphemeral(WTFMove(domainInNeedOfStorageAccess), openerPageID, WTFMove(openerDomain)); 489 487 490 // It is safe to move the strings to the background queue without isolated copy here because they are r-value references 488 491 // coming from IPC. Strings which are safe to move to other threads as long as nobody on this thread holds a reference -
trunk/Tools/ChangeLog
r258659 r258672 1 2020-03-18 John Wilander <wilander@apple.com> 2 3 WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener() should call its ephemeral counterpart when appropriate 4 https://bugs.webkit.org/show_bug.cgi?id=209245 5 <rdar://problem/60511121> 6 7 Reviewed by Chris Dumez. 8 9 These changes to the TestRunner makes sure that 10 - statisticsClearInMemoryAndPersistentStore() 11 - statisticsClearInMemoryAndPersistentStoreModifiedSinceHours() 12 ... use their own StatisticsDidClearInMemoryAndPersistentStoreCallbackID 13 and adds the infrastructure for that. 14 15 * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: 16 (WTR::InjectedBundle::didReceiveMessageToPage): 17 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: 18 (WTR::TestRunner::statisticsClearInMemoryAndPersistentStore): 19 (WTR::TestRunner::statisticsClearInMemoryAndPersistentStoreModifiedSinceHours): 20 (WTR::TestRunner::statisticsCallClearInMemoryAndPersistentStoreCallback): 21 * WebKitTestRunner/InjectedBundle/TestRunner.h: 22 * WebKitTestRunner/TestController.cpp: 23 (WTR::TestController::statisticsClearInMemoryAndPersistentStore): 24 (WTR::TestController::statisticsClearInMemoryAndPersistentStoreModifiedSinceHours): 25 * WebKitTestRunner/TestInvocation.cpp: 26 (WTR::TestInvocation::didClearStatisticsInMemoryAndPersistentStore): 27 * WebKitTestRunner/TestInvocation.h: 28 1 29 2020-03-18 Wenson Hsieh <wenson_hsieh@apple.com> 2 30 -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
r258421 r258672 328 328 } 329 329 330 if (WKStringIsEqualToUTF8CString(messageName, "CallDidClearStatisticsInMemoryAndPersistentStore")) { 331 m_testRunner->statisticsCallClearInMemoryAndPersistentStoreCallback(); 332 return; 333 } 334 330 335 if (WKStringIsEqualToUTF8CString(messageName, "CallDidClearStatisticsThroughWebsiteDataRemoval")) { 331 336 m_testRunner->statisticsCallClearThroughWebsiteDataRemovalCallback(); -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r258598 r258672 749 749 StatisticsDidRunTelemetryCallbackID, 750 750 StatisticsDidClearThroughWebsiteDataRemovalCallbackID, 751 StatisticsDidClearInMemoryAndPersistentStoreCallbackID, 751 752 StatisticsDidResetToConsistentStateCallbackID, 752 753 StatisticsDidSetBlockCookiesForHostCallbackID, … … 2144 2145 void TestRunner::statisticsClearInMemoryAndPersistentStore(JSValueRef callback) 2145 2146 { 2146 cacheTestRunnerCallback(StatisticsDidClear ThroughWebsiteDataRemovalCallbackID, callback);2147 cacheTestRunnerCallback(StatisticsDidClearInMemoryAndPersistentStoreCallbackID, callback); 2147 2148 2148 2149 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("StatisticsClearInMemoryAndPersistentStore")); … … 2152 2153 void TestRunner::statisticsClearInMemoryAndPersistentStoreModifiedSinceHours(unsigned hours, JSValueRef callback) 2153 2154 { 2154 cacheTestRunnerCallback(StatisticsDidClear ThroughWebsiteDataRemovalCallbackID, callback);2155 cacheTestRunnerCallback(StatisticsDidClearInMemoryAndPersistentStoreCallbackID, callback); 2155 2156 2156 2157 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("StatisticsClearInMemoryAndPersistentStoreModifiedSinceHours")); … … 2274 2275 callTestRunnerCallback(StatisticsDidSetFirstPartyWebsiteDataRemovalModeCallbackID); 2275 2276 m_hasSetFirstPartyWebsiteDataRemovalModeCallback = false; 2277 } 2278 2279 void TestRunner::statisticsCallClearInMemoryAndPersistentStoreCallback() 2280 { 2281 callTestRunnerCallback(StatisticsDidClearInMemoryAndPersistentStoreCallbackID); 2276 2282 } 2277 2283 -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
r258421 r258672 438 438 void statisticsClearThroughWebsiteDataRemoval(JSValueRef callback); 439 439 void statisticsDeleteCookiesForHost(JSStringRef hostName, bool includeHttpOnlyCookies); 440 void statisticsCallClearInMemoryAndPersistentStoreCallback(); 440 441 void statisticsCallClearThroughWebsiteDataRemovalCallback(); 441 442 bool isStatisticsHasLocalStorage(JSStringRef hostName); -
trunk/Tools/WebKitTestRunner/TestController.cpp
r258436 r258672 3632 3632 WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore(websiteDataStore(), &context, resourceStatisticsVoidResultCallback); 3633 3633 runUntil(context.done, noTimeout); 3634 m_currentInvocation->didClearStatistics ThroughWebsiteDataRemoval();3634 m_currentInvocation->didClearStatisticsInMemoryAndPersistentStore(); 3635 3635 } 3636 3636 … … 3640 3640 WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours(websiteDataStore(), hours, &context, resourceStatisticsVoidResultCallback); 3641 3641 runUntil(context.done, noTimeout); 3642 m_currentInvocation->didClearStatistics ThroughWebsiteDataRemoval();3642 m_currentInvocation->didClearStatisticsInMemoryAndPersistentStore(); 3643 3643 } 3644 3644 -
trunk/Tools/WebKitTestRunner/TestInvocation.cpp
r258598 r258672 1881 1881 } 1882 1882 1883 void TestInvocation::didClearStatisticsInMemoryAndPersistentStore() 1884 { 1885 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("CallDidClearStatisticsInMemoryAndPersistentStore")); 1886 WKPagePostMessageToInjectedBundle(TestController::singleton().mainWebView()->page(), messageName.get(), 0); 1887 } 1888 1883 1889 void TestInvocation::didClearStatisticsThroughWebsiteDataRemoval() 1884 1890 { -
trunk/Tools/WebKitTestRunner/TestInvocation.h
r258421 r258672 73 73 void notifyDownloadDone(); 74 74 75 void didClearStatisticsInMemoryAndPersistentStore(); 75 76 void didClearStatisticsThroughWebsiteDataRemoval(); 76 77 void didSetShouldDowngradeReferrer();
Note: See TracChangeset
for help on using the changeset viewer.