зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1261785 - Part 1: fix promise rejections in storage inspector tests. r=mratcliffe
This commit is contained in:
Родитель
60441017e6
Коммит
a926c39dee
|
@ -30,7 +30,6 @@ support-files =
|
|||
[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]
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
|
||||
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");
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
|
||||
add_task(function* () {
|
||||
yield openTabAndSetupStorage(MAIN_DOMAIN + "storage-cookies.html");
|
||||
yield gUI.table.once(TableWidget.EVENTS.FIELDS_EDITABLE);
|
||||
|
||||
showAllColumns(true);
|
||||
|
||||
yield startCellEdit("test4", "name");
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
|
||||
add_task(function* () {
|
||||
yield openTabAndSetupStorage(MAIN_DOMAIN + "storage-cookies.html");
|
||||
yield gUI.table.once(TableWidget.EVENTS.FIELDS_EDITABLE);
|
||||
|
||||
showAllColumns(true);
|
||||
|
||||
yield startCellEdit("test1", "name");
|
||||
|
|
|
@ -10,7 +10,6 @@ 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");
|
||||
|
|
|
@ -10,7 +10,6 @@ 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");
|
||||
|
|
|
@ -34,13 +34,19 @@ 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);
|
||||
DevToolsUtils.testing = false;
|
||||
});
|
||||
|
||||
registerCleanupFunction(function* cleanup() {
|
||||
let target = TargetFactory.forTab(gBrowser.selectedTab);
|
||||
yield gDevTools.closeToolbox(target);
|
||||
|
||||
while (gBrowser.tabs.length > 1) {
|
||||
gBrowser.removeCurrentTab();
|
||||
}
|
||||
|
@ -660,7 +666,7 @@ function* editCell(id, column, newValue, validate = true) {
|
|||
|
||||
editableFieldsEngine.edit(row[column]);
|
||||
|
||||
return yield typeWithTerminator(newValue, "VK_RETURN", validate);
|
||||
yield typeWithTerminator(newValue, "VK_RETURN", validate);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -194,15 +194,12 @@ StorageUI.prototype = {
|
|||
return this.storageTypes[type];
|
||||
},
|
||||
|
||||
makeFieldsEditable: function() {
|
||||
makeFieldsEditable: function* () {
|
||||
let actor = this.getCurrentActor();
|
||||
|
||||
if (typeof actor.getEditableFields !== "undefined") {
|
||||
actor.getEditableFields().then(fields => {
|
||||
this.table.makeFieldsEditable(fields);
|
||||
}).catch(() => {
|
||||
// Do nothing
|
||||
});
|
||||
let fields = yield actor.getEditableFields();
|
||||
this.table.makeFieldsEditable(fields);
|
||||
} else if (this.table._editableFieldsEngine) {
|
||||
this.table._editableFieldsEngine.destroy();
|
||||
}
|
||||
|
@ -404,7 +401,7 @@ StorageUI.prototype = {
|
|||
* @param {Constant} reason
|
||||
* See REASON constant at top of file.
|
||||
*/
|
||||
fetchStorageObjects: function(type, host, names, reason) {
|
||||
fetchStorageObjects: Task.async(function* (type, host, names, reason) {
|
||||
let fetchOpts = reason === REASON.NEXT_50_ITEMS ? {offset: this.itemOffset}
|
||||
: {};
|
||||
let storageType = this.storageTypes[type];
|
||||
|
@ -416,21 +413,19 @@ StorageUI.prototype = {
|
|||
throw new Error("Invalid reason specified");
|
||||
}
|
||||
|
||||
storageType.getStoreObjects(host, names, fetchOpts).then(({data}) => {
|
||||
if (!data.length) {
|
||||
this.emit("store-objects-updated");
|
||||
return;
|
||||
try {
|
||||
let {data} = yield storageType.getStoreObjects(host, names, fetchOpts);
|
||||
if (data.length) {
|
||||
if (reason === REASON.POPULATE) {
|
||||
yield this.resetColumns(data[0], type, host);
|
||||
}
|
||||
this.populateTable(data, reason);
|
||||
}
|
||||
if (reason === REASON.POPULATE) {
|
||||
this.resetColumns(data[0], type);
|
||||
this.table.host = host;
|
||||
}
|
||||
this.populateTable(data, reason);
|
||||
this.emit("store-objects-updated");
|
||||
|
||||
this.makeFieldsEditable();
|
||||
}, Cu.reportError);
|
||||
},
|
||||
} catch (ex) {
|
||||
Cu.reportError(ex);
|
||||
}
|
||||
}),
|
||||
|
||||
/**
|
||||
* Populates the storage tree which displays the list of storages present for
|
||||
|
@ -666,8 +661,10 @@ StorageUI.prototype = {
|
|||
* @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) {
|
||||
resetColumns: function* (data, type, host) {
|
||||
let columns = {};
|
||||
let uniqueKey = null;
|
||||
for (let key in data) {
|
||||
|
@ -684,7 +681,10 @@ StorageUI.prototype = {
|
|||
}
|
||||
this.table.setColumns(columns, null, HIDDEN_COLUMNS);
|
||||
this.table.datatype = type;
|
||||
this.table.host = host;
|
||||
this.hideSidebar();
|
||||
|
||||
yield this.makeFieldsEditable();
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче