function clickPopupButton(aPopup, aButtonIndex) {
    ok(true, "Looking for action at index " + aButtonIndex);

    var notifications = SpecialPowers.wrap(aPopup.owner).panel.childNodes;
    ok(notifications.length > 0, "at least one notification displayed");
    ok(true, notifications.length + " notifications");
    var notification = notifications[0];

    if (aButtonIndex == 0) {
        ok(true, "Triggering main action");
        notification.button.doCommand();
    } else if (aButtonIndex <= aPopup.secondaryActions.length) {
        var index = aButtonIndex - 1;
        ok(true, "Triggering secondary action " + index);
        notification.childNodes[index].doCommand();
    }
}
/*
 * clickPopupButton
 *
 * Clicks the specified popup notification button.
 */
clickPopupButton
Clicks the specified popup notification button.
clickPopupButton Clicks the specified popup notification button .
function clickPopupButton(aPopup, aButtonIndex) {
    ok(true, "Looking for action at index " + aButtonIndex);
    var notifications = SpecialPowers.wrap(aPopup.owner).panel.childNodes;
    ok(notifications.length > 0, "at least one notification displayed");
    ok(true, notifications.length + " notifications");
    var notification = notifications[0];
    if (aButtonIndex == 0) {
        ok(true, "Triggering main action");
        notification.button.doCommand();
    } else if (aButtonIndex <= aPopup.secondaryActions.length) {
        var index = aButtonIndex - 1;
        ok(true, "Triggering secondary action " + index);
        notification.childNodes[index].doCommand();
    }
}
function clickPopupButton ( aPopup , aButtonIndex ) { ok ( true , "Looking for action at index " + aButtonIndex ) ; var notifications = SpecialPowers . wrap ( aPopup . owner ) . panel . childNodes ; ok ( notifications . length > 0 , "at least one notification displayed" ) ; ok ( true , notifications . length + " notifications" ) ; var notification = notifications [ 0 ] ; if ( aButtonIndex == 0 ) { ok ( true , "Triggering main action" ) ; notification . button . doCommand ( ) ; } else if ( aButtonIndex <= aPopup . secondaryActions . length ) { var index = aButtonIndex - 1 ; ok ( true , "Triggering secondary action " + index ) ; notification . childNodes [ index ] . doCommand ( ) ; } }
clickPopupButton
 Clicks the specified popup notification button.
clickPopupButton Clicks the specified popup notification button .