зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset ff8aa19ba327 (bug 1261785) for frequent failure in devtools test devtools/client/shared/test/browser_telemetry_toolboxtabs_storage.js. r=backout
This commit is contained in:
Родитель
9e4b410498
Коммит
91cef3173a
|
@ -30,6 +30,7 @@ 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,6 +8,8 @@
|
|||
|
||||
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,6 +8,8 @@
|
|||
|
||||
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,6 +8,8 @@
|
|||
|
||||
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,6 +10,7 @@ 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,6 +10,7 @@ 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,19 +34,13 @@ 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();
|
||||
}
|
||||
|
@ -666,7 +660,7 @@ function* editCell(id, column, newValue, validate = true) {
|
|||
|
||||
editableFieldsEngine.edit(row[column]);
|
||||
|
||||
yield typeWithTerminator(newValue, "VK_RETURN", validate);
|
||||
return yield typeWithTerminator(newValue, "VK_RETURN", validate);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {Cu} = require("chrome");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const {LocalizationHelper} = require("devtools/client/shared/l10n");
|
||||
|
||||
|
@ -193,12 +194,15 @@ StorageUI.prototype = {
|
|||
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();
|
||||
}
|
||||
|
@ -400,7 +404,7 @@ StorageUI.prototype = {
|
|||
* @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];
|
||||
|
@ -412,15 +416,21 @@ StorageUI.prototype = {
|
|||
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
|
||||
|
@ -656,10 +666,8 @@ 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, host) {
|
||||
resetColumns: function(data, type) {
|
||||
let columns = {};
|
||||
let uniqueKey = null;
|
||||
for (let key in data) {
|
||||
|
@ -676,10 +684,7 @@ StorageUI.prototype = {
|
|||
}
|
||||
this.table.setColumns(columns, null, HIDDEN_COLUMNS);
|
||||
this.table.datatype = type;
|
||||
this.table.host = host;
|
||||
this.hideSidebar();
|
||||
|
||||
yield this.makeFieldsEditable();
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче