Bug 1581496 - Remove obsolete settings_url properties from CloudFile API; r=mkmelin
authorGeoff Lankow <geoff@darktrojan.net>
Tue, 22 Oct 2019 12:41:49 +1300
changeset 37333 4982de786c5402c20b95015f73e2a467ed0a108c
parent 37332 c1ee2010d423a7311be8e43bb0047d187ed93ec7
child 37334 8b383d1c31cfed3a6b775239c518ae593cd593ad
push id396
push userclokep@gmail.com
push dateMon, 06 Jan 2020 23:11:57 +0000
reviewersmkmelin
bugs1581496
Bug 1581496 - Remove obsolete settings_url properties from CloudFile API; r=mkmelin
mail/components/extensions/parent/ext-cloudFile.js
mail/components/extensions/schemas/cloudFile.json
mail/components/extensions/test/xpcshell/test_ext_cloudFile.js
mail/test/mozmill/shared-modules/CloudfileHelpers.jsm
--- a/mail/components/extensions/parent/ext-cloudFile.js
+++ b/mail/components/extensions/parent/ext-cloudFile.js
@@ -32,17 +32,16 @@ async function promiseFileRead(nsifile) 
 }
 
 class CloudFileAccount {
   constructor(accountKey, extension) {
     this.accountKey = accountKey;
     this.extension = extension;
     this._configured = false;
     this.lastError = "";
-    this.settingsURL = this.extension.manifest.cloud_file.settings_url;
     this.managementURL = this.extension.manifest.cloud_file.management_url;
     this.dataFormat = this.extension.manifest.cloud_file.data_format;
     this.quota = {
       uploadSizeLimit: -1,
       spaceRemaining: -1,
       spaceUsed: -1,
     };
 
@@ -198,17 +197,16 @@ function convertCloudFileAccount(nativeA
   return {
     id: nativeAccount.accountKey,
     name: nativeAccount.displayName,
     configured: nativeAccount.configured,
     uploadSizeLimit: nativeAccount.fileUploadSizeLimit,
     spaceRemaining: nativeAccount.remainingFileSpace,
     spaceUsed: nativeAccount.fileSpaceUsed,
     managementUrl: nativeAccount.managementURL,
-    settingsUrl: nativeAccount.settingsURL,
   };
 }
 
 this.cloudFile = class extends ExtensionAPI {
   get providerType() {
     return `ext-${this.extension.id}`;
   }
 
@@ -368,18 +366,15 @@ this.cloudFile = class extends Extension
             account.quota.spaceRemaining = updateProperties.spaceRemaining;
           }
           if (updateProperties.spaceUsed !== null) {
             account.quota.spaceUsed = updateProperties.spaceUsed;
           }
           if (updateProperties.managementUrl !== null) {
             account.managementURL = updateProperties.managementUrl;
           }
-          if (updateProperties.settingsUrl !== null) {
-            account.settingsURL = updateProperties.settingsUrl;
-          }
 
           return convertCloudFileAccount(account);
         },
       },
     };
   }
 };
--- a/mail/components/extensions/schemas/cloudFile.json
+++ b/mail/components/extensions/schemas/cloudFile.json
@@ -22,24 +22,16 @@
                 "description": "URL to the web page of the cloud file service."
               },
               "new_account_url": {
                 "type": "string",
                 "optional": true,
                 "deprecated": true,
                 "description": "This property was never used."
               },
-              "settings_url": {
-                "type": "string",
-                "format": "relativeUrl",
-                "preprocess": "localize",
-                "optional": true,
-                "deprecated": true,
-                "description": "A page for configuring accounts, this is obsolete after Thunderbird 60."
-              },
               "management_url": {
                 "type": "string",
                 "format": "relativeUrl",
                 "preprocess": "localize",
                 "description": "A page for configuring accounts, to be displayed in the preferences UI."
               },
               "data_format": {
                 "type": "string",
@@ -187,23 +179,16 @@
             "minimum": -1,
             "optional": true,
             "description": "The amount of space already used on the cloud provider, in bytes. Set to -1 if unsupported."
           },
           "managementUrl": {
             "type": "string",
             "format": "relativeUrl",
             "description": "A page for configuring accounts, to be displayed in the preferences UI."
-          },
-          "settingsUrl": {
-            "type": "string",
-            "format": "relativeUrl",
-            "optional": true,
-            "deprecated": true,
-            "description": "A page for configuring accounts, this is obsolete after Thunderbird 60."
           }
         }
       },
       {
         "id": "CloudFile",
         "type": "object",
         "description": "Information about a cloud file",
         "properties": {
@@ -297,23 +282,16 @@
                 "optional": true,
                 "description": "The amount of space already used on the cloud provider, in bytes. Set to -1 if unsupported."
               },
               "managementUrl": {
                 "type": "string",
                 "format": "relativeUrl",
                 "optional": true,
                 "description": "A page for configuring accounts, to be displayed in the preferences UI."
-              },
-              "settingsUrl": {
-                "type": "string",
-                "format": "relativeUrl",
-                "optional": true,
-                "deprecated": true,
-                "description": "A page for configuring accounts, this is obsolete after Thunderbird 60."
               }
             }
           }
         ]
       }
     ]
   }
 ]
--- a/mail/components/extensions/test/xpcshell/test_ext_cloudFile.js
+++ b/mail/components/extensions/test/xpcshell/test_ext_cloudFile.js
@@ -42,32 +42,30 @@ add_task(async () => {
     function assertAccountsMatch(b, a) {
       browser.test.assertEq(a.id, b.id);
       browser.test.assertEq(a.name, b.name);
       browser.test.assertEq(a.configured, b.configured);
       browser.test.assertEq(a.uploadSizeLimit, b.uploadSizeLimit);
       browser.test.assertEq(a.spaceRemaining, b.spaceRemaining);
       browser.test.assertEq(a.spaceUsed, b.spaceUsed);
       browser.test.assertEq(a.managementUrl, b.managementUrl);
-      browser.test.assertEq(a.settingsUrl, b.settingsUrl);
     }
 
     async function test_account_creation_removal() {
       browser.test.log("test_account_creation_removal");
       // Account creation
       let createdAccount = await createCloudfileAccount();
       assertAccountsMatch(createdAccount, {
         id: "account1",
         name: "xpcshell",
         configured: false,
         uploadSizeLimit: -1,
         spaceRemaining: -1,
         spaceUsed: -1,
         managementUrl: browser.runtime.getURL("/content/management.html"),
-        settingsUrl: browser.runtime.getURL("/content/settings.html"),
       });
 
       // Other account creation
       await new Promise((resolve, reject) => {
         function accountListener(account) {
           browser.cloudFile.onAccountAdded.removeListener(accountListener);
           browser.test.fail("Got onAccountAdded for account from other addon");
           reject();
@@ -106,34 +104,32 @@ add_task(async () => {
 
       // update()
       let changes = {
         configured: true,
         // uploadSizeLimit intentionally left unset
         spaceRemaining: 456,
         spaceUsed: 789,
         managementUrl: "/account.html",
-        settingsUrl: "/accountsettings.html",
       };
 
       let changedAccount = await browser.cloudFile.updateAccount(
         retrievedAccount.id,
         changes
       );
       retrievedAccount = await browser.cloudFile.getAccount(createdAccount.id);
 
       let expected = {
         id: createdAccount.id,
         name: "xpcshell",
         configured: true,
         uploadSizeLimit: -1,
         spaceRemaining: 456,
         spaceUsed: 789,
         managementUrl: browser.runtime.getURL("/account.html"),
-        settingsUrl: browser.runtime.getURL("/accountsettings.html"),
       };
 
       assertAccountsMatch(changedAccount, expected);
       assertAccountsMatch(retrievedAccount, expected);
 
       await removeCloudfileAccount(createdAccount.id);
     }
 
@@ -215,17 +211,16 @@ add_task(async () => {
     browser.test.notifyPass("cloudFile");
   }
 
   let extension = ExtensionTestUtils.loadExtension({
     background,
     manifest: {
       cloud_file: {
         name: "xpcshell",
-        settings_url: "/content/settings.html",
         management_url: "/content/management.html",
       },
       applications: { gecko: { id: "cloudfile@xpcshell" } },
     },
   });
 
   let testFiles = {
     cloudFile1: do_get_file("data/cloudFile1.txt"),
@@ -265,31 +260,26 @@ add_task(async () => {
     account.cancelFileUpload(testFiles.cloudFile2);
   });
 
   extension.onMessage("deleteFile", id => {
     let account = cloudFileAccounts.getAccount(id);
     account.deleteFile(uploads.cloudFile1.id);
   });
 
-  // Deprecated property "settings_url". See bug 1581496 for removal.
-  ExtensionTestUtils.failOnSchemaWarnings(false);
-
   Assert.ok(!cloudFileAccounts.getProviderForType("ext-cloudfile@xpcshell"));
   await extension.startup();
   Assert.ok(cloudFileAccounts.getProviderForType("ext-cloudfile@xpcshell"));
   Assert.equal(cloudFileAccounts.accounts.length, 1);
 
   await extension.awaitFinish("cloudFile");
   await extension.unload();
 
   Assert.ok(!cloudFileAccounts.getProviderForType("ext-cloudfile@xpcshell"));
   Assert.equal(cloudFileAccounts.accounts.length, 0);
-
-  ExtensionTestUtils.failOnSchemaWarnings(true);
 });
 
 add_task(async () => {
   async function background() {
     await new Promise(resolve => {
       function fileListener(account, { id, name, data }) {
         browser.cloudFile.onFileUpload.removeListener(fileListener);
         browser.test.assertEq(name, "cloudFile1.txt");
@@ -310,33 +300,27 @@ add_task(async () => {
     browser.test.notifyPass("cloudFile");
   }
 
   let extension = ExtensionTestUtils.loadExtension({
     background,
     manifest: {
       cloud_file: {
         name: "xpcshell",
-        settings_url: "/content/settings.html",
         management_url: "/content/management.html",
         data_format: "File",
       },
       applications: { gecko: { id: "cloudfile@xpcshell" } },
     },
   });
 
-  // Deprecated property "settings_url". See bug 1581496 for removal.
-  ExtensionTestUtils.failOnSchemaWarnings(false);
-
   await extension.startup();
 
   await extension.awaitMessage("uploadFile");
   let id = "ext-cloudfile@xpcshell";
   let account = cloudFileAccounts.createAccount(id);
   await account.uploadFile(do_get_file("data/cloudFile1.txt"));
 
   await extension.awaitFinish("cloudFile");
   cloudFileAccounts.removeAccount(account);
 
   await extension.unload();
-
-  ExtensionTestUtils.failOnSchemaWarnings(true);
 });
--- a/mail/test/mozmill/shared-modules/CloudfileHelpers.jsm
+++ b/mail/test/mozmill/shared-modules/CloudfileHelpers.jsm
@@ -19,17 +19,16 @@ var { cloudFileAccounts } = ChromeUtils.
   "resource:///modules/cloudFileAccounts.jsm"
 );
 var os = ChromeUtils.import("resource://testing-common/mozmill/os.jsm");
 
 var kDefaults = {
   type: "default",
   iconURL: "chrome://messenger/content/extension.svg",
   accountKey: null,
-  settingsURL: "",
   managementURL: "",
   authErr: cloudFileAccounts.constants.authErr,
   offlineErr: cloudFileAccounts.constants.offlineErr,
   uploadErr: cloudFileAccounts.constants.uploadErr,
   uploadWouldExceedQuota: cloudFileAccounts.constants.uploadWouldExceedQuota,
   uploadExceedsFileLimit: cloudFileAccounts.constants.uploadExceedsFileLimit,
   uploadCancelled: cloudFileAccounts.constants.uploadCancelled,
 };