B2G/gecko/toolkit/mozapps/update/test/chrome/utils.js
/**
 * Checks whether the link is hidden (general background update check error or
 * a certificate attribute check error with an update) or not (certificate
 * attribute check error without an update) on the errorextra page and that the
 * app.update.cert.errors and app.update.backgroundErrors preferences do not
 & have a user value.
 *
 * @param  aShouldBeHidden (optional)
 *         The expected value for the label's hidden attribute for the link. If
 *         aShouldBeHidden is undefined the value of the current test's
 *         shouldBeHidden property will be used.
 */
Checks whether the link is hidden (general background update check error or
a certificate attribute check error with an update) or not (certificate
attribute check error without an update) on the errorextra page and that the
app.update.cert.errors and app.update.backgroundErrors preferences do not
& have a user value.

@param  aShouldBeHidden (optional)
The expected value for the label's hidden attribute for the link. If
aShouldBeHidden is undefined the value of the current test's
shouldBeHidden property will be used.
Checks whether the link is hidden ( general background update check error or a certificate attribute check error with an update ) or not ( certificate attribute check error without an update ) on the errorextra page and that the app . update . cert . errors and app . update . backgroundErrors preferences do not & have a user value . @param aShouldBeHidden ( optional ) The expected value for the label ' s hidden attribute for the link . If aShouldBeHidden is undefined the value of the current test ' s shouldBeHidden property will be used .
function checkErrorExtraPage(aShouldBeHidden) {
  let shouldBeHidden = aShouldBeHidden === undefined ? gTest.shouldBeHidden
                                                     : aShouldBeHidden;
  is(gWin.document.getElementById("errorExtraLinkLabel").hidden, shouldBeHidden,
     "Checking errorExtraLinkLabel hidden attribute equals " +
     (shouldBeHidden ? "true" : "false"));
  is(gWin.document.getElementById(gTest.displayedTextElem).hidden, false,
     "Checking " + gTest.displayedTextElem + " should not be hidden");
  ok(!Services.prefs.prefHasUserValue(PREF_APP_UPDATE_CERT_ERRORS),
     "Preference " + PREF_APP_UPDATE_CERT_ERRORS + " should not have a " +
     "user value");
  ok(!Services.prefs.prefHasUserValue(PREF_APP_UPDATE_BACKGROUNDERRORS),
     "Preference " + PREF_APP_UPDATE_BACKGROUNDERRORS + " should not have a " +
     "user value");
}
function checkErrorExtraPage ( aShouldBeHidden ) { let shouldBeHidden = aShouldBeHidden === undefined ? gTest . shouldBeHidden : aShouldBeHidden ; is ( gWin . document . getElementById ( "errorExtraLinkLabel" ) . hidden , shouldBeHidden , "Checking errorExtraLinkLabel hidden attribute equals " + ( shouldBeHidden ? "true" : "false" ) ) ; is ( gWin . document . getElementById ( gTest . displayedTextElem ) . hidden , false , "Checking " + gTest . displayedTextElem + " should not be hidden" ) ; ok ( ! Services . prefs . prefHasUserValue ( PREF_APP_UPDATE_CERT_ERRORS ) , "Preference " + PREF_APP_UPDATE_CERT_ERRORS + " should not have a " + "user value" ) ; ok ( ! Services . prefs . prefHasUserValue ( PREF_APP_UPDATE_BACKGROUNDERRORS ) , "Preference " + PREF_APP_UPDATE_BACKGROUNDERRORS + " should not have a " + "user value" ) ; }
Checks whether the link is hidden (general background update check error or
 a certificate attribute check error with an update) or not (certificate
 attribute check error without an update) on the errorextra page and that the
 app.update.cert.errors and app.update.backgroundErrors preferences do not
& have a user value.
Checks whether the link is hidden ( general background update check error or a certificate attribute check error with an update ) or not ( certificate attribute check error without an update ) on the errorextra page and that the app . update . cert . errors and app . update . backgroundErrors preferences do not & have a user value .