chore($sniffer): make android variable public

This commit is contained in:
Chia-liang Kao 2013-12-18 00:33:43 -08:00 committed by Tobias Bosch
parent 73c66715c9
commit 57d50582aa
2 changed files with 16 additions and 0 deletions

View file

@ -85,6 +85,7 @@ function $SnifferProvider() {
vendorPrefix: vendorPrefix,
transitions : transitions,
animations : animations,
android: android,
msie : msie,
msieDocumentMode: documentMode
};

View file

@ -334,6 +334,21 @@ describe('$sniffer', function() {
});
});
it('should provide the android version', function() {
module(function($provide) {
var win = {
navigator: {
userAgent: 'android 2'
}
};
$provide.value('$document', jqLite({}));
$provide.value('$window', win);
});
inject(function($sniffer) {
expect($sniffer.android).toBe(2);
});
});
it('should return the internal msie flag', inject(function($sniffer) {
expect(isNaN($sniffer.msie)).toBe(isNaN(msie));
if (msie) {