Skip to content

Commit 433c8ba

Browse files
committed
Merge branch 'master' into khanrafi/webchannelupgrade
2 parents a2a8817 + b07f822 commit 433c8ba

File tree

156 files changed

+2276
-2462
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+2276
-2462
lines changed

.prettierrc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
singleQuote: true,
33
printWidth: 80,
4-
quoteProps: preserve
5-
}
4+
quoteProps: preserve,
5+
trailingComma: none,
6+
arrowParens: avoid
7+
}

config/functions/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"description": "Cloud Functions for Firebase",
44
"dependencies": {
55
"cors": "2.8.5",
6-
"firebase-admin": "8.11.0",
7-
"firebase-functions": "3.6.1"
6+
"firebase-admin": "8.13.0",
7+
"firebase-functions": "3.7.0"
88
},
99
"private": true,
1010
"engines": {

config/karma.saucelabs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ function appiumLauncher(
153153
};
154154
}
155155

156-
module.exports = function(config) {
156+
module.exports = function (config) {
157157
const { packageName, files: testFiles } = getTestFiles();
158158
const sauceLabsBrowsers = getSauceLabsBrowsers(packageName);
159159

integration/browserify/karma.conf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2017 Google Inc.
3+
* Copyright 2017 Google LLC
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@ const karmaBase = require('../../config/karma.base');
2121

2222
const files = [`dist/**/*`];
2323

24-
module.exports = function(config) {
24+
module.exports = function (config) {
2525
const karmaConfig = Object.assign({}, karmaBase, {
2626
// files to load into karma
2727
files: files,

integration/browserify/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
},
1010
"devDependencies": {
1111
"firebase": "7.16.0",
12-
"@babel/core": "7.9.6",
13-
"@babel/preset-env": "7.9.6",
12+
"@babel/core": "7.10.4",
13+
"@babel/preset-env": "7.10.4",
1414
"browserify": "16.5.1",
1515
"chai": "4.2.0",
16-
"karma": "4.4.1",
16+
"karma": "5.1.0",
1717
"karma-babel-preprocessor": "8.0.1",
1818
"karma-chrome-launcher": "3.1.0",
1919
"karma-firefox-launcher": "1.3.0",
20-
"karma-mocha": "1.3.0",
20+
"karma-mocha": "2.0.1",
2121
"karma-sauce-launcher": "1.2.0",
2222
"karma-spec-reporter": "0.0.32",
2323
"mkdirp": "1.0.4",
24-
"mocha": "7.1.2"
24+
"mocha": "7.2.0"
2525
}
2626
}

integration/browserify/src/namespace.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2017 Google Inc.
3+
* Copyright 2017 Google LLC
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -29,6 +29,6 @@ firebase.initializeApp({
2929
appId: 'myAppId'
3030
});
3131

32-
describe('Firebase Namespace Validation', function() {
32+
describe('Firebase Namespace Validation', function () {
3333
validateNamespace(namespaceDefinition, firebase);
3434
});

integration/firebase-typings/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
},
99
"devDependencies": {
1010
"firebase": "7.16.0",
11-
"typescript": "3.9.5"
11+
"typescript": "3.9.6"
1212
}
1313
}

integration/firestore/karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const karmaBase = require('../../config/karma.base');
2121

2222
const files = ['./dist/test-harness.js'];
2323

24-
module.exports = function(config) {
24+
module.exports = function (config) {
2525
const karmaConfig = Object.assign({}, karmaBase, {
2626
// files to load into karma
2727
files: files,

integration/firestore/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616
"devDependencies": {
1717
"@types/mocha": "7.0.2",
1818
"gulp": "4.0.2",
19-
"gulp-filter": "5.1.0",
19+
"gulp-filter": "6.0.0",
2020
"gulp-replace": "1.0.0",
21-
"karma": "4.4.1",
21+
"karma": "5.1.0",
2222
"karma-chrome-launcher": "3.1.0",
2323
"karma-firefox-launcher": "1.3.0",
24-
"karma-mocha": "1.3.0",
24+
"karma-mocha": "2.0.1",
2525
"karma-spec-reporter": "0.0.32",
26-
"mocha": "7.1.2",
26+
"mocha": "7.2.0",
2727
"ts-loader": "6.2.2",
28-
"typescript": "3.9.5",
28+
"typescript": "3.9.6",
2929
"webpack": "4.43.0",
3030
"webpack-stream": "5.2.1"
3131
}

integration/messaging/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
"devDependencies": {
1111
"firebase": "7.16.0",
1212
"chai": "4.2.0",
13-
"chromedriver": "^83.0.0",
13+
"chromedriver": "83.0.1",
1414
"express": "4.17.1",
1515
"geckodriver": "1.19.1",
16-
"mocha": "7.1.2",
16+
"mocha": "7.2.0",
1717
"node-fetch": "2.6.0",
1818
"selenium-assistant": "6.1.0"
1919
}

integration/messaging/test/test-deleteToken.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ const createPermittedWebDriver = require('./utils/createPermittedWebDriver');
2626
const TEST_SUITE_TIMEOUT_MS = 100000;
2727
const TEST_DOMAIN = 'valid-vapid-key';
2828

29-
describe('Firebase Messaging Integration Tests > get and delete token', function() {
29+
describe('Firebase Messaging Integration Tests > get and delete token', function () {
3030
this.timeout(TEST_SUITE_TIMEOUT_MS);
3131
this.retries(3);
3232
let globalWebDriver;
3333

34-
before(async function() {
34+
before(async function () {
3535
await testServer.start();
3636
});
3737

38-
after(async function() {
38+
after(async function () {
3939
await testServer.stop();
4040
});
4141

@@ -46,8 +46,8 @@ describe('Firebase Messaging Integration Tests > get and delete token', function
4646
return;
4747
}
4848

49-
describe(`Testing browser: ${assistantBrowser.getPrettyName()} : ${TEST_DOMAIN}`, function() {
50-
before(async function() {
49+
describe(`Testing browser: ${assistantBrowser.getPrettyName()} : ${TEST_DOMAIN}`, function () {
50+
before(async function () {
5151
// Use one webDriver per browser instead of one per test to speed up test.
5252
globalWebDriver = createPermittedWebDriver(
5353
/* browser= */ assistantBrowser.getId()
@@ -58,15 +58,15 @@ describe('Firebase Messaging Integration Tests > get and delete token', function
5858
);
5959
});
6060

61-
after(async function() {
61+
after(async function () {
6262
await seleniumAssistant.killWebDriver(globalWebDriver);
6363
});
6464

65-
afterEach(async function() {
65+
afterEach(async function () {
6666
await clearAppForTest(globalWebDriver);
6767
});
6868

69-
it(`Test app can delete a valid token`, async function() {
69+
it(`Test app can delete a valid token`, async function () {
7070
const token = await retrieveToken(globalWebDriver);
7171
expect(token).to.exist;
7272
try {

integration/messaging/test/test-send.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ const WAIT_TIME_BEFORE_RETRIEVING_BACKGROUND_MESSAGES_MILLISECONDS = 60000;
4343

4444
const wait = ms => new Promise(res => setTimeout(res, ms));
4545

46-
describe('Starting Integration Test > Sending and Receiving ', function() {
46+
describe('Starting Integration Test > Sending and Receiving ', function () {
4747
this.retries(3);
4848
let globalWebDriver;
4949

50-
before(async function() {
50+
before(async function () {
5151
await testServer.start();
5252
});
5353

54-
after(async function() {
54+
after(async function () {
5555
await testServer.stop();
5656
});
5757

@@ -61,14 +61,14 @@ describe('Starting Integration Test > Sending and Receiving ', function() {
6161
return;
6262
}
6363

64-
describe(`Testing browser: ${assistantBrowser.getPrettyName()} : ${TEST_DOMAIN}`, function() {
65-
before(async function() {
64+
describe(`Testing browser: ${assistantBrowser.getPrettyName()} : ${TEST_DOMAIN}`, function () {
65+
before(async function () {
6666
globalWebDriver = createPermittedWebDriver(
6767
/* browser= */ assistantBrowser.getId()
6868
);
6969
});
7070

71-
it('Background app can receive a {} empty message from sw', async function() {
71+
it('Background app can receive a {} empty message from sw', async function () {
7272
this.timeout(TIMEOUT_BACKGROUND_MESSAGE_TEST_UNIT_MILLISECONDS);
7373

7474
// Clearing the cache and db data by killing the previously instantiated driver. Note that ideally this call is placed inside the after/before hooks. However, Mocha forbids operations longer than 2s in hooks. Hence, this clearing call needs to be inside the test unit.
@@ -97,7 +97,7 @@ describe('Starting Integration Test > Sending and Receiving ', function() {
9797
);
9898
});
9999

100-
it('Background app can receive a {"data"} message frow sw', async function() {
100+
it('Background app can receive a {"data"} message frow sw', async function () {
101101
this.timeout(TIMEOUT_BACKGROUND_MESSAGE_TEST_UNIT_MILLISECONDS);
102102

103103
await seleniumAssistant.killWebDriver(globalWebDriver);
@@ -126,7 +126,7 @@ describe('Starting Integration Test > Sending and Receiving ', function() {
126126
);
127127
});
128128

129-
it('Foreground app can receive a {} empty message in onMessage', async function() {
129+
it('Foreground app can receive a {} empty message in onMessage', async function () {
130130
this.timeout(TIMEOUT_FOREGROUND_MESSAGE_TEST_UNIT_MILLISECONDS);
131131

132132
await seleniumAssistant.killWebDriver(globalWebDriver);
@@ -153,7 +153,7 @@ describe('Starting Integration Test > Sending and Receiving ', function() {
153153
);
154154
});
155155

156-
it('Foreground app can receive a {"notification"} message in onMessage', async function() {
156+
it('Foreground app can receive a {"notification"} message in onMessage', async function () {
157157
this.timeout(TIMEOUT_FOREGROUND_MESSAGE_TEST_UNIT_MILLISECONDS);
158158

159159
await seleniumAssistant.killWebDriver(globalWebDriver);
@@ -180,7 +180,7 @@ describe('Starting Integration Test > Sending and Receiving ', function() {
180180
);
181181
});
182182

183-
it('Foreground app can receive a {"data"} message in onMessage', async function() {
183+
it('Foreground app can receive a {"data"} message in onMessage', async function () {
184184
this.timeout(TIMEOUT_FOREGROUND_MESSAGE_TEST_UNIT_MILLISECONDS);
185185

186186
await seleniumAssistant.killWebDriver(globalWebDriver);
@@ -207,7 +207,7 @@ describe('Starting Integration Test > Sending and Receiving ', function() {
207207
);
208208
});
209209

210-
it('Foreground app can receive a {"notification", "data"} message in onMessage', async function() {
210+
it('Foreground app can receive a {"notification", "data"} message in onMessage', async function () {
211211
this.timeout(TIMEOUT_FOREGROUND_MESSAGE_TEST_UNIT_MILLISECONDS);
212212

213213
await seleniumAssistant.killWebDriver(globalWebDriver);

integration/messaging/test/test-updateToken.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ const getErrors = require('./utils/getErrors');
2828
const TEST_SUITE_TIMEOUT_MS = 70000;
2929
const TEST_DOMAIN = 'valid-vapid-key';
3030

31-
describe('Firebase Messaging Integration Tests > update a token', function() {
31+
describe('Firebase Messaging Integration Tests > update a token', function () {
3232
this.timeout(TEST_SUITE_TIMEOUT_MS);
3333
this.retries(3);
3434

3535
let globalWebDriver;
3636

37-
before(async function() {
37+
before(async function () {
3838
await testServer.start();
3939
});
4040

41-
after(async function() {
41+
after(async function () {
4242
await testServer.stop();
4343
});
4444

@@ -49,8 +49,8 @@ describe('Firebase Messaging Integration Tests > update a token', function() {
4949
return;
5050
}
5151

52-
describe(`Testing browser: ${assistantBrowser.getPrettyName()} : ${TEST_DOMAIN}`, function() {
53-
before(async function() {
52+
describe(`Testing browser: ${assistantBrowser.getPrettyName()} : ${TEST_DOMAIN}`, function () {
53+
before(async function () {
5454
// Use one webDriver per browser instead of one per test to speed up test.
5555
globalWebDriver = createPermittedWebDriver(
5656
/* browser= */ assistantBrowser.getId()
@@ -60,15 +60,15 @@ describe('Firebase Messaging Integration Tests > update a token', function() {
6060
);
6161
});
6262

63-
after(async function() {
63+
after(async function () {
6464
await seleniumAssistant.killWebDriver(globalWebDriver);
6565
});
6666

67-
afterEach(async function() {
67+
afterEach(async function () {
6868
await clearAppForTest(globalWebDriver);
6969
});
7070

71-
it(`should update a token`, async function() {
71+
it(`should update a token`, async function () {
7272
const token = await retrieveToken(globalWebDriver);
7373
expect(token).to.exist;
7474

integration/messaging/test/test-useDefaultServiceWorker.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,31 +24,31 @@ const createPermittedWebDriver = require('./utils/createPermittedWebDriver');
2424
const TEST_DOMAIN = 'default-sw';
2525
const TEST_SUITE_TIMEOUT_MS = 70000;
2626

27-
describe(`Firebase Messaging Integration Tests > Use 'firebase-messaging-sw.js' by default`, function() {
27+
describe(`Firebase Messaging Integration Tests > Use 'firebase-messaging-sw.js' by default`, function () {
2828
this.timeout(TEST_SUITE_TIMEOUT_MS);
2929

3030
this.retries(3);
3131

3232
let globalWebDriver;
3333

34-
before(async function() {
34+
before(async function () {
3535
await testServer.start();
3636
});
3737

38-
after(async function() {
38+
after(async function () {
3939
await testServer.stop();
4040
await seleniumAssistant.killWebDriver(globalWebDriver);
4141
});
4242

43-
it(`should use default SW by default`, async function() {
43+
it(`should use default SW by default`, async function () {
4444
globalWebDriver = createPermittedWebDriver('chrome');
4545
await globalWebDriver.get(`${testServer.serverAddress}/${TEST_DOMAIN}/`);
4646

4747
// If we have a token, then we know the default SW worked.
4848
const token = await retrieveToken(globalWebDriver);
4949
expect(token).to.exist;
5050

51-
const result = await globalWebDriver.executeAsyncScript(function(cb) {
51+
const result = await globalWebDriver.executeAsyncScript(function (cb) {
5252
navigator.serviceWorker
5353
.getRegistrations()
5454
.then(swReg => {

integration/messaging/test/test-useValidManifest.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ const createPermittedWebDriver = require('./utils/createPermittedWebDriver');
2424
const TEST_DOMAIN = 'valid-manifest';
2525
const TEST_SUITE_TIMEOUT_MS = 70000;
2626

27-
describe(`Firebase Messaging Integration Tests > Use 'use valid manifest`, function() {
27+
describe(`Firebase Messaging Integration Tests > Use 'use valid manifest`, function () {
2828
this.timeout(TEST_SUITE_TIMEOUT_MS);
2929

3030
this.retries(3);
3131

3232
let globalWebDriver;
3333

34-
before(async function() {
34+
before(async function () {
3535
await testServer.start();
3636
});
3737

38-
after(async function() {
38+
after(async function () {
3939
await testServer.stop();
4040
await seleniumAssistant.killWebDriver(globalWebDriver);
4141
});
4242

43-
it(`should allow valid manifest`, async function() {
43+
it(`should allow valid manifest`, async function () {
4444
globalWebDriver = createPermittedWebDriver('chrome');
4545
await globalWebDriver.get(`${testServer.serverAddress}/${TEST_DOMAIN}/`);
4646

0 commit comments

Comments
 (0)