diff --git a/src/yargs-options.js b/src/yargs-options.js index 2a12d382eeb..403ec40d761 100644 --- a/src/yargs-options.js +++ b/src/yargs-options.js @@ -85,7 +85,7 @@ const options = { 'enable-data-collection-permissions': { describe: 'Enable data collection permissions support', type: 'boolean', - default: false, + default: true, }, }; diff --git a/tests/fixtures/webextension_es6_module/manifest.json b/tests/fixtures/webextension_es6_module/manifest.json index 4daf0c8b1ca..6fceb3892b1 100644 --- a/tests/fixtures/webextension_es6_module/manifest.json +++ b/tests/fixtures/webextension_es6_module/manifest.json @@ -1,7 +1,12 @@ { "browser_specific_settings": { "gecko": { - "id": "@webextension-guid" + "id": "@webextension-guid", + "data_collection_permissions": { + "required": [ + "none" + ] + } } }, "description": "WebExtensions ES module test", diff --git a/tests/fixtures/webextension_with_eslintignore/manifest.json b/tests/fixtures/webextension_with_eslintignore/manifest.json index 019312082a4..a6b12b1ebcc 100644 --- a/tests/fixtures/webextension_with_eslintignore/manifest.json +++ b/tests/fixtures/webextension_with_eslintignore/manifest.json @@ -1,7 +1,12 @@ { "browser_specific_settings": { "gecko": { - "id": "@webextension-guid" + "id": "@webextension-guid", + "data_collection_permissions": { + "required": [ + "none" + ] + } } }, "description": "WebExtensions with .eslintignore file", @@ -9,5 +14,9 @@ "name": "WebExtensions test", "permissions": [], "version": "0.0.1", - "background": { "scripts": ["background.js"] } + "background": { + "scripts": [ + "background.js" + ] + } } diff --git a/tests/integration/addons-linter/integration.run.js b/tests/integration/addons-linter/integration.run.js index 7877201969b..842ee15c219 100644 --- a/tests/integration/addons-linter/integration.run.js +++ b/tests/integration/addons-linter/integration.run.js @@ -43,6 +43,9 @@ describe('Integration/smoke tests', () => { it('should pass if ran on a simple valid CRX extension', async () => { const fixture = resolveFixturePath('crx3.crx'); const { exitCode, stderr, stdout } = await executeScript('addons-linter', [ + // We disable this because the crx3.crx file doesn't include data + // collection permissions. + '--enable-data-collection-permissions=false', '-o', 'json', fixture, diff --git a/tests/test.yargs-options.js b/tests/test.yargs-options.js index e3f656cd450..5db189fca72 100644 --- a/tests/test.yargs-options.js +++ b/tests/test.yargs-options.js @@ -18,7 +18,7 @@ describe('getDefaultConfigValue()', () => { expect(getDefaultConfigValue('max-manifest-version')).toEqual(3); expect(getDefaultConfigValue('disable-xpi-autoclose')).toEqual(false); expect(getDefaultConfigValue('enable-data-collection-permissions')).toEqual( - false + true ); }); diff --git a/tests/unit/scanners/test.javascript.js b/tests/unit/scanners/test.javascript.js index a8ce2183d57..10a49011e98 100644 --- a/tests/unit/scanners/test.javascript.js +++ b/tests/unit/scanners/test.javascript.js @@ -195,6 +195,10 @@ describe('JavaScript Scanner', () => { it('should support es6 modules', async () => { const addonLinter = new Linter({ _: ['tests/fixtures/webextension_es6_module'], + // This is needed because the fixtures file has data collection permissions + // and we don't want the `DATA_COLLECTION_PERMISSIONS_PROP_RESERVED` error + // to be emitted. + enableDataCollectionPermissions: true, }); addonLinter.print = sinon.stub();