-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: recover if protocol does not support CSS rule usage #1479
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
What was the deal with @brendankenny's recoverable error stuff? Would that be a good fit?
#1482 :) |
@@ -25,7 +25,8 @@ class CSSUsage extends Gatherer { | |||
beforePass(options) { | |||
return options.driver.sendCommand('DOM.enable') | |||
.then(_ => options.driver.sendCommand('CSS.enable')) | |||
.then(_ => options.driver.sendCommand('CSS.startRuleUsageTracking')); | |||
.then(_ => options.driver.sendCommand('CSS.startRuleUsageTracking')) | |||
.catch(_ => this.failure = 'CSS Usage tracking requires Chrome \u2265 56'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add a TODO
to remove this once m56 is released as stable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also this marks all errors from beforePass
as this error. To be fair, the previous code was anticipating no errors :) but probably better to check that it's 'CSS.startRuleUsageTracking' wasn't found
or whatever so that other possible errors aren't muted
recoverable errors will work, they're just a manual replacement for -1 right now since the last step of #941 isn't in place yet, so probably fine just to use -1 for now |
one interesting thing that this brings up that we didn't anticipate with a recoverable error is if |
Interesting what's wrong with |
in theory nothing, but we'd really have to nail down when it runs, its relation to the artifact produced, etc. e.g. will it always make sense to clean up after |
R: @wardpeet all
fixes #1473