mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:18:48 +00:00
DevTools - Storage - throws an error (fixed merge conflict)
This commit is contained in:
@@ -125,8 +125,8 @@ function populateTable() {
|
||||
* Test if the nodes are inserted correctly in the table.
|
||||
*/
|
||||
function testTreeItemInsertedCorrectly() {
|
||||
is(table.tbody.children.length, 4*2 /* double because splitters */,
|
||||
"4 columns exist");
|
||||
// double because splitters
|
||||
is(table.tbody.children.length, 4 * 2, "4 columns exist");
|
||||
|
||||
// Test firstColumn option and check if the nodes are inserted correctly
|
||||
is(table.tbody.children[0].firstChild.children.length, 9 + 1 /* header */,
|
||||
@@ -135,7 +135,8 @@ function testTreeItemInsertedCorrectly() {
|
||||
"Correct column header value");
|
||||
|
||||
for (let i = 1; i < 4; i++) {
|
||||
is(table.tbody.children[i * 2].firstChild.children.length, 9 + 1 /* header */,
|
||||
// header
|
||||
is(table.tbody.children[i * 2].firstChild.children.length, 9 + 1,
|
||||
"Correct rows in column " + i);
|
||||
is(table.tbody.children[i * 2].firstChild.firstChild.value, "Column " + i,
|
||||
"Correct column header value");
|
||||
@@ -189,7 +190,7 @@ function testAPI() {
|
||||
is(node2.getAttribute("data-id"), "id7", "Correct node selected");
|
||||
|
||||
// test if selectedIRow getter works
|
||||
is(table.selectedRow["col1"], "id7", "Correct result of selectedRow getter");
|
||||
is(table.selectedRow.col1, "id7", "Correct result of selectedRow getter");
|
||||
|
||||
// test if isSelected works
|
||||
ok(table.isSelected("id7"), "isSelected with column id works");
|
||||
@@ -209,7 +210,7 @@ function testAPI() {
|
||||
is(node3.getAttribute("data-id"), "id4", "Correct node selected");
|
||||
|
||||
// test if selectedRow getter works
|
||||
is(table.selectedRow["col1"], "id4", "Correct result of selectedRow getter");
|
||||
is(table.selectedRow.col1, "id4", "Correct result of selectedRow getter");
|
||||
|
||||
// test if clear selection works
|
||||
table.clearSelection();
|
||||
@@ -280,10 +281,12 @@ function testAPI() {
|
||||
|
||||
// testing if clear works
|
||||
table.clear();
|
||||
is(table.tbody.children.length, 4*2 /* double because splitters */,
|
||||
// double because splitters
|
||||
is(table.tbody.children.length, 4 * 2,
|
||||
"4 columns exist even after clear");
|
||||
for (let i = 0; i < 4; i++) {
|
||||
is(table.tbody.children[i*2].firstChild.children.length, 1 /* header */,
|
||||
// header
|
||||
is(table.tbody.children[i*2].firstChild.children.length, 1,
|
||||
"Only header in the column " + i + " after clear call");
|
||||
is(table.tbody.children[i*2].firstChild.firstChild.value, "Column " + (i + 1),
|
||||
"Correct column header value");
|
||||
@@ -295,7 +298,8 @@ function testAPI() {
|
||||
col2: "Testing"
|
||||
});
|
||||
|
||||
is(table.tbody.children.length, 2*2 /* double because splitters */,
|
||||
// double because splitters
|
||||
is(table.tbody.children.length, 2 * 2,
|
||||
"2 columns exist after setColumn call");
|
||||
is(table.tbody.children[0].firstChild.firstChild.value, "Foobar",
|
||||
"Correct column header value for first column");
|
||||
@@ -308,7 +312,8 @@ function testAPI() {
|
||||
col3: "Column 3",
|
||||
col4: "Column 4"
|
||||
});
|
||||
is(table.tbody.children.length, 4*2 /* double because splitters */,
|
||||
// double because splitters
|
||||
is(table.tbody.children.length, 4 * 2,
|
||||
"4 columns exist after second setColumn call");
|
||||
|
||||
populateTable();
|
||||
|
||||
@@ -146,7 +146,7 @@ let testMouseInteraction = Task.async(function*() {
|
||||
ok(node.classList.contains("theme-selected"), "Node has selected class after click");
|
||||
is(id, "id1", "Correct row was selected");
|
||||
|
||||
info("clicking on third row to select it");
|
||||
info("clicking on second row to select it");
|
||||
event = table.once(TableWidget.EVENTS.ROW_SELECTED);
|
||||
let node2 = table.tbody.firstChild.firstChild.children[3];
|
||||
// node should not have selected class
|
||||
@@ -156,7 +156,7 @@ let testMouseInteraction = Task.async(function*() {
|
||||
id = yield event;
|
||||
ok(node2.classList.contains("theme-selected"),
|
||||
"New node has selected class after clicking");
|
||||
is(id, "id3", "Correct table path is emitted for new node")
|
||||
is(id, "id3", "Correct table path is emitted for new node");
|
||||
isnot(node, node2, "Old and new node are different");
|
||||
ok(!node.classList.contains("theme-selected"),
|
||||
"Old node should not have selected class after the click on new node");
|
||||
|
||||
@@ -120,8 +120,7 @@ function waitForValue(aOptions)
|
||||
if (successful) {
|
||||
ok(true, aOptions.name);
|
||||
successFn(aOptions, lastValue);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
setTimeout(function() wait(validatorFn, successFn, failureFn), 100);
|
||||
}
|
||||
}
|
||||
@@ -130,7 +129,7 @@ function waitForValue(aOptions)
|
||||
}
|
||||
|
||||
function oneTimeObserve(name, callback) {
|
||||
var func = function() {
|
||||
let func = function() {
|
||||
Services.obs.removeObserver(func, name);
|
||||
callback();
|
||||
};
|
||||
@@ -158,10 +157,10 @@ let createHost = Task.async(function*(type = "bottom", src = "data:text/html;cha
|
||||
* @param {String} toolId
|
||||
*/
|
||||
function* openAndCloseToolbox(nbOfTimes, usageTime, toolId) {
|
||||
for (let i = 0; i < nbOfTimes; i ++) {
|
||||
for (let i = 0; i < nbOfTimes; i++) {
|
||||
info("Opening toolbox " + (i + 1));
|
||||
let target = TargetFactory.forTab(gBrowser.selectedTab);
|
||||
yield gDevTools.showToolbox(target, toolId)
|
||||
yield gDevTools.showToolbox(target, toolId);
|
||||
|
||||
// We use a timeout to check the toolbox's active time
|
||||
yield new Promise(resolve => setTimeout(resolve, usageTime));
|
||||
|
||||
@@ -818,11 +818,13 @@ Column.prototype = {
|
||||
* for sorting.
|
||||
*/
|
||||
onClick: function(event) {
|
||||
if (event.originalTarget == this.column) {
|
||||
let target = event.originalTarget;
|
||||
|
||||
if (target.nodeType !== target.ELEMENT_NODE || target == this.column) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.button == 0 && event.originalTarget == this.header) {
|
||||
if (event.button == 0 && target == this.header) {
|
||||
return this.table.sortBy(this.id);
|
||||
}
|
||||
},
|
||||
@@ -831,22 +833,20 @@ Column.prototype = {
|
||||
* Mousedown event handler for the column. Used to select rows.
|
||||
*/
|
||||
onMousedown: function(event) {
|
||||
if (event.originalTarget == this.column ||
|
||||
event.originalTarget == this.header) {
|
||||
let target = event.originalTarget;
|
||||
|
||||
if (target.nodeType !== target.ELEMENT_NODE ||
|
||||
target == this.column ||
|
||||
target == this.header) {
|
||||
return;
|
||||
}
|
||||
if (event.button == 0) {
|
||||
let target = event.originalTarget;
|
||||
let dataid = null;
|
||||
|
||||
while (target) {
|
||||
dataid = target.getAttribute("data-id");
|
||||
if (dataid) {
|
||||
break;
|
||||
}
|
||||
target = target.parentNode;
|
||||
let closest = target.closest("[data-id]");
|
||||
if (!closest) {
|
||||
return;
|
||||
}
|
||||
|
||||
let dataid = closest.getAttribute("data-id");
|
||||
this.table.emit(EVENTS.ROW_SELECTED, dataid);
|
||||
}
|
||||
},
|
||||
@@ -962,7 +962,7 @@ Cell.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Flashes the cell for a brief time. This when done for ith cells in all
|
||||
* Flashes the cell for a brief time. This when done for with cells in all
|
||||
* columns, makes it look like the row is being highlighted/flashed.
|
||||
*/
|
||||
flash: function() {
|
||||
|
||||
@@ -27,7 +27,7 @@ const testCases = [
|
||||
{name: "c1.isDomain", value: "false"},
|
||||
{name: "c1.isHttpOnly", value: "false"},
|
||||
{name: "c1.host", value: "test1.example.org"},
|
||||
{name: "c1.expires", value: new Date(2000000000000).toLocaleString()},
|
||||
{name: "c1.expires", value: new Date(2000000000000).toUTCString()},
|
||||
{name: "c1.isSecure", value: "false"},
|
||||
]],
|
||||
[/*"c1"*/, [
|
||||
|
||||
@@ -444,8 +444,8 @@ StorageUI.prototype = {
|
||||
let p = separators[j];
|
||||
let regex = new RegExp("^([^" + kv + p + "]*" + kv + "+[^" + kv + p +
|
||||
"]*" + p + "*)+$", "g");
|
||||
if (value.match(regex) && value.contains(kv) &&
|
||||
(value.contains(p) || value.split(kv).length == 2)) {
|
||||
if (value.match && value.match(regex) && value.includes(kv) &&
|
||||
(value.includes(p) || value.split(kv).length == 2)) {
|
||||
return makeObject(kv, p);
|
||||
}
|
||||
}
|
||||
@@ -454,7 +454,7 @@ StorageUI.prototype = {
|
||||
for (let i = 0; i < separators.length; i++) {
|
||||
let p = separators[i];
|
||||
let regex = new RegExp("^[^" + p + "]+(" + p + "+[^" + p + "]*)+$", "g");
|
||||
if (value.match(regex)) {
|
||||
if (value.match && value.match(regex)) {
|
||||
return value.split(p.replace(/\\*/g, ""));
|
||||
}
|
||||
}
|
||||
@@ -534,14 +534,14 @@ StorageUI.prototype = {
|
||||
}
|
||||
if (item.expires != null) {
|
||||
item.expires = item.expires
|
||||
? new Date(item.expires).toLocaleString()
|
||||
? new Date(item.expires).toUTCString()
|
||||
: L10N.getStr("label.expires.session");
|
||||
}
|
||||
if (item.creationTime != null) {
|
||||
item.creationTime = new Date(item.creationTime).toLocaleString();
|
||||
item.creationTime = new Date(item.creationTime).toUTCString();
|
||||
}
|
||||
if (item.lastAccessed != null) {
|
||||
item.lastAccessed = new Date(item.lastAccessed).toLocaleString();
|
||||
item.lastAccessed = new Date(item.lastAccessed).toUTCString();
|
||||
}
|
||||
if (reason < 2) {
|
||||
this.table.push(item, reason == 0);
|
||||
|
||||
Reference in New Issue
Block a user