Source/WebCore:
[WebKit-https.git] / LayoutTests / http / tests / resourceLoadStatistics / enable-debug-mode-database.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 src="resources/util.js"></script>
7 </head>
8 <body>
9 <script>
10     description("Test for enabling debug mode and that it permanently treats 3rdpartytestwebkit.org as a prevalent resource.");
11     jsTestIsAsync = true;
12
13     const thirdPartyOrigin = "http://3rdpartytestwebkit.org";
14
15     if (window.testRunner && window.internals) {
16         testRunner.setUseITPDatabase(true);
17         setEnableFeature(true, function() {
18             if (testRunner.isStatisticsPrevalentResource(thirdPartyOrigin))
19                 testFailed(thirdPartyOrigin + " already set as prevalent resource.");
20
21             testRunner.setStatisticsDebugMode(true, function() {
22                 if (!testRunner.isStatisticsPrevalentResource(thirdPartyOrigin))
23                     testFailed(thirdPartyOrigin + " didn't get set as prevalent resource.");
24                 else
25                     testPassed(thirdPartyOrigin + " got set as prevalent resource in debug mode.");
26                 testRunner.setStatisticsDebugMode(false, function() {
27                     setEnableFeature(false, finishJSTest);
28                 });
29             });
30         });
31     }
32 </script>
33 </body>
34 </html>