Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
chore($sniffer): make android variable public
Browse files Browse the repository at this point in the history
  • Loading branch information
clkao authored and tbosch committed Dec 18, 2013
1 parent 73c6671 commit 57d5058
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ng/sniffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ function $SnifferProvider() {
vendorPrefix: vendorPrefix,
transitions : transitions,
animations : animations,
android: android,
msie : msie,
msieDocumentMode: documentMode
};
Expand Down
15 changes: 15 additions & 0 deletions test/ng/snifferSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 57d5058

Please sign in to comment.