| 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/debugger-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(); frames[0].perfo
rmActionsInFrame()"); | 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.url()); | 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 | 27 |
| 28 await dumpDecorationsInFile("highlight-in-source.css"); | 28 await InspectorTest.dumpDecorations("highlight-in-source.css") |
| 29 await dumpDecorationsInFile("coverage.js"); | 29 await InspectorTest.dumpDecorations("coverage.js") |
| 30 | 30 |
| 31 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 } | |
| 41 } | 32 } |
| 42 | 33 |
| 43 </script> | 34 </script> |
| 44 </head> | 35 </head> |
| 45 | 36 |
| 46 <body onload="runTest()"> | 37 <body onload="runTest()"> |
| 47 <iframe src="resources/subframe.html"></iframe> | 38 <iframe src="resources/subframe.html"></iframe> |
| 48 <p class="class"> | 39 <p class="class"> |
| 49 Tests the coverage list view after finishing recording in the Coverage view. | 40 Tests the coverage list view after finishing recording in the Coverage view. |
| 50 </p> | 41 </p> |
| 51 | 42 |
| 52 </body> | 43 </body> |
| 53 </html> | 44 </html> |
| OLD | NEW |