Add completion handlers to TestRunner functions setStatisticsLastSeen(), setStatistic...
[WebKit-https.git] / LayoutTests / http / tests / resourceLoadStatistics / do-not-block-top-level-navigation-redirect.html
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4     <meta charset="UTF-8">
5     <script src="/js-test-resources/js-test.js"></script>
6 <script>
7     description("Tests that blocking is not applied to top-level navigation redirects.");
8     jsTestIsAsync = true;
9
10     internals.setResourceLoadStatisticsEnabled(true);
11     testRunner.setCookieStoragePartitioningEnabled(true);
12
13     function doRedirect()
14     {
15         testRunner.setStatisticsPrevalentResource("http://localhost", true, function() {
16             if (!testRunner.isStatisticsPrevalentResource("http://localhost")) {
17                 testFailed("Host did not get set as prevalent resource.");
18                 finishJSTest();
19             }
20             else
21                 window.location = "http://localhost:8000/cookies/resources/set-cookie-on-redirect.php?step=1";
22         });
23     }
24 </script>
25 </head>
26 <body onload="doRedirect()">
27 </body>
28 </html>