B2G/gecko/toolkit/mozapps/update/test/chrome/utils.js
/**
 * Checks the wizard page buttons' disabled and hidden attributes values are
 * correct. If an expected button id is not specified then the expected disabled
 * and hidden attribute value is true.
 */
Checks the wizard page buttons' disabled and hidden attributes values are
correct. If an expected button id is not specified then the expected disabled
and hidden attribute value is true.
Checks the wizard page buttons ' disabled and hidden attributes values are correct . If an expected button id is not specified then the expected disabled and hidden attribute value is true .
function checkButtonStates() {
  debugDump("entering - TESTS[" + gTestCounter + "], pageid: " + gTest.pageid);
  const buttonNames = ["extra1", "extra2", "back", "next", "finish", "cancel"];
  let buttonStates = getExpectedButtonStates();
  buttonNames.forEach(function(aButtonName) {
    let button = gDocElem.getButton(aButtonName);
    let hasHidden = aButtonName in buttonStates &&
                    "hidden" in buttonStates[aButtonName];
    let hidden = hasHidden ? buttonStates[aButtonName].hidden : true;
    let hasDisabled = aButtonName in buttonStates &&
                      "disabled" in buttonStates[aButtonName];
    let disabled = hasDisabled ? buttonStates[aButtonName].disabled : true;
    is(button.hidden, hidden, "Checking " + aButtonName + " button " +
       "hidden attribute value equals " + (hidden ? "true" : "false"));
    is(button.disabled, disabled, "Checking " + aButtonName + " button " +
       "disabled attribute value equals " + (disabled ? "true" : "false"));
  });
}
function checkButtonStates ( ) { debugDump ( "entering - TESTS[" + gTestCounter + "], pageid: " + gTest . pageid ) ; const buttonNames = [ "extra1" , "extra2" , "back" , "next" , "finish" , "cancel" ] ; let buttonStates = getExpectedButtonStates ( ) ; buttonNames . forEach ( function ( aButtonName ) { let button = gDocElem . getButton ( aButtonName ) ; let hasHidden = aButtonName in buttonStates && "hidden" in buttonStates [ aButtonName ] ; let hidden = hasHidden ? buttonStates [ aButtonName ] . hidden : true ; let hasDisabled = aButtonName in buttonStates && "disabled" in buttonStates [ aButtonName ] ; let disabled = hasDisabled ? buttonStates [ aButtonName ] . disabled : true ; is ( button . hidden , hidden , "Checking " + aButtonName + " button " + "hidden attribute value equals " + ( hidden ? "true" : "false" ) ) ; is ( button . disabled , disabled , "Checking " + aButtonName + " button " + "disabled attribute value equals " + ( disabled ? "true" : "false" ) ) ; } ) ; }
Checks the wizard page buttons' disabled and hidden attributes values are
 correct.
Checks the wizard page buttons ' disabled and hidden attributes values are correct .