Skip to content

Commit

Permalink
Merge branch 'samccone-sjs/display-fixup'
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Jul 21, 2016
2 parents ffde8e7 + 2981b0f commit 54995e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 3 additions & 4 deletions lighthouse-core/audits/manifest-display.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']
};
}
Expand All @@ -38,7 +37,7 @@ class ManifestDisplay extends Audit {
* @return {boolean}
*/
static hasRecommendedValue(val) {
return (val === 'fullscreen' || val === 'standalone');
return val !== undefined;
}

/**
Expand All @@ -54,7 +53,7 @@ class ManifestDisplay extends Audit {
return ManifestDisplay.generateAuditResult({
rawValue: hasRecommendedValue,
displayValue,
debugString: 'Manifest display property should be standalone or fullscreen.'
debugString: 'Manifest display property should be set.'
});
}
}
Expand Down
5 changes: 3 additions & 2 deletions lighthouse-core/test/audits/display.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit 54995e1

Please sign in to comment.