Skip to content

Commit

Permalink
core: rename audit-details diagnostics to debugData (#8298)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickhulce authored and brendankenny committed Apr 17, 2019
1 parent 81a8a5c commit 7154ebd
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 62 deletions.
10 changes: 5 additions & 5 deletions lighthouse-core/audits/accessibility/axe-audit.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ class AxeAudit extends Audit {
{key: 'node', itemType: 'node', text: str_(UIStrings.failingElementsHeader)},
];

/** @type {LH.Audit.Details.Diagnostic|undefined} */
let diagnostic;
/** @type {LH.Audit.Details.DebugData|undefined} */
let debugData;
if (impact || tags) {
diagnostic = {
type: 'diagnostic',
debugData = {
type: 'debugdata',
impact,
tags,
};
Expand All @@ -78,7 +78,7 @@ class AxeAudit extends Audit {
extendedInfo: {
value: rule,
},
details: {...Audit.makeTableDetails(headings, items), diagnostic},
details: {...Audit.makeTableDetails(headings, items), debugData},
};
}
}
Expand Down
10 changes: 5 additions & 5 deletions lighthouse-core/audits/byte-efficiency/uses-long-cache-ttl.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,18 +238,18 @@ class CacheHeaders extends Audit {
if (url.includes('?')) queryStringCount++;

// Include cacheControl info (if it exists) per url as a diagnostic.
/** @type {LH.Audit.Details.Diagnostic|undefined} */
let diagnostic;
/** @type {LH.Audit.Details.DebugData|undefined} */
let debugData;
if (cacheControl) {
diagnostic = {
type: 'diagnostic',
debugData = {
type: 'debugdata',
...cacheControl,
};
}

results.push({
url,
diagnostic,
debugData,
cacheLifetimeMs: cacheLifetimeInSeconds * 1000,
cacheHitProbability,
totalBytes,
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/diagnostics.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class Diagnostics extends Audit {
score: 1,
rawValue: 1,
details: {
type: 'diagnostic',
type: 'debugdata',
// TODO: Consider not nesting diagnostics under `items`.
items: [diagnostics],
},
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/audits/metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ class Metrics extends Audit {
}
}

/** @type {LH.Audit.Details.Diagnostic} */
/** @type {LH.Audit.Details.DebugData} */
const details = {
type: 'diagnostic',
type: 'debugdata',
// TODO: Consider not nesting metrics under `items`.
items: [metrics],
};
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/audits/multi-check-audit.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ class MultiCheckAudit extends Audit {
}

// Include the detailed pass/fail checklist as a diagnostic.
/** @type {LH.Audit.Details.Diagnostic} */
/** @type {LH.Audit.Details.DebugData} */
const details = {
type: 'diagnostic',
type: 'debugdata',
// TODO: Consider not nesting detailsItem under `items`.
items: [detailsItem],
};
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/predictive-perf.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class PredictivePerf extends Audit {
rawValue: values.roughEstimateOfTTI,
displayValue: Util.formatMilliseconds(values.roughEstimateOfTTI),
details: {
type: 'diagnostic',
type: 'debugdata',
// TODO: Consider not nesting values under `items`.
items: [values],
},
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/report/html/renderer/details-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class DetailsRenderer {

// Internal-only details, not for rendering.
case 'screenshot':
case 'diagnostic':
case 'debugdata':
return null;
// Fallback for old LHRs, where no type meant don't render.
case undefined:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ describe('DetailsRenderer', () => {

it('does not render internal-only diagnostic details', () => {
const details = {
type: 'diagnostic',
type: 'debugdata',
items: [{
failures: ['No manifest was fetched'],
isParseFailure: true,
Expand Down
34 changes: 17 additions & 17 deletions lighthouse-core/test/results/sample_v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@
"rawValue": false,
"explanation": "Failures: No manifest was fetched.",
"details": {
"type": "diagnostic",
"type": "debugdata",
"items": [
{
"failures": [
Expand All @@ -495,7 +495,7 @@
"rawValue": false,
"explanation": "Failures: No manifest was fetched.",
"details": {
"type": "diagnostic",
"type": "debugdata",
"items": [
{
"failures": [
Expand All @@ -516,7 +516,7 @@
"rawValue": false,
"explanation": "Failures: No manifest was fetched,\nNo `<meta name=\"theme-color\">` tag found.",
"details": {
"type": "diagnostic",
"type": "debugdata",
"items": [
{
"failures": [
Expand Down Expand Up @@ -809,7 +809,7 @@
"scoreDisplayMode": "informative",
"rawValue": 1,
"details": {
"type": "diagnostic",
"type": "debugdata",
"items": [
{
"numRequests": 18,
Expand Down Expand Up @@ -1243,7 +1243,7 @@
"scoreDisplayMode": "informative",
"rawValue": 4927.278,
"details": {
"type": "diagnostic",
"type": "debugdata",
"items": [
{
"firstContentfulPaint": 3969,
Expand Down Expand Up @@ -1449,8 +1449,8 @@
}
}
],
"diagnostic": {
"type": "diagnostic",
"debugData": {
"type": "debugdata",
"impact": "serious",
"tags": [
"cat.color",
Expand Down Expand Up @@ -1537,8 +1537,8 @@
}
}
],
"diagnostic": {
"type": "diagnostic",
"debugData": {
"type": "debugdata",
"impact": "serious",
"tags": [
"cat.language",
Expand Down Expand Up @@ -1610,8 +1610,8 @@
}
}
],
"diagnostic": {
"type": "diagnostic",
"debugData": {
"type": "debugdata",
"impact": "critical",
"tags": [
"cat.text-alternatives",
Expand Down Expand Up @@ -1676,8 +1676,8 @@
}
}
],
"diagnostic": {
"type": "diagnostic",
"debugData": {
"type": "debugdata",
"impact": "critical",
"tags": [
"cat.forms",
Expand Down Expand Up @@ -1734,8 +1734,8 @@
}
}
],
"diagnostic": {
"type": "diagnostic",
"debugData": {
"type": "debugdata",
"impact": "serious",
"tags": [
"cat.name-role-value",
Expand Down Expand Up @@ -1821,8 +1821,8 @@
}
}
],
"diagnostic": {
"type": "diagnostic",
"debugData": {
"type": "debugdata",
"impact": "serious",
"tags": [
"cat.text-alternatives",
Expand Down
34 changes: 17 additions & 17 deletions proto/sample_v2_round_trip.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,14 @@
"color-contrast": {
"description": "Low-contrast text is difficult or impossible for many users to read. [Learn more](https://dequeuniversity.com/rules/axe/3.1/color-contrast?application=lighthouse).",
"details": {
"diagnostic": {
"debugData": {
"impact": "serious",
"tags": [
"cat.color",
"wcag2aa",
"wcag143"
],
"type": "diagnostic"
"type": "debugdata"
},
"headings": [
{
Expand Down Expand Up @@ -457,7 +457,7 @@
"totalTaskTime": 1548.5690000000002
}
],
"type": "diagnostic"
"type": "debugdata"
},
"id": "diagnostics",
"score": null,
Expand Down Expand Up @@ -834,14 +834,14 @@
"html-has-lang": {
"description": "If a page doesn't specify a lang attribute, a screen reader assumes that the page is in the default language that the user chose when setting up the screen reader. If the page isn't actually in the default language, then the screen reader might not announce the page's text correctly. [Learn more](https://dequeuniversity.com/rules/axe/3.1/html-has-lang?application=lighthouse).",
"details": {
"diagnostic": {
"debugData": {
"impact": "serious",
"tags": [
"cat.language",
"wcag2a",
"wcag311"
],
"type": "diagnostic"
"type": "debugdata"
},
"headings": [
{
Expand Down Expand Up @@ -885,7 +885,7 @@
"image-alt": {
"description": "Informative elements should aim for short, descriptive alternate text. Decorative elements can be ignored with an empty alt attribute. [Learn more](https://dequeuniversity.com/rules/axe/3.1/image-alt?application=lighthouse).",
"details": {
"diagnostic": {
"debugData": {
"impact": "critical",
"tags": [
"cat.text-alternatives",
Expand All @@ -894,7 +894,7 @@
"section508",
"section508.22.a"
],
"type": "diagnostic"
"type": "debugdata"
},
"headings": [
{
Expand Down Expand Up @@ -1007,7 +1007,7 @@
"parseFailureReason": "No manifest was fetched"
}
],
"type": "diagnostic"
"type": "debugdata"
},
"explanation": "Failures: No manifest was fetched.",
"id": "installable-manifest",
Expand Down Expand Up @@ -1098,7 +1098,7 @@
"label": {
"description": "Labels ensure that form controls are announced properly by assistive technologies, like screen readers. [Learn more](https://dequeuniversity.com/rules/axe/3.1/label?application=lighthouse).",
"details": {
"diagnostic": {
"debugData": {
"impact": "critical",
"tags": [
"cat.forms",
Expand All @@ -1108,7 +1108,7 @@
"section508",
"section508.22.n"
],
"type": "diagnostic"
"type": "debugdata"
},
"headings": [
{
Expand Down Expand Up @@ -1163,7 +1163,7 @@
"link-name": {
"description": "Link text (and alternate text for images, when used as links) that is discernible, unique, and focusable improves the navigation experience for screen reader users. [Learn more](https://dequeuniversity.com/rules/axe/3.1/link-name?application=lighthouse).",
"details": {
"diagnostic": {
"debugData": {
"impact": "serious",
"tags": [
"cat.name-role-value",
Expand All @@ -1173,7 +1173,7 @@
"section508",
"section508.22.a"
],
"type": "diagnostic"
"type": "debugdata"
},
"headings": [
{
Expand Down Expand Up @@ -1480,7 +1480,7 @@
"speedIndexTs": 185607736912.0
}
],
"type": "diagnostic"
"type": "debugdata"
},
"id": "metrics",
"score": null,
Expand Down Expand Up @@ -1902,7 +1902,7 @@
"object-alt": {
"description": "Screen readers cannot translate non-text content. Adding alt text to `<object>` elements helps screen readers convey meaning to users. [Learn more](https://dequeuniversity.com/rules/axe/3.1/object-alt?application=lighthouse).",
"details": {
"diagnostic": {
"debugData": {
"impact": "serious",
"tags": [
"cat.text-alternatives",
Expand All @@ -1911,7 +1911,7 @@
"section508",
"section508.22.a"
],
"type": "diagnostic"
"type": "debugdata"
},
"headings": [
{
Expand Down Expand Up @@ -2215,7 +2215,7 @@
"parseFailureReason": "No manifest was fetched"
}
],
"type": "diagnostic"
"type": "debugdata"
},
"explanation": "Failures: No manifest was fetched.",
"id": "splash-screen",
Expand Down Expand Up @@ -2278,7 +2278,7 @@
"themeColor": null
}
],
"type": "diagnostic"
"type": "debugdata"
},
"explanation": "Failures: No manifest was fetched,\nNo `<meta name=\"theme-color\">` tag found.",
"id": "themed-omnibox",
Expand Down
Loading

0 comments on commit 7154ebd

Please sign in to comment.