mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-31 22:25:30 +00:00
Bug 1007663 - Avoid showing empty experiments list. r=unfocused
This commit is contained in:
parent
b81afe3348
commit
e47998614d
@ -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