Merge from vscode e0762af258c0b20320ed03f3871a41967acc4421 (#7404)

* Merge from vscode e0762af258c0b20320ed03f3871a41967acc4421

* readd svgs
This commit is contained in:
Anthony Dresser
2019-09-27 11:13:19 -07:00
committed by GitHub
parent 6385443a4c
commit 07109617b5
348 changed files with 4219 additions and 4307 deletions

View File

@@ -81,4 +81,52 @@ suite('Telemetry - common properties', function () {
value2 = props['common.timesincesessionstart'];
assert.ok(value1 !== value2, 'timesincesessionstart');
});
test('mixes in additional properties', async function () {
const resolveCommonTelemetryProperties = () => {
return {
'userId': '1'
};
};
const props = await resolveWorkbenchCommonProperties(testStorageService, commit, version, 'someMachineId', undefined, installSource, undefined, resolveCommonTelemetryProperties);
assert.ok('commitHash' in props);
assert.ok('sessionID' in props);
assert.ok('timestamp' in props);
assert.ok('common.platform' in props);
assert.ok('common.nodePlatform' in props);
assert.ok('common.nodeArch' in props);
assert.ok('common.timesincesessionstart' in props);
assert.ok('common.sequence' in props);
assert.ok('common.platformVersion' in props, 'platformVersion');
assert.ok('version' in props);
assert.ok('common.firstSessionDate' in props, 'firstSessionDate');
assert.ok('common.lastSessionDate' in props, 'lastSessionDate');
assert.ok('common.isNewSession' in props, 'isNewSession');
assert.ok('common.instanceId' in props, 'instanceId');
assert.ok('common.machineId' in props, 'machineId');
assert.equal(props['userId'], '1');
});
test('mixes in additional dyanmic properties', async function () {
let i = 1;
const resolveCommonTelemetryProperties = () => {
return Object.defineProperties({}, {
'userId': {
get: () => {
return i++;
},
enumerable: true
}
});
};
const props = await resolveWorkbenchCommonProperties(testStorageService, commit, version, 'someMachineId', undefined, installSource, undefined, resolveCommonTelemetryProperties);
assert.equal(props['userId'], '1');
const props2 = await resolveWorkbenchCommonProperties(testStorageService, commit, version, 'someMachineId', undefined, installSource, undefined, resolveCommonTelemetryProperties);
assert.equal(props2['userId'], '2');
});
});