OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
4 <script src="../../http/tests/inspector/elements-test.js"></script> | 4 <script src="../../http/tests/inspector/debugger-test.js"></script> |
5 <script src="coverage-test.js"></script> | 5 <script src="coverage-test.js"></script> |
6 <script src="resources/coverage.js"></script> | 6 <script src="resources/coverage.js"></script> |
7 | 7 |
8 <link rel="stylesheet" type="text/css" href="resources/highlight-in-source.css"> | 8 <link rel="stylesheet" type="text/css" href="resources/highlight-in-source.css"> |
9 | 9 |
10 <script> | 10 <script> |
11 async function test() | 11 async function test() |
12 { | 12 { |
13 InspectorTest.startCoverage(); | 13 InspectorTest.startCoverage(); |
14 await InspectorTest.evaluateInPagePromise("performActions()"); | 14 await InspectorTest.evaluateInPagePromise("performActions(); frames[0].perfo
rmActionsInFrame()"); |
15 await InspectorTest.stopCoverage(); | 15 await InspectorTest.stopCoverage(); |
16 | 16 |
17 var coverageView = self.runtime.sharedInstance(Coverage.CoverageView); | 17 var coverageView = self.runtime.sharedInstance(Coverage.CoverageView); |
18 var dataGrid = coverageView._listView._dataGrid; | 18 var dataGrid = coverageView._listView._dataGrid; |
19 for (var child of dataGrid.rootNode().children) { | 19 for (var child of dataGrid.rootNode().children) { |
20 var data = child._coverageInfo; | 20 var data = child._coverageInfo; |
21 var url = InspectorTest.formatters.formatAsURL(data.contentProvider.cont
entURL()); | 21 var url = InspectorTest.formatters.formatAsURL(data.url()); |
22 if (url.endsWith("-test.js") || url.endsWith(".html")) | 22 if (url.endsWith("-test.js") || url.endsWith(".html")) |
23 continue; | 23 continue; |
24 var type = Coverage.CoverageListView._typeToString(data.type); | 24 var type = Coverage.CoverageListView._typeToString(data.type()); |
25 InspectorTest.addResult(`${url} ${type} used: ${data.usedSize} unused: $
{data.unusedSize} total: ${data.size}`); | 25 InspectorTest.addResult(`${url} ${type} used: ${data.usedSize()} unused:
${data.unusedSize()} total: ${data.size()}`); |
26 } | 26 } |
| 27 |
| 28 await dumpDecorationsInFile("highlight-in-source.css"); |
| 29 await dumpDecorationsInFile("coverage.js"); |
| 30 |
27 InspectorTest.completeTest(); | 31 InspectorTest.completeTest(); |
| 32 |
| 33 async function dumpDecorationsInFile(file) |
| 34 { |
| 35 await InspectorTest.sourceDecorated(file); |
| 36 var lines = Array.prototype.map.call(document.querySelectorAll(".text-ed
itor-coverage-unused-marker"), |
| 37 e => e.parentElement.previousSiblin
g.textContent); |
| 38 InspectorTest.addResult(`Unused lines in ${file}`); |
| 39 InspectorTest.addResult(lines); |
| 40 } |
28 } | 41 } |
29 | 42 |
30 </script> | 43 </script> |
31 </head> | 44 </head> |
32 | 45 |
33 <body onload="runTest()"> | 46 <body onload="runTest()"> |
| 47 <iframe src="resources/subframe.html"></iframe> |
34 <p class="class"> | 48 <p class="class"> |
35 Tests the coverage list view after finishing recording in the Coverage view. | 49 Tests the coverage list view after finishing recording in the Coverage view. |
36 </p> | 50 </p> |
37 | 51 |
38 </body> | 52 </body> |
39 </html> | 53 </html> |
OLD | NEW |