mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 983636 - Update tests to support testing of adding duplicate properties. r=jryans
This commit is contained in:
parent
d3551f8f02
commit
2cb26ed54d
@ -23,6 +23,13 @@ function test() {
|
||||
yield changeManifestValue("name", "the best app");
|
||||
yield changeManifestValueBad("name", "the worst app");
|
||||
yield addNewManifestProperty("developer", "foo", "bar");
|
||||
|
||||
// add duplicate property in the same parent doesn't create duplicates
|
||||
yield addNewManifestProperty("developer", "foo", "bar2");
|
||||
|
||||
// add propery with same key in other parent is allowed
|
||||
yield addNewManifestProperty("tester", "foo", "new");
|
||||
|
||||
yield addNewManifestPropertyBad("developer", "blob", "bob");
|
||||
yield removeManifestProperty("developer", "foo");
|
||||
gManifestWindow = null;
|
||||
@ -94,15 +101,14 @@ function changeManifestValueBad(key, value) {
|
||||
}
|
||||
|
||||
function addNewManifestProperty(parent, key, value) {
|
||||
info("Adding new property - parent: " + parent + "; key: " + key + "; value: " + value + "\n\n");
|
||||
return Task.spawn(function() {
|
||||
let parentElem = gManifestWindow.document
|
||||
.querySelector("[id ^= '" + parent + "']");
|
||||
ok(parentElem,
|
||||
"Found parent element");
|
||||
let addPropertyElem = parentElem
|
||||
.querySelector(".variables-view-add-property");
|
||||
ok(addPropertyElem,
|
||||
"Found add-property button");
|
||||
ok(parentElem, "Found parent element: " + parentElem.id);
|
||||
|
||||
let addPropertyElem = parentElem.querySelector(".variables-view-add-property");
|
||||
ok(addPropertyElem, "Found add-property button");
|
||||
|
||||
EventUtils.sendMouseEvent({ type: "mousedown" }, addPropertyElem, gManifestWindow);
|
||||
|
||||
@ -116,10 +122,13 @@ function addNewManifestProperty(parent, key, value) {
|
||||
|
||||
yield waitForUpdate();
|
||||
|
||||
let newElem = gManifestWindow.document.querySelector("[id ^= '" + key + "']");
|
||||
parentElem = gManifestWindow.document.querySelector("[id ^= '" + parent + "']");
|
||||
let elems = parentElem.querySelectorAll("[id ^= '" + key + "']");
|
||||
is(elems.length, 1, "No duplicate property is added");
|
||||
|
||||
let newElem = elems[0];
|
||||
let nameElem = newElem.querySelector(".name");
|
||||
is(nameElem.value, key,
|
||||
"Key doesn't match expected Key");
|
||||
is(nameElem.value, key, "Key doesn't match expected Key");
|
||||
|
||||
ok(key in gManifestEditor.manifest[parent],
|
||||
"Manifest doesn't contain expected key");
|
||||
|
@ -2,5 +2,8 @@
|
||||
"name": "My packaged app",
|
||||
"developer": {
|
||||
"name": "Foo Bar"
|
||||
},
|
||||
"tester" : {
|
||||
"who": "qa"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user