Merge from upstream

This commit is contained in:
Andrew Sliwinski 2014-04-10 12:25:43 -07:00
commit aade0b4121
3 changed files with 10 additions and 4 deletions

View file

@ -245,7 +245,7 @@ SensingPrims.prototype.primTimestamp = function(b) {
var epoch = new Date(2000, 0, 1);
var dst = now.getTimezoneOffset() - epoch.getTimezoneOffset();
var msSince = now.getTime() - epoch.getTime();
msSince += (now.getTimezoneOffset() - dst) * 60000;
msSince -= dst * 60000;
return msSince / 86400000;
};

View file

@ -22,7 +22,7 @@ describe('SensingPrims', function() {
});
it('should return the days since 2000', function() {
expect(sensingPrims.prototype.primTimestamp()).toEqual(5280.25);
expect(sensingPrims.prototype.primTimestamp()).toBeCloseTo(5280);
});
});

View file

@ -169,7 +169,10 @@ describe('Sprite', function() {
expect($('.ask-container').css('bottom')).toBe('7px');
expect($('.ask-container').css('height')).toBe('25px');
expect($('.ask-container').css('height')).toBe('25px');
expect($('.ask-text-field').is(':focus')).toBe(true);
expect(
$('.ask-text-field').is(':focus') ||
document.activeElement.className.match(/ask-text-field/) !== null
).toBe(true);
expect(spriteProto.askInputOn).toBe(true);
});
@ -177,7 +180,10 @@ describe('Sprite', function() {
spriteProto.visible = false;
spriteProto.showAsk();
expect($('.ask-container').css('display')).toBe('none');
expect($('.ask-text-field').is(':focus')).toBe(false);
expect(
$('.ask-text-field').is(':focus') ||
document.activeElement.className.match(/ask-text-field/) !== null
).toBe(false);
});
});