Bug 1166646: WINDOW_ENABLED telemetry key is falsy, thus not working. Check for its type properly. r=Standard8

This commit is contained in:
Mike de Boer 2015-05-26 15:35:59 +02:00
Родитель 10a4acc6be
Коммит e4b3d2ce07
2 изменённых файлов: 9 добавлений и 9 удалений

Просмотреть файл

@ -978,7 +978,7 @@ loop.OTSdkDriver = (function() {
var bucket = this.mozLoop.SHARING_STATE_CHANGE[type.toUpperCase() + "_" +
(enabled ? "ENABLED" : "DISABLED")];
if (!bucket) {
if (typeof bucket === "undefined") {
console.error("No sharing state bucket found for '" + type + "'");
return;
}

Просмотреть файл

@ -78,16 +78,16 @@ describe("loop.OTSdkDriver", function () {
mozLoop = {
telemetryAddValue: sinon.stub(),
TWO_WAY_MEDIA_CONN_LENGTH: {
SHORTER_THAN_10S: "SHORTER_THAN_10S",
BETWEEN_10S_AND_30S: "BETWEEN_10S_AND_30S",
BETWEEN_30S_AND_5M: "BETWEEN_30S_AND_5M",
MORE_THAN_5M: "MORE_THAN_5M"
SHORTER_THAN_10S: 0,
BETWEEN_10S_AND_30S: 1,
BETWEEN_30S_AND_5M: 2,
MORE_THAN_5M: 3
},
SHARING_STATE_CHANGE: {
WINDOW_ENABLED: "WINDOW_ENABLED",
WINDOW_DISABLED: "WINDOW_DISABLED",
BROWSER_ENABLED: "BROWSER_ENABLED",
BROWSER_DISABLED: "BROWSER_DISABLED"
WINDOW_ENABLED: 0,
WINDOW_DISABLED: 1,
BROWSER_ENABLED: 2,
BROWSER_DISABLED: 3
}
};