Bug 1212610 - Fix sorting permissions by site due a legacy property name being referenced. r=jaws

A reference to `rawHost` wasn't updated to `origin`.
This commit is contained in:
Matthew Noorenberghe 2015-10-20 09:49:06 -07:00
parent 7619f28e02
commit 0c6d296682
2 changed files with 42 additions and 1 deletions

View File

@ -173,6 +173,47 @@ var testRunner = {
},
observances: [{ type: "cookie", origin: "http://localhost:12345", data: "deleted" }],
},
{
expectPermObservancesDuringTestFunction: true,
test(params) {
for (let URL of ["http://a", "http://z", "http://b"]) {
let URI = params.ioService.newURI(URL, null, null);
params.pm.add(URI, "cookie", Ci.nsIPermissionManager.ALLOW_ACTION);
}
is(params.tree.view.rowCount, 3, "Three permissions should be present");
is(params.tree.view.getCellText(0, params.nameCol), "http://a",
"site should be sorted. 'a' should be first");
is(params.tree.view.getCellText(1, params.nameCol), "http://b",
"site should be sorted. 'b' should be second");
is(params.tree.view.getCellText(2, params.nameCol), "http://z",
"site should be sorted. 'z' should be third");
// Sort descending then check results in cleanup since sorting isn't synchronous.
EventUtils.synthesizeMouseAtCenter(params.doc.getElementById("siteCol"), {},
params.doc.defaultView);
params.btnApplyChanges.doCommand();
},
observances: [{ type: "cookie", origin: "http://a", data: "added",
capability: Ci.nsIPermissionManager.ALLOW_ACTION },
{ type: "cookie", origin: "http://z", data: "added",
capability: Ci.nsIPermissionManager.ALLOW_ACTION },
{ type: "cookie", origin: "http://b", data: "added",
capability: Ci.nsIPermissionManager.ALLOW_ACTION }],
cleanUp(params) {
is(params.tree.view.getCellText(0, params.nameCol), "http://z",
"site should be sorted. 'z' should be first");
is(params.tree.view.getCellText(1, params.nameCol), "http://b",
"site should be sorted. 'b' should be second");
is(params.tree.view.getCellText(2, params.nameCol), "http://a",
"site should be sorted. 'a' should be third");
for (let URL of ["http://a", "http://z", "http://b"]) {
let uri = params.ioService.newURI(URL, null, null);
params.pm.remove(uri, "cookie");
}
},
},
],
_currentTest: -1,

View File

@ -53,7 +53,7 @@
onselect="gPermissionManager.onPermissionSelected();">
<treecols>
<treecol id="siteCol" label="&treehead.sitename.label;" flex="3"
data-field-name="rawHost" persist="width"/>
data-field-name="origin" persist="width"/>
<splitter class="tree-splitter"/>
<treecol id="statusCol" label="&treehead.status.label;" flex="1"
data-field-name="capability" persist="width"/>