Add completion handlers to TestRunner functions setStatisticsLastSeen(), setStatistic...
[WebKit-https.git] / LayoutTests / http / tests / resourceLoadStatistics / third-party-cookie-with-and-without-user-interaction.html
index e217a03..b72163e 100644 (file)
     }
 
     function setUserInteractionAndContinue() {
-        testRunner.setStatisticsHasHadUserInteraction(thirdPartyOrigin, true);
-        if (!testRunner.isStatisticsHasHadUserInteraction(thirdPartyOrigin))
-            testFailed("Third party did not get logged for user interaction.");
-        runTest();
+        testRunner.setStatisticsHasHadUserInteraction(thirdPartyOrigin, true, function() {
+            if (!testRunner.isStatisticsHasHadUserInteraction(thirdPartyOrigin))
+                testFailed("Third party did not get logged for user interaction.");
+            runTest();
+        });
     }
 
     function runTest() {
             document.location.hash = "step1";
 
             // Start test with third party as non-prevalent
-            testRunner.setStatisticsPrevalentResource(thirdPartyHostname, false);
-            testRunner.setStatisticsHasHadUserInteraction(thirdPartyOrigin, false);
-            testRunner.statisticsSetShouldPartitionCookiesForHost(thirdPartyHostname, false, runTest);
+            testRunner.setStatisticsPrevalentResource(thirdPartyHostname, false, function() {
+                testRunner.setStatisticsHasHadUserInteraction(thirdPartyOrigin, false, function() {
+                    testRunner.statisticsSetShouldPartitionCookiesForHost(thirdPartyHostname, false, runTest);
+                });
+            });
         });
     } else {
         runTest();