diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-02 13:36:16 +0100 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-02 13:36:16 +0100 |
commit | 390894c822f1b163f16744646372a28c0d93a89e (patch) | |
tree | 29b6368ffd292bafcc098a0215cb83d0a7a925ec /devtools/client/storage/test/head.js | |
parent | e272829137195b46612b7664c9416364089f7baa (diff) | |
download | UXP-390894c822f1b163f16744646372a28c0d93a89e.tar UXP-390894c822f1b163f16744646372a28c0d93a89e.tar.gz UXP-390894c822f1b163f16744646372a28c0d93a89e.tar.lz UXP-390894c822f1b163f16744646372a28c0d93a89e.tar.xz UXP-390894c822f1b163f16744646372a28c0d93a89e.zip |
Bug 1146194: Multiple cookies with the same name not shown
Issue #31
Diffstat (limited to 'devtools/client/storage/test/head.js')
-rw-r--r-- | devtools/client/storage/test/head.js | 47 |
1 files changed, 44 insertions, 3 deletions
diff --git a/devtools/client/storage/test/head.js b/devtools/client/storage/test/head.js index 9662393cf..894056c9e 100644 --- a/devtools/client/storage/test/head.js +++ b/devtools/client/storage/test/head.js @@ -24,6 +24,11 @@ const MAIN_DOMAIN = "http://test1.example.org/" + PATH; const ALT_DOMAIN = "http://sectest1.example.org/" + PATH; const ALT_DOMAIN_SECURED = "https://sectest1.example.org:443/" + PATH; +// GUID to be used as a separator in compound keys. This must match the same +// constant in devtools/server/actors/storage.js, +// devtools/client/storage/ui.js and devtools/server/tests/browser/head.js +const SEPARATOR_GUID = "{9d414cc5-8319-0a04-0586-c0a6ae01670a}"; + var gToolbox, gPanelWindow, gWindow, gUI; // Services.prefs.setBoolPref(DUMPEMIT_PREF, true); @@ -505,10 +510,16 @@ function* selectTreeItem(ids) { * The id of the row in the table widget */ function* selectTableItem(id) { - let selector = ".table-widget-cell[data-id='" + id + "']"; + let table = gUI.table; + let selector = ".table-widget-column#" + table.uniqueId + + " .table-widget-cell[value='" + id + "']"; let target = gPanelWindow.document.querySelector(selector); ok(target, "table item found with ids " + id); + if (!target) { + showAvailableIds(); + } + yield click(target); yield gUI.once("sidebar-updated"); } @@ -586,22 +597,39 @@ function getRowCells(id, includeHidden = false) { if (!item) { ok(false, "Row id '" + id + "' exists"); + + showAvailableIds(); } - let index = table.columns.get(table.uniqueId).visibleCellNodes.indexOf(item); + let index = table.columns.get(table.uniqueId).cellNodes.indexOf(item); let cells = {}; for (let [name, column] of [...table.columns]) { if (!includeHidden && column.column.parentNode.hidden) { continue; } - cells[name] = column.visibleCellNodes[index]; + cells[name] = column.cellNodes[index]; } return cells; } /** + * Show available ids. + */ +function showAvailableIds() { + let doc = gPanelWindow.document; + let table = gUI.table; + + info("Available ids:"); + let cells = doc.querySelectorAll(".table-widget-column#" + table.uniqueId + + " .table-widget-cell"); + for (let cell of cells) { + info(" - " + cell.getAttribute("value")); + } +} + +/** * Get a cell value. * * @param {String} id @@ -798,9 +826,18 @@ function* checkState(state) { is(items.size, names.length, `There is correct number of rows in ${storeName}`); + + if (names.length === 0) { + showAvailableIds(); + } + for (let name of names) { ok(items.has(name), `There is item with name '${name}' in ${storeName}`); + + if (!items.has(name)) { + showAvailableIds(); + } } } } @@ -838,3 +875,7 @@ var focusSearchBoxUsingShortcut = Task.async(function* (panelWin, callback) { callback(); } }); + +function getCookieId(name, domain, path) { + return `${name}${SEPARATOR_GUID}${domain}${SEPARATOR_GUID}${path}`; +} |