Bug 1629116 - Add an overrideTelemetryName to bridged extension storage. r=markh

Add an overrideTelemetryName to bridged extension storage.

Differential Revision: https://phabricator.services.mozilla.com/D78413
This commit is contained in:
Thom Chiovoloni 2020-06-05 01:10:10 +00:00
parent b6a091d9dd
commit d76d4f4c46
3 changed files with 16 additions and 3 deletions

View File

@ -80,6 +80,9 @@ ExtensionStorageEngineBridge.prototype = {
// we don't support repair at all!
_skipPercentageChance: 100,
// Used to override the engine name in telemetry, so that we can distinguish .
overrideTelemetryName: "rust-webext-storage",
_notifyPendingChanges() {
return new Promise(resolve => {
this._bridge

View File

@ -143,7 +143,13 @@ add_task(async function test_engine() {
);
info("Sync the engine");
await sync_engine_and_validate_telem(engine, false);
let ping = await sync_engine_and_validate_telem(engine, false);
Assert.ok(ping.engines.find(e => e.name == "rust-webext-storage"));
Assert.equal(
ping.engines.find(e => e.name == "extension-storage"),
null
);
// We should have applied the data from the existing collection record.
Assert.deepEqual(await extensionStorageSync.get({ id: "ext-1" }, null), {

View File

@ -117,8 +117,12 @@ add_task(async function test_calling_sync_calls_ext_storage_sync() {
await withSyncContext(async function(context) {
// Set something so that everyone knows that we're using storage.sync
await extensionStorageSync.set(extension, { a: "b" }, context);
await engine._sync();
let ping = await sync_engine_and_validate_telem(engine, false);
Assert.ok(ping.engines.find(e => e.name == "extension-storage"));
Assert.equal(
ping.engines.find(e => e.name == "rust-webext-storage"),
null
);
});
} finally {
extensionStorageSync.syncAll = oldSync;