Add completion handlers to TestRunner functions setStatisticsLastSeen(), setStatistic...
[WebKit-https.git] / LayoutTests / http / tests / resourceLoadStatistics / strip-referrer-to-origin-for-prevalent-subresource-redirects.html
index 391fbb5..e8b7f09 100644 (file)
             referrer = data;
             shouldBeEqualToString("referrer", "http://127.0.0.1:8000/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects.html");
 
-            testRunner.setStatisticsPrevalentResource("http://localhost", true);
-            if (!testRunner.isStatisticsPrevalentResource("http://localhost"))
-                testFailed("Host did not get set as prevalent resource.");
+            testRunner.setStatisticsPrevalentResource("http://localhost", true, function() {
+                if (!testRunner.isStatisticsPrevalentResource("http://localhost"))
+                    testFailed("Host did not get set as prevalent resource.");
 
-            testRunner.statisticsUpdateCookiePartitioning(function() {
-                openIframe("resources/redirect.php?redirectTo=http://localhost:8000/resourceLoadStatistics/resources/echo-referrer.php", function() {
-                    setEnableFeature(false, finishJSTest);
+                testRunner.statisticsUpdateCookiePartitioning(function() {
+                    openIframe("resources/redirect.php?redirectTo=http://localhost:8000/resourceLoadStatistics/resources/echo-referrer.php", function() {
+                        setEnableFeature(false, finishJSTest);
+                    });
                 });
             });
-
         }).catch(function(error) {
             console.log(error.message);
             setEnableFeature(false, finishJSTest);