Unreviewed, rolling out r250324.
[WebKit-https.git] / LayoutTests / http / tests / resourceLoadStatistics / log-cross-site-load-with-link-decoration.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4     <script src="resources/util.js"></script>
5 </head>
6 <body onload="setTimeout('runTest()', 0)">
7 <div id="description">Test logging of link decorated cross-site navigations from a prevalent resource.</div>
8 <div id="output"></div>
9 <script>
10     if (window.testRunner) {
11         testRunner.waitUntilDone();
12         testRunner.dumpAsText();
13     }
14
15     function navigateCrossOrigin() {
16         document.location.href = destinationOrigin + "/resourceLoadStatistics/log-cross-site-load-with-link-decoration.html?link=decoration";
17     }
18
19     const destinationOrigin = "http://localhost:8000";
20     const prevalentResourceOrigin = "http://127.0.0.1:8000";
21     function runTest() {
22         if (document.location.origin === prevalentResourceOrigin) {
23             setEnableFeature(true, function () {
24                 testRunner.setStatisticsPrevalentResource(prevalentResourceOrigin, true, function() {
25                     if (!testRunner.isStatisticsPrevalentResource(prevalentResourceOrigin))
26                         testFailed("Host did not get set as prevalent resource.");
27                     testRunner.statisticsUpdateCookieBlocking(navigateCrossOrigin);
28                 });
29
30             });
31         } else {
32             testRunner.dumpResourceLoadStatistics();
33             setEnableFeature(false, function () {
34                 testRunner.notifyDone();
35             });
36         }
37     }
38 </script>
39 </body>
40 </html>