Backed out changeset ff8aa19ba327 (bug 1261785) for frequent failure in devtools test devtools/client/shared/test/browser_telemetry_toolboxtabs_storage.js. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Sun, 17 Apr 2016 12:27:43 +0200
changeset 331354 f8c0dd78206cac5a132b164ebacfa8ffbac9713c
parent 331353 ba3c8cb72bdae91bd4a81bcb69ce71b4772b3395
child 331355 4d5b0cdb72fe52f843c61a5df8f6b8ed35758be8
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1261785
milestone48.0a1
backs outff8aa19ba327597352157dbe53c7af971d38052a
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 changeset ff8aa19ba327 (bug 1261785) for frequent failure in devtools test devtools/client/shared/test/browser_telemetry_toolboxtabs_storage.js. r=backout
devtools/client/storage/test/browser.ini
devtools/client/storage/test/browser_storage_cookies_edit.js
devtools/client/storage/test/browser_storage_cookies_edit_keyboard.js
devtools/client/storage/test/browser_storage_cookies_tab_navigation.js
devtools/client/storage/test/browser_storage_localstorage_edit.js
devtools/client/storage/test/browser_storage_sessionstorage_edit.js
devtools/client/storage/test/head.js
devtools/client/storage/ui.js
--- a/devtools/client/storage/test/browser.ini
+++ b/devtools/client/storage/test/browser.ini
@@ -25,11 +25,12 @@ support-files =
 [browser_storage_delete.js]
 [browser_storage_delete_all.js]
 [browser_storage_delete_tree.js]
 [browser_storage_dynamic_updates.js]
 [browser_storage_empty_objectstores.js]
 [browser_storage_localstorage_edit.js]
 [browser_storage_overflow.js]
 [browser_storage_search.js]
+skip-if = os == "linux" && e10s # Bug 1240804 - unhandled promise rejections
 [browser_storage_sessionstorage_edit.js]
 [browser_storage_sidebar.js]
 [browser_storage_values.js]
--- a/devtools/client/storage/test/browser_storage_cookies_edit.js
+++ b/devtools/client/storage/test/browser_storage_cookies_edit.js
@@ -3,16 +3,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // Basic test to check the editing of cookies.
 
 "use strict";
 
 add_task(function* () {
   yield openTabAndSetupStorage(MAIN_DOMAIN + "storage-cookies.html");
+  yield gUI.table.once(TableWidget.EVENTS.FIELDS_EDITABLE);
+
   showAllColumns(true);
 
   yield editCell("test3", "name", "newTest3");
   yield editCell("newTest3", "path", "/");
   yield editCell("newTest3", "host", "test1.example.org");
   yield editCell("newTest3", "expires", "Tue, 14 Feb 2040 17:41:14 GMT");
   yield editCell("newTest3", "value", "newValue3");
   yield editCell("newTest3", "isSecure", "true");
--- a/devtools/client/storage/test/browser_storage_cookies_edit_keyboard.js
+++ b/devtools/client/storage/test/browser_storage_cookies_edit_keyboard.js
@@ -3,16 +3,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // Basic test to check the editing of cookies with the keyboard.
 
 "use strict";
 
 add_task(function* () {
   yield openTabAndSetupStorage(MAIN_DOMAIN + "storage-cookies.html");
+  yield gUI.table.once(TableWidget.EVENTS.FIELDS_EDITABLE);
+
   showAllColumns(true);
 
   yield startCellEdit("test4", "name");
   yield typeWithTerminator("test6", "VK_TAB");
   yield typeWithTerminator("/", "VK_TAB");
   yield typeWithTerminator(".example.org", "VK_TAB");
   yield typeWithTerminator("Tue, 25 Dec 2040 12:00:00 GMT", "VK_TAB");
   yield typeWithTerminator("test6value", "VK_TAB");
--- a/devtools/client/storage/test/browser_storage_cookies_tab_navigation.js
+++ b/devtools/client/storage/test/browser_storage_cookies_tab_navigation.js
@@ -3,16 +3,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // Basic test to check cookie table tab navigation.
 
 "use strict";
 
 add_task(function* () {
   yield openTabAndSetupStorage(MAIN_DOMAIN + "storage-cookies.html");
+  yield gUI.table.once(TableWidget.EVENTS.FIELDS_EDITABLE);
+
   showAllColumns(true);
 
   yield startCellEdit("test1", "name");
 
   PressKeyXTimes("VK_TAB", 18);
   is(getCurrentEditorValue(), "value3",
      "We have tabbed to the correct cell.");
 
--- a/devtools/client/storage/test/browser_storage_localstorage_edit.js
+++ b/devtools/client/storage/test/browser_storage_localstorage_edit.js
@@ -5,16 +5,17 @@
 // Basic test to check the editing of localStorage.
 
 "use strict";
 
 add_task(function* () {
   yield openTabAndSetupStorage(MAIN_DOMAIN + "storage-localstorage.html");
 
   yield selectTreeItem(["localStorage", "http://test1.example.org"]);
+  yield gUI.table.once(TableWidget.EVENTS.FIELDS_EDITABLE);
 
   yield editCell("TestLS1", "name", "newTestLS1");
   yield editCell("newTestLS1", "value", "newValueLS1");
 
   yield editCell("TestLS3", "name", "newTestLS3");
   yield editCell("newTestLS3", "value", "newValueLS3");
 
   yield editCell("TestLS5", "name", "newTestLS5");
--- a/devtools/client/storage/test/browser_storage_sessionstorage_edit.js
+++ b/devtools/client/storage/test/browser_storage_sessionstorage_edit.js
@@ -5,16 +5,17 @@
 // Basic test to check the editing of localStorage.
 
 "use strict";
 
 add_task(function* () {
   yield openTabAndSetupStorage(MAIN_DOMAIN + "storage-sessionstorage.html");
 
   yield selectTreeItem(["sessionStorage", "http://test1.example.org"]);
+  yield gUI.table.once(TableWidget.EVENTS.FIELDS_EDITABLE);
 
   yield editCell("TestSS1", "name", "newTestSS1");
   yield editCell("newTestSS1", "value", "newValueSS1");
 
   yield editCell("TestSS3", "name", "newTestSS3");
   yield editCell("newTestSS3", "value", "newValueSS3");
 
   yield editCell("TestSS5", "name", "newTestSS5");
--- a/devtools/client/storage/test/head.js
+++ b/devtools/client/storage/test/head.js
@@ -29,29 +29,23 @@ var gToolbox, gPanelWindow, gWindow, gUI
 
 // Services.prefs.setBoolPref(DUMPEMIT_PREF, true);
 // Services.prefs.setBoolPref(DEBUGGERLOG_PREF, true);
 
 Services.prefs.setBoolPref(STORAGE_PREF, true);
 Services.prefs.setBoolPref(CACHES_ON_HTTP_PREF, true);
 DevToolsUtils.testing = true;
 registerCleanupFunction(() => {
-  DevToolsUtils.testing = false;
   gToolbox = gPanelWindow = gWindow = gUI = null;
   Services.prefs.clearUserPref(STORAGE_PREF);
   Services.prefs.clearUserPref(SPLIT_CONSOLE_PREF);
   Services.prefs.clearUserPref(DUMPEMIT_PREF);
   Services.prefs.clearUserPref(DEBUGGERLOG_PREF);
   Services.prefs.clearUserPref(CACHES_ON_HTTP_PREF);
-});
-
-registerCleanupFunction(function* cleanup() {
-  let target = TargetFactory.forTab(gBrowser.selectedTab);
-  yield gDevTools.closeToolbox(target);
-
+  DevToolsUtils.testing = false;
   while (gBrowser.tabs.length > 1) {
     gBrowser.removeCurrentTab();
   }
 });
 
 /**
  * Add a new test tab in the browser and load the given url.
  *
@@ -661,17 +655,17 @@ function getCellValue(id, column) {
  *        The uniqueId of the changed row.
  */
 function* editCell(id, column, newValue, validate = true) {
   let row = getRowCells(id, true);
   let editableFieldsEngine = gUI.table._editableFieldsEngine;
 
   editableFieldsEngine.edit(row[column]);
 
-  yield typeWithTerminator(newValue, "VK_RETURN", validate);
+  return yield typeWithTerminator(newValue, "VK_RETURN", validate);
 }
 
 /**
  * Begin edit mode for a cell.
  *
  * @param {String} id
  *        The uniqueId of the row.
  * @param {String} column
--- a/devtools/client/storage/ui.js
+++ b/devtools/client/storage/ui.js
@@ -1,15 +1,16 @@
 /* vim:set ts=2 sw=2 sts=2 et: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
+const {Cu} = require("chrome");
 const EventEmitter = require("devtools/shared/event-emitter");
 const {LocalizationHelper} = require("devtools/client/shared/l10n");
 
 loader.lazyRequireGetter(this, "TreeWidget",
                          "devtools/client/shared/widgets/TreeWidget", true);
 loader.lazyRequireGetter(this, "TableWidget",
                          "devtools/client/shared/widgets/TableWidget", true);
 loader.lazyImporter(this, "ViewHelpers",
@@ -188,22 +189,25 @@ StorageUI.prototype = {
   },
 
   getCurrentActor: function() {
     let type = this.table.datatype;
 
     return this.storageTypes[type];
   },
 
-  makeFieldsEditable: function* () {
+  makeFieldsEditable: function() {
     let actor = this.getCurrentActor();
 
     if (typeof actor.getEditableFields !== "undefined") {
-      let fields = yield actor.getEditableFields();
-      this.table.makeFieldsEditable(fields);
+      actor.getEditableFields().then(fields => {
+        this.table.makeFieldsEditable(fields);
+      }).catch(() => {
+        // Do nothing
+      });
     } else if (this.table._editableFieldsEngine) {
       this.table._editableFieldsEngine.destroy();
     }
   },
 
   editItem: function(eventType, data) {
     let actor = this.getCurrentActor();
 
@@ -395,37 +399,43 @@ StorageUI.prototype = {
    *        The type of storage. Ex. "cookies"
    * @param {string} host
    *        Hostname
    * @param {array} names
    *        Names of particular store objects. Empty if all are requested
    * @param {Constant} reason
    *        See REASON constant at top of file.
    */
-  fetchStorageObjects: Task.async(function* (type, host, names, reason) {
+  fetchStorageObjects: function(type, host, names, reason) {
     let fetchOpts = reason === REASON.NEXT_50_ITEMS ? {offset: this.itemOffset}
                                                     : {};
     let storageType = this.storageTypes[type];
 
     if (reason !== REASON.NEXT_50_ITEMS &&
         reason !== REASON.UPDATE &&
         reason !== REASON.NEW_ROW &&
         reason !== REASON.POPULATE) {
       throw new Error("Invalid reason specified");
     }
 
-    let {data} = yield storageType.getStoreObjects(host, names, fetchOpts);
-    if (data.length) {
+    storageType.getStoreObjects(host, names, fetchOpts).then(({data}) => {
+      if (!data.length) {
+        this.emit("store-objects-updated");
+        return;
+      }
       if (reason === REASON.POPULATE) {
-        yield this.resetColumns(data[0], type, host);
+        this.resetColumns(data[0], type);
+        this.table.host = host;
       }
       this.populateTable(data, reason);
-    }
-    this.emit("store-objects-updated");
-  }),
+      this.emit("store-objects-updated");
+
+      this.makeFieldsEditable();
+    }, Cu.reportError);
+  },
 
   /**
    * Populates the storage tree which displays the list of storages present for
    * the page.
    *
    * @param {object} storageTypes
    *        List of storages and their corresponding hosts returned by the
    *        StorageFront.listStores call.
@@ -651,40 +661,35 @@ StorageUI.prototype = {
    * Resets the column headers in the storage table with the pased object `data`
    *
    * @param {object} data
    *        The object from which key and values will be used for naming the
    *        headers of the columns
    * @param {string} type
    *        The type of storage corresponding to the after-reset columns in the
    *        table.
-   * @param {string} host
-   *        The host name corresponding to the table after reset.
    */
-  resetColumns: function* (data, type, host) {
+  resetColumns: function(data, type) {
     let columns = {};
     let uniqueKey = null;
     for (let key in data) {
       if (!uniqueKey) {
         this.table.uniqueId = uniqueKey = key;
       }
       columns[key] = key;
       try {
         columns[key] = L10N.getStr("table.headers." + type + "." + key);
       } catch (e) {
         console.error("Unable to localize table header type:" + type +
                       " key:" + key);
       }
     }
     this.table.setColumns(columns, null, HIDDEN_COLUMNS);
     this.table.datatype = type;
-    this.table.host = host;
     this.hideSidebar();
-
-    yield this.makeFieldsEditable();
   },
 
   /**
    * Populates or updates the rows in the storage table.
    *
    * @param {array[object]} data
    *        Array of objects to be populated in the storage table
    * @param {Constant} reason