Skip to content

Commit

Permalink
Lowercase fix for "service worker" (#2729)
Browse files Browse the repository at this point in the history
  • Loading branch information
karolklp authored and paulirish committed Jul 24, 2017
1 parent 1ca40de commit 15068bd
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lighthouse-core/audits/cache-start-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class CacheStartUrl extends Audit {

// Now find the start_url in the cacheContents. This test is less than ideal since the Service
// Worker can rewrite a request from the start URL to anything else in the cache, and so a TODO
// here would be to resolve this more completely by asking the Service Worker about the start
// here would be to resolve this more completely by asking the service worker about the start
// URL. However that would also necessitate the cache contents gatherer relying on the manifest
// gather rather than being independent of it.
const cacheContents = artifacts.CacheContents;
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/audits/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class ServiceWorker extends Audit {
return {
category: 'Offline',
name: 'service-worker',
description: 'Registers a Service Worker',
failureDescription: 'Does not register a Service Worker',
description: 'Registers a service worker',
failureDescription: 'Does not register a service worker',
helpText: 'The service worker is the technology that enables your app to use many ' +
'Progressive Web App features, such as offline, add to homescreen, and push ' +
'notifications. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/registered-service-worker).',
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/audits/webapp-install-banner.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ class WebappInstallBanner extends MultiCheckAudit {
static assessServiceWorker(artifacts, result) {
const hasServiceWorker = SWAudit.audit(artifacts).rawValue;
if (!hasServiceWorker) {
result.failures.push('Site does not register a Service Worker');
result.failures.push('Site does not register a service worker');
}
}

static assessOfflineStartUrl(artifacts, result) {
const hasOfflineStartUrl = artifacts.StartUrl.statusCode === 200;

if (!hasOfflineStartUrl) {
result.failures.push('Manifest start_url is not cached by a Service Worker');
result.failures.push('Manifest start_url is not cached by a service worker');
}

if (artifacts.StartUrl.debugString) {
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/test/audits/service-worker-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const assert = require('assert');

/* eslint-env mocha */

describe('Offline: Service Worker audit', () => {
it('passes when given a matching Service Worker version', () => {
describe('Offline: service worker audit', () => {
it('passes when given a matching service worker version', () => {
const output = Audit.audit({
ServiceWorker: {
versions: [{
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/test/audits/webapp-install-banner-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ describe('PWA: webapp install banner audit', () => {

return WebappInstallBannerAudit.audit(artifacts).then(result => {
assert.strictEqual(result.rawValue, false);
assert.ok(result.debugString.includes('Service Worker'), result.debugString);
assert.ok(result.debugString.includes('service worker'), result.debugString);
const failures = result.extendedInfo.value.failures;
// start url will be -1 as well so failures will be 2
assert.strictEqual(failures.length, 2, failures);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const ServiceWorkerGather = require('../../../gather/gatherers/service-worker');
const assert = require('assert');
let serviceWorkerGatherer;

describe('Service Worker gatherer', () => {
describe('service worker gatherer', () => {
// Reset the Gatherer before each test.
beforeEach(() => {
serviceWorkerGatherer = new ServiceWorkerGather();
Expand Down

0 comments on commit 15068bd

Please sign in to comment.