B2G/gecko/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
/**
 * Tests that an add-on does appear in the crash report annotations, if
 * crash reporting is enabled. The test will fail if the add-on is not in the
 * annotation.
 * @param  aId
 *         The ID of the add-on
 * @param  aVersion
 *         The version of the add-on
 */
Tests that an add-on does appear in the crash report annotations, if
crash reporting is enabled. The test will fail if the add-on is not in the
annotation.
@param  aId
The ID of the add-on
@param  aVersion
The version of the add-on
Tests that an add - on does appear in the crash report annotations if crash reporting is enabled . The test will fail if the add - on is not in the annotation . @param aId The ID of the add - on @param aVersion The version of the add - on
function do_check_in_crash_annotation(aId, aVersion) {
  if (!("nsICrashReporter" in AM_Ci))
    return;
  if (!("Add-ons" in gAppInfo.annotations)) {
    do_check_false(true);
    return;
  }
  let addons = gAppInfo.annotations["Add-ons"].split(",");
  do_check_false(addons.indexOf(encodeURIComponent(aId) + ":" +
                                encodeURIComponent(aVersion)) < 0);
}
function do_check_in_crash_annotation ( aId , aVersion ) { if ( ! ( "nsICrashReporter" in AM_Ci ) ) return ; if ( ! ( "Add-ons" in gAppInfo . annotations ) ) { do_check_false ( true ) ; return ; } let addons = gAppInfo . annotations [ "Add-ons" ] . split ( "," ) ; do_check_false ( addons . indexOf ( encodeURIComponent ( aId ) + ":" + encodeURIComponent ( aVersion ) ) < 0 ) ; }
Tests that an add-on does appear in the crash report annotations, if
 crash reporting is enabled.
Tests that an add - on does appear in the crash report annotations if crash reporting is enabled .