Backed out changeset 6e79dedcd251 (bug 1287914) for failing on own test

This commit is contained in:
Carsten "Tomcat" Book 2016-07-27 15:09:28 +02:00
Родитель 65e19d07b7
Коммит 0093565608
2 изменённых файлов: 10 добавлений и 34 удалений

Просмотреть файл

@ -1194,17 +1194,7 @@ const DownloadsViewController = {
!(aCommand in DownloadsViewItem.prototype)) {
return false;
}
// The currently supported commands depend on whether the blocked subview is
// showing. If it is, then take the following path.
if (DownloadsBlockedSubview.view.showingSubView) {
let blockedSubviewCmds = [
"downloadsCmd_chooseOpen",
"cmd_delete",
];
return blockedSubviewCmds.indexOf(aCommand) >= 0;
}
// If the blocked subview is not showing, then determine if focus is on a
// control in the downloads list.
// Secondly, determine if focus is on a control in the downloads list.
let element = document.commandDispatcher.focusedElement;
while (element && element != DownloadsView.richListBox) {
element = element.parentNode;
@ -1614,9 +1604,6 @@ const DownloadsBlockedSubview = {
*/
hide() {
this.view.showMainView();
// The point of this is to focus the proper element in the panel now that
// the main view is showing again. showPanel handles that.
DownloadsPanel.showPanel();
},
/**

Просмотреть файл

@ -39,8 +39,7 @@ add_task(function* mainTest() {
// Click the Open button. The alert blocked-download dialog should be
// shown.
let dialogPromise = promiseAlertDialogOpen("cancel");
EventUtils.synthesizeMouse(DownloadsBlockedSubview.elements.openButton,
10, 10, {}, window);
DownloadsBlockedSubview.elements.openButton.click();
yield dialogPromise;
window.focus();
@ -54,8 +53,7 @@ add_task(function* mainTest() {
// Click the Remove button. The panel should close and the item should be
// removed from it.
EventUtils.synthesizeMouse(DownloadsBlockedSubview.elements.deleteButton,
10, 10, {}, window);
DownloadsBlockedSubview.elements.deleteButton.click();
yield promisePanelHidden();
yield openPanel();
@ -153,24 +151,15 @@ function makeDownload(verdict) {
function promiseSubviewShown(shown) {
return new Promise(resolve => {
if (shown == DownloadsBlockedSubview.view.showingSubView &&
!DownloadsBlockedSubview.view._transitioning) {
info("promiseSubviewShown: already showing");
if (shown == DownloadsBlockedSubview.view.showingSubView) {
resolve();
return;
}
let subviews = DownloadsBlockedSubview.view._subViews;
let onTransition = event => {
info("promiseSubviewShown: transitionend observed," +
" target=" + event.target +
" target.className=" + event.target.className);
if (event.target == subviews) {
info("promiseSubviewShown: got transitionend");
subviews.removeEventListener("transitionend", onTransition);
setTimeout(resolve, 0);
}
};
subviews.addEventListener("transitionend", onTransition);
info("promiseSubviewShown: waiting on transitionend");
let event = shown ? "ViewShowing" : "ViewHiding";
let subview = DownloadsBlockedSubview.subview;
subview.addEventListener(event, function showing() {
subview.removeEventListener(event, showing);
resolve();
});
});
}