From 0ac67830c865457725da26b9625c71cf37ac1d19 Mon Sep 17 00:00:00 2001 From: Sam Saccone Date: Wed, 6 Jul 2016 15:48:20 -0700 Subject: [PATCH] Require that a user has *any* display value set. Fixes #495 --- lighthouse-core/audits/manifest-display.js | 7 +++---- lighthouse-core/test/audits/display.js | 5 +++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lighthouse-core/audits/manifest-display.js b/lighthouse-core/audits/manifest-display.js index 1eed26fd1cf3..de23d623993e 100644 --- a/lighthouse-core/audits/manifest-display.js +++ b/lighthouse-core/audits/manifest-display.js @@ -27,8 +27,7 @@ class ManifestDisplay extends Audit { return { category: 'Manifest', name: 'manifest-display', - description: 'Manifest\'s display property set to standalone/fullscreen to ' + - 'allow launching without address bar', + description: 'Manifest\'s display property is set', requiredArtifacts: ['Manifest'] }; } @@ -38,7 +37,7 @@ class ManifestDisplay extends Audit { * @return {boolean} */ static hasRecommendedValue(val) { - return (val === 'fullscreen' || val === 'standalone'); + return val !== undefined; } /** @@ -54,7 +53,7 @@ class ManifestDisplay extends Audit { return ManifestDisplay.generateAuditResult({ value: hasRecommendedValue, rawValue: displayValue, - debugString: 'Manifest display property should be standalone or fullscreen.' + debugString: 'Manifest display property should be set.' }); } } diff --git a/lighthouse-core/test/audits/display.js b/lighthouse-core/test/audits/display.js index 68420b2edace..f42b3c12f63f 100644 --- a/lighthouse-core/test/audits/display.js +++ b/lighthouse-core/test/audits/display.js @@ -19,10 +19,11 @@ const assert = require('assert'); /* global describe, it*/ describe('Mobile-friendly: display audit', () => { - it('only accepts fullscreen or standalone as recommended values', () => { + it('only accepts when a value is set for the display prop', () => { assert.equal(Audit.hasRecommendedValue('fullscreen'), true); assert.equal(Audit.hasRecommendedValue('standalone'), true); - assert.equal(Audit.hasRecommendedValue('browser'), false); + assert.equal(Audit.hasRecommendedValue('browser'), true); + assert.equal(Audit.hasRecommendedValue(undefined), false); }); it('handles the case where there is no display property', () => {