mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1007663 - Avoid showing empty experiments list. r=unfocused
This commit is contained in:
parent
014baeb0e1
commit
2babd2681f
@ -236,7 +236,7 @@ richlistitem:not([selected]) * {
|
||||
|
||||
.view-pane[type="experiment"] .error,
|
||||
.view-pane[type="experiment"] .warning,
|
||||
.view-pane[type="experiment"] .pending,
|
||||
.view-pane[type="experiment"] .addon:not([pending="uninstall"]) .pending,
|
||||
.view-pane[type="experiment"] .disabled-postfix,
|
||||
.view-pane[type="experiment"] .update-postfix,
|
||||
.view-pane[type="experiment"] .version,
|
||||
|
@ -66,6 +66,30 @@ function openDetailsView(aId) {
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
function clickRemoveButton(addonElement) {
|
||||
let btn = gManagerWindow.document.getAnonymousElementByAttribute(addonElement, "anonid", "remove-btn");
|
||||
if (!btn) {
|
||||
return Promise.reject();
|
||||
}
|
||||
|
||||
EventUtils.synthesizeMouseAtCenter(btn, { clickCount: 1 }, gManagerWindow);
|
||||
let deferred = Promise.defer();
|
||||
setTimeout(deferred.resolve, 0);
|
||||
return deferred;
|
||||
}
|
||||
|
||||
function clickUndoButton(addonElement) {
|
||||
let btn = gManagerWindow.document.getAnonymousElementByAttribute(addonElement, "anonid", "undo-btn");
|
||||
if (!btn) {
|
||||
return Promise.reject();
|
||||
}
|
||||
|
||||
EventUtils.synthesizeMouseAtCenter(btn, { clickCount: 1 }, gManagerWindow);
|
||||
let deferred = Promise.defer();
|
||||
setTimeout(deferred.resolve, 0);
|
||||
return deferred;
|
||||
}
|
||||
|
||||
add_task(function* initializeState() {
|
||||
gManagerWindow = yield open_manager();
|
||||
gCategoryUtilities = new CategoryUtilities(gManagerWindow);
|
||||
@ -580,6 +604,28 @@ add_task(function testDetailView() {
|
||||
is_element_visible(el, "experiment-bullet should be visible.");
|
||||
});
|
||||
|
||||
add_task(function* testRemoveAndUndo() {
|
||||
if (!gExperiments) {
|
||||
info("Skipping experiments test because that feature isn't available.");
|
||||
return;
|
||||
}
|
||||
|
||||
yield gCategoryUtilities.openType("experiment");
|
||||
|
||||
let addon = get_addon_element(gManagerWindow, "test-experiment1@experiments.mozilla.org");
|
||||
Assert.ok(addon, "Got add-on element.");
|
||||
|
||||
yield clickRemoveButton(addon);
|
||||
addon.parentNode.ensureElementIsVisible(addon);
|
||||
|
||||
let el = gManagerWindow.document.getAnonymousElementByAttribute(addon, "class", "pending");
|
||||
is_element_visible(el, "Uninstall undo information should be visible.");
|
||||
|
||||
yield clickUndoButton(addon);
|
||||
addon = get_addon_element(gManagerWindow, "test-experiment1@experiments.mozilla.org");
|
||||
Assert.ok(addon, "Got add-on element.");
|
||||
});
|
||||
|
||||
add_task(function* testCleanup() {
|
||||
if (gExperiments) {
|
||||
Services.prefs.clearUserPref("experiments.enabled");
|
||||
|
Loading…
Reference in New Issue
Block a user