Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

/* Any copyright is dedicated to the Public Domain.
// Tests that history initialization correctly handles a request to forcibly
// replace the current database.
add_task(async function () {
await createCorruptDb("places.sqlite");
let count = Services.telemetry
.getHistogramById("PLACES_DATABASE_CORRUPTION_HANDLING_STAGE")
.snapshot().values[3];
Assert.equal(count, undefined, "There should be no telemetry");
Assert.equal(
PlacesUtils.history.databaseStatus,
PlacesUtils.history.DATABASE_STATUS_CORRUPT
);
count = Services.telemetry
.getHistogramById("PLACES_DATABASE_CORRUPTION_HANDLING_STAGE")
.snapshot().values[3];
Assert.equal(count, 1, "Telemetry should have been added");
});