Backed out 2 changesets (bug 1522659, bug 1553624) for browser chrome failures on browser_edit.js. CLOSED TREE
authorCosmin Sabou <csabou@mozilla.com>
Fri, 13 Sep 2019 21:42:11 +0300
changeset 493123 f5dd266a1d0460abf9d2df433ad08e590edbd941
parent 493122 8c3cf0c548977009df6f6c690c7f7335b032626f
child 493124 598d441e4ebaa93ab098d266035a396057c82129
push id95339
push usercsabou@mozilla.com
push dateFri, 13 Sep 2019 18:42:47 +0000
treeherderautoland@f5dd266a1d04 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1522659, 1553624
milestone71.0a1
backs out65435277ebd7ce29eebb9c2dadb22828d35eaa57
5faf20588375a6ed4018f1ced7ca939bf2c07d28
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 2 changesets (bug 1522659, bug 1553624) for browser chrome failures on browser_edit.js. CLOSED TREE Backed out changeset 65435277ebd7 (bug 1522659) Backed out changeset 5faf20588375 (bug 1553624)
browser/components/aboutconfig/content/aboutconfig.js
browser/components/aboutconfig/test/browser/browser_edit.js
--- a/browser/components/aboutconfig/content/aboutconfig.js
+++ b/browser/components/aboutconfig/content/aboutconfig.js
@@ -346,19 +346,17 @@ class PrefRow {
 
   edit() {
     if (gPrefInEdit) {
       gPrefInEdit.endEdit();
     }
     gPrefInEdit = this;
     this.editing = true;
     this.refreshElement();
-    // The type=number input isn't selected unless it's focused first.
     this.inputField.focus();
-    this.inputField.select();
   }
 
   save() {
     if (this.type == "Number") {
       if (!this.inputField.reportValidity()) {
         return;
       }
       Services.prefs.setIntPref(this.name, parseInt(this.inputField.value));
@@ -492,22 +490,16 @@ function loadPrefs() {
       pref.save();
     } else {
       // This is "button-reset" or "button-delete".
       pref.editing = false;
       Services.prefs.clearUserPref(pref.name);
       pref.editButton.focus();
     }
   });
-
-  window.addEventListener("keypress", event => {
-    if (event.target != search && event.key == "Escape" && gPrefInEdit) {
-      gPrefInEdit.endEdit();
-    }
-  });
 }
 
 function filterPrefs(options = {}) {
   if (gPrefInEdit) {
     gPrefInEdit.endEdit();
   }
   gDeletedPrefs.clear();
 
--- a/browser/components/aboutconfig/test/browser/browser_edit.js
+++ b/browser/components/aboutconfig/test/browser/browser_edit.js
@@ -1,22 +1,18 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-const PREF_MODIFY_BOOLEAN = "test.aboutconfig.modify.boolean";
-const PREF_MODIFY_NUMBER = "test.aboutconfig.modify.number";
-const PREF_MODIFY_STRING = "test.aboutconfig.modify.string";
-
 add_task(async function setup() {
   await SpecialPowers.pushPrefEnv({
     set: [
-      [PREF_MODIFY_BOOLEAN, true],
-      [PREF_MODIFY_NUMBER, 1337],
+      ["test.aboutconfig.modify.boolean", true],
+      ["test.aboutconfig.modify.number", 1337],
       [
-        PREF_MODIFY_STRING,
+        "test.aboutconfig.modify.string",
         "the answer to the life the universe and everything",
       ],
     ],
   });
 
   registerCleanupFunction(() => {
     Services.prefs.clearUserPref(PREF_BOOLEAN_DEFAULT_TRUE);
     Services.prefs.clearUserPref(PREF_NUMBER_DEFAULT_ZERO);
@@ -173,17 +169,17 @@ add_task(async function test_reset_user_
     Assert.equal(this.getRow(PREF_STRING_LOCALIZED_MISSING).value, "");
   });
 });
 
 add_task(async function test_modify() {
   await AboutConfigTest.withNewTab(async function() {
     // Test toggle for boolean prefs.
     for (let nameOfBoolPref of [
-      PREF_MODIFY_BOOLEAN,
+      "test.aboutconfig.modify.boolean",
       PREF_BOOLEAN_DEFAULT_TRUE,
     ]) {
       let row = this.getRow(nameOfBoolPref);
       // Do this a two times to reset the pref.
       for (let i = 0; i < 2; i++) {
         row.editColumnButton.click();
         // Check new layout and saving in backend.
         Assert.equal(
@@ -192,24 +188,27 @@ add_task(async function test_modify() {
         );
         let prefHasUserValue = Services.prefs.prefHasUserValue(nameOfBoolPref);
         Assert.equal(row.hasClass("has-user-value"), prefHasUserValue);
         Assert.equal(!!row.resetColumnButton, prefHasUserValue);
       }
     }
 
     // Test abort of edit by starting with string and continuing with editing Int pref.
-    let row = this.getRow(PREF_MODIFY_STRING);
+    let row = this.getRow("test.aboutconfig.modify.string");
     row.editColumnButton.click();
     row.valueInput.value = "test";
-    let intRow = this.getRow(PREF_MODIFY_NUMBER);
+    let intRow = this.getRow("test.aboutconfig.modify.number");
     intRow.editColumnButton.click();
-    Assert.equal(intRow.valueInput.value, Preferences.get(PREF_MODIFY_NUMBER));
+    Assert.equal(
+      intRow.valueInput.value,
+      Preferences.get("test.aboutconfig.modify.number")
+    );
     Assert.ok(!row.valueInput);
-    Assert.equal(row.value, Preferences.get(PREF_MODIFY_STRING));
+    Assert.equal(row.value, Preferences.get("test.aboutconfig.modify.string"));
 
     // Test validation of integer values.
     for (let invalidValue of [
       "",
       " ",
       "a",
       "1.5",
       "-2147483649",
@@ -218,18 +217,18 @@ add_task(async function test_modify() {
       intRow.valueInput.value = invalidValue;
       intRow.editColumnButton.click();
       // We should still be in edit mode.
       Assert.ok(intRow.valueInput);
     }
 
     // Test correct saving and DOM-update.
     for (let [prefName, willDelete] of [
-      [PREF_MODIFY_STRING, true],
-      [PREF_MODIFY_NUMBER, true],
+      ["test.aboutconfig.modify.string", true],
+      ["test.aboutconfig.modify.number", true],
       [PREF_NUMBER_DEFAULT_ZERO, false],
       [PREF_STRING_DEFAULT_EMPTY, false],
     ]) {
       row = this.getRow(prefName);
       // Activate edit and check displaying.
       row.editColumnButton.click();
       Assert.equal(row.valueInput.value, Preferences.get(prefName));
       row.valueInput.value = "42";
@@ -242,62 +241,8 @@ add_task(async function test_modify() {
       row.editColumnButton.click();
       Assert.equal(row.valueInput.value, Preferences.get(prefName));
       row.resetColumnButton.click();
       Assert.ok(!row.hasClass("has-user-value"));
       Assert.equal(row.hasClass("deleted"), willDelete);
     }
   });
 });
-
-add_task(async function test_escape_cancels_edit() {
-  await AboutConfigTest.withNewTab(async function() {
-    let row = this.getRow(PREF_MODIFY_STRING);
-    Preferences.set(PREF_MODIFY_STRING, "Edit me, maybe");
-
-    for (let blurInput of [false, true]) {
-      Assert.ok(!row.valueInput);
-      row.editColumnButton.click();
-
-      Assert.ok(row.valueInput);
-
-      Assert.equal(row.valueInput.value, "Edit me, maybe");
-      row.valueInput.value = "Edited";
-
-      // Test both cases of the input being focused and not being focused.
-      if (blurInput) {
-        row.valueInput.blur();
-        Assert.notEqual(this.document.activeElement, row.valueInput);
-      } else {
-        Assert.equal(this.document.activeElement, row.valueInput);
-      }
-
-      EventUtils.synthesizeKey("KEY_Escape", {}, this.window);
-
-      Assert.ok(!row.valueInput);
-      Assert.equal(row.value, "Edit me, maybe");
-      Assert.equal(row.value, Preferences.get(PREF_MODIFY_STRING));
-    }
-  });
-});
-
-add_task(async function test_edit_field_selected() {
-  let prefsToCheck = [
-    [PREF_MODIFY_STRING, "A string", "A new string"],
-    [PREF_MODIFY_NUMBER, "100", "500"],
-  ];
-  await AboutConfigTest.withNewTab(async function() {
-    for (let [prefName, startValue, endValue] of prefsToCheck) {
-      Preferences.set(prefName, startValue);
-      let row = this.getRow(prefName);
-
-      Assert.equal(row.value, startValue);
-      row.editColumnButton.click();
-      Assert.equal(row.valueInput.value, startValue);
-
-      EventUtils.sendString(endValue, this.window);
-
-      row.editColumnButton.click();
-      Assert.equal(row.value, endValue);
-      Assert.equal(Preferences.get(prefName), endValue);
-    }
-  });
-});