cfac11d88858b485b9d55ea88da099f48b0cf54e
[WebKit-https.git] / LayoutTests / http / tests / webAPIStatistics / navigator-functions-accessed-data-collection.html
1 <!DOCTYPE html><!-- webkit-test-runner [ internal:WebAPIStatisticsEnabled=true ] -->
2 <head>
3     <meta charset="UTF-8">
4     <title>Test for navigator functions accessed data collection in resource load statistics</title>
5     <script src="/js-test-resources/js-test.js"></script>
6 </head>
7 <body>
8 <script>
9     description("Tests for navigator functions accessed data collection in ResourceLoadStatistics plist by querying for all the navigator properties and dumping the entire resource load statistics map.");
10     const hostUnderTest = "127.0.0.1:8000";
11     const statisticsUrl = "http://" + hostUnderTest + "/temp";
12
13     function completeTest() {
14         testRunner.dumpResourceLoadStatistics();
15             
16         testRunner.statisticsResetToConsistentState(function() {
17             testRunner.notifyDone();
18         });
19     }
20
21     function runTestRunnerTest() {
22         testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true);
23
24         testRunner.installStatisticsDidScanDataRecordsCallback(completeTest);
25     
26         var useragent = navigator.userAgent;
27         var javaenabled = navigator.javaEnabled();
28         var cookieEnabled = navigator.cookieEnabled;
29         var mimetypes = navigator.mimeTypes;
30         var plugins = navigator.plugins;
31         var appversion = navigator.appVersion;
32     }
33
34     if (document.location.host === hostUnderTest && window.testRunner && window.internals) {
35         testRunner.waitUntilDone();
36         internals.setResourceLoadStatisticsEnabled(true);
37         testRunner.setWebAPIStatisticsEnabled(true);
38         runTestRunnerTest();
39     }
40 </script>
41 </body>
42 </html>