Bug 1302989: Make storage inspector work with file:// when # is in the URL

Issue #31
This commit is contained in:
janekptacijarabaci 2018-03-04 01:35:21 +01:00 committed by Roy Tam
commit b95939dd3c
16 changed files with 271 additions and 84 deletions

View file

@ -24,7 +24,7 @@
const testCases = [
[
["cookies", "test1.example.org"],
["cookies", "http://test1.example.org"],
[
getCookieId("c1", "test1.example.org", "/browser"),
getCookieId("cs2", ".example.org", "/"),
@ -35,7 +35,7 @@ const testCases = [
]
],
[
["cookies", "sectest1.example.org"],
["cookies", "https://sectest1.example.org"],
[
getCookieId("uc1", ".example.org", "/"),
getCookieId("uc2", ".example.org", "/"),
@ -93,8 +93,8 @@ const testCases = [
*/
function testTree() {
let doc = gPanelWindow.document;
for (let item of testCases) {
ok(doc.querySelector("[data-id='" + JSON.stringify(item[0]) + "']"),
for (let [item] of testCases) {
ok(doc.querySelector("[data-id='" + JSON.stringify(item) + "']"),
"Tree item " + item[0] + " should be present in the storage tree");
}
}
@ -108,8 +108,8 @@ function* testTables() {
gUI.tree.expandAll();
// First tree item is already selected so no clicking and waiting for update
for (let id of testCases[0][1]) {
ok(doc.querySelector(".table-widget-cell[data-id='" + id + "']"),
for (let [treeItem, items] of testCases.slice(1)) {
yield selectTreeItem(treeItem);
"Table item " + id + " should be present");
}
@ -120,10 +120,10 @@ function* testTables() {
// Check whether correct number of items are present in the table
is(doc.querySelectorAll(
".table-widget-wrapper:first-of-type .table-widget-cell"
).length, item[1].length, "Number of items in table is correct");
).length, items.length, "Number of items in table is correct");
// Check if all the desired items are present in the table
for (let id of item[1]) {
for (let id of items) {
ok(doc.querySelector(".table-widget-cell[data-id='" + id + "']"),
"Table item " + id + " should be present");
}