Rename LineLayoutInterface to LineLayoutTraversal
[WebKit-https.git] / LayoutTests / http / tests / resourceLoadStatistics / sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-database.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4     <script src="/js-test-resources/js-test.js"></script>
5     <script src="resources/util.js"></script>
6     <script>
7         description("Tests that redirects for a non-sandboxed iframe nested in a sandboxed iframe get counted properly.");
8         jsTestIsAsync = true;
9         window.addEventListener("message", receiveMessage, false);
10
11         function finishTest() {
12             setEnableFeature(false, finishJSTest);
13         }
14
15         if (testRunner) {
16             testRunner.setUseITPDatabase(true);
17             setEnableFeature(true, function() {
18                 testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true);
19                 testRunner.installStatisticsDidScanDataRecordsCallback(checkStats);
20             });
21         }
22
23         var lastPageInRedirectChainLoaded = false;
24         var statsChecked = false;
25
26         function receiveMessage(event) {
27             if (event.origin === "null") {
28                 if (event.data.indexOf("PASS") === -1)
29                     testFailed(event.data.replace("FAIL ", ""));
30             } else
31                 testFailed("Received a message from an unexpected origin: " + event.origin);
32
33             lastPageInRedirectChainLoaded = true;
34             if (statsChecked)
35                 finishTest();
36             else
37                 testRunner.statisticsNotifyObserver();
38         }
39
40         function checkStats() {
41             shouldBeTrue('testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1")');
42             shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://localhost", "http://127.0.0.1")');
43             shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://127.0.0.1", "http://localhost")');
44
45             statsChecked = true;
46             if (lastPageInRedirectChainLoaded)
47                 finishTest();
48         }
49     </script>
50 </head>
51 <body>
52 <iframe sandbox="allow-scripts" src="http://127.0.0.1:8000/resourceLoadStatistics/resources/page-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html">
53 </iframe>
54 </body>
55 </html>