Skip to content

Conversation

@pavelfeldman
Copy link
Member

Fixes #955

this._scriptIds.clear();
this._scriptSources.clear();
this._eventListeners = [
helper.addEventListener(this._client, 'Debugger.scriptParsed', this._onScriptParsed.bind(this)),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! I've tested a simple hack with raw coverage and it works nicely, apart from:

5 lines down from this we have:

this._client.send('Profiler.startPreciseCoverage', {callCount: false, detailed: true}),

I can get a really nice coverage report with istanbul if we get callCount info:

this._client.send('Profiler.startPreciseCoverage', {callCount: true, detailed: true}),

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, counting calls now.

@pavelfeldman pavelfeldman force-pushed the coverage branch 2 times, most recently from df2ba5a to 658a16f Compare February 13, 2020 19:57
if (!ranges) {
ranges = [];
styleSheetIdToCoverage.set(entry.styleSheetId, ranges);
const entries = new Map<string, CSSCoverageEntry>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are scary: I'm not sure CSS coverage actually yields disjoint ranges (and IIRC we had some problems here).

Can we keep the old codepath for CSS coverage?

}
],
"text": "\n@charset \"utf-8\";\n@namespace svg url(http://www.w3.org/2000/svg);\n@font-face {\n font-family: \"Example Font\";\n src: url(\"./Dosis-Regular.ttf\");\n}\n\n#fluffy {\n border: 1px solid black;\n z-index: 1;\n /* -webkit-disabled-property: rgb(1, 2, 3) */\n -lol-cats: \"dogs\" /* non-existing property */\n}\n\n@media (min-width: 1px) {\n span {\n -webkit-border-radius: 10px;\n font-family: \"Example Font\";\n animation: 1s identifier;\n }\n}\n"
"source": "\n@charset \"utf-8\";\n@namespace svg url(http://www.w3.org/2000/svg);\n@font-face {\n font-family: \"Example Font\";\n src: url(\"./Dosis-Regular.ttf\");\n}\n\n#fluffy {\n border: 1px solid black;\n z-index: 1;\n /* -webkit-disabled-property: rgb(1, 2, 3) */\n -lol-cats: \"dogs\" /* non-existing property */\n}\n\n@media (min-width: 1px) {\n span {\n -webkit-border-radius: 10px;\n font-family: \"Example Font\";\n animation: 1s identifier;\n }\n}\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we keep "text"?

@aslushnikov aslushnikov merged commit cd4e9da into microsoft:master Feb 14, 2020
@pavelfeldman pavelfeldman deleted the coverage branch April 17, 2020 21:10
debs-obrien pushed a commit to debs-obrien/playwright that referenced this pull request Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Expose Rawer V8 coverage information

3 participants