4a49203231f97389020f8cd548185999a6af081a
[WebKit-https.git] / LayoutTests / http / tests / webAPIStatistics / screen-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 screen 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 screen functions accessed data collection in ResourceLoadStatistics plist by querying for all the screen 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 availTop = screen.availTop;
27         var colorDepth = screen.colorDepth;
28         var pixelDepth = screen.pixelDepth;
29         var height = screen.height;
30         var width = screen.width;
31         var availLeft = screen.availLeft;
32         var availHeight = screen.availHeight;
33         var availWidth = screen.availWidth;
34     }
35
36     if (document.location.host === hostUnderTest && window.testRunner && window.internals) {
37         testRunner.waitUntilDone();
38         internals.setResourceLoadStatisticsEnabled(true);
39         testRunner.setWebAPIStatisticsEnabled(true);
40         runTestRunnerTest();
41     }
42 </script>
43 </body>
44 </html>