Skip to content
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

core(metric): remove gatherContext mode check #15899

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions core/computed/metrics/lantern-metric.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ class LanternMetric extends Metric {
* @return {Promise<LH.Artifacts.LanternMetric>}
*/
static async computeMetricWithGraphs(data, context, extras) {
// TODO: remove this fallback when lighthouse-pub-ads plugin can update.
const gatherContext = data.gatherContext || {gatherMode: 'navigation'};
if (gatherContext.gatherMode !== 'navigation') {
if (data.gatherContext.gatherMode !== 'navigation') {
throw new Error(`Lantern metrics can only be computed on navigations`);
}

Expand Down
4 changes: 1 addition & 3 deletions core/computed/metrics/metric.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ class Metric {
* @return {Promise<LH.Artifacts.LanternMetric|LH.Artifacts.Metric>}
*/
static async compute_(data, context) {
// TODO: remove this fallback when lighthouse-pub-ads plugin can update.
const gatherContext = data.gatherContext || {gatherMode: 'navigation'};
const {trace, devtoolsLog, settings} = data;
const {trace, devtoolsLog, settings, gatherContext} = data;
if (!trace || !devtoolsLog || !settings) {
throw new Error('Did not provide necessary metric computation data');
}
Expand Down
Loading