Skip to content

Commit f8f4a7e

Browse files
committed
Ignore ESR when checking isFirefoxUpToDate. Bug 1122154.
1 parent 2e45921 commit f8f4a7e

2 files changed

Lines changed: 9 additions & 18 deletions

File tree

media/js/base/global.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ function isFirefox(userAgent) {
110110
);
111111
}
112112

113-
function isFirefoxUpToDate(latest, esr) {
113+
// 2015-01-20: Gives no special consideration to ESR builds
114+
function isFirefoxUpToDate(latest) {
114115
var $html = $(document.documentElement);
115116
var fx_version = getFirefoxMasterVersion();
116-
var esrFirefoxVersions = esr || $html.data('esr-versions');
117117
var latestFirefoxVersion;
118118

119119
if (!latest) {
@@ -123,8 +123,7 @@ function isFirefoxUpToDate(latest, esr) {
123123
latestFirefoxVersion = parseInt(latest.split('.')[0], 10);
124124
}
125125

126-
return ($.inArray(fx_version, esrFirefoxVersions) !== -1 ||
127-
latestFirefoxVersion <= fx_version);
126+
return (latestFirefoxVersion <= fx_version);
128127
}
129128

130129
// used in bedrock for desktop specific checks like `isFirefox() && !isFirefoxMobile()`

media/js/test/spec/global.js

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -275,39 +275,31 @@ describe('global.js', function() {
275275

276276
describe('isFirefoxUpToDate', function () {
277277

278-
it('should consider up to date if latest is equal to firefox version', function() {
278+
it('should consider up to date if latest version is equal to user version', function() {
279279
var result;
280280
/* Use a stub to return a pre-programmed value
281281
* from getFirefoxMasterVersion */
282282
getFirefoxMasterVersion = sinon.stub().returns(21);
283-
result = isFirefoxUpToDate('21.0', [10, 17]);
283+
result = isFirefoxUpToDate('21.0');
284284
expect(getFirefoxMasterVersion.called).toBeTruthy();
285285
expect(result).toBeTruthy();
286286
});
287287

288-
it('should consider up to date if latest is less than firefox version', function() {
288+
it('should consider up to date if latest version is less than user version', function() {
289289
var result;
290290
getFirefoxMasterVersion = sinon.stub().returns(22);
291-
result = isFirefoxUpToDate('21.0', [10, 17]);
291+
result = isFirefoxUpToDate('21.0');
292292
expect(getFirefoxMasterVersion.called).toBeTruthy();
293293
expect(result).toBeTruthy();
294294
});
295295

296-
it('should not consider up to date if latest greater than firefox version', function() {
296+
it('should not consider up to date if latest version greater than user version', function() {
297297
var result;
298298
getFirefoxMasterVersion = sinon.stub().returns(20);
299-
result = isFirefoxUpToDate('21.0', [10, 17]);
299+
result = isFirefoxUpToDate('21.0');
300300
expect(getFirefoxMasterVersion.called).toBeTruthy();
301301
expect(result).not.toBeTruthy();
302302
});
303-
304-
it('should consider esr builds up to date', function() {
305-
var result;
306-
getFirefoxMasterVersion = sinon.stub().returns(10);
307-
result = isFirefoxUpToDate('21.0', [10, 17]);
308-
expect(getFirefoxMasterVersion.called).toBeTruthy();
309-
expect(result).toBeTruthy();
310-
});
311303
});
312304

313305
describe('gaTrack', function () {

0 commit comments

Comments
 (0)