aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJulien Bouquillon2013-06-28 12:06:36 +0200
committerPete Bacon Darwin2013-07-03 22:16:31 +0100
commitef5bc6c7c3336a64bae64fe9739cb1789907c906 (patch)
tree49fcf49655ac100076e51a8f2dbf50b1f7e1c827 /test
parent22b9b4757610918456e3486deb514bcc60a08852 (diff)
downloadangular.js-ef5bc6c7c3336a64bae64fe9739cb1789907c906.tar.bz2
fix($sniffer): detect transition/animation on older Android browsers
The stock Android browser doesn't support the current for-in body/style detection for animations and transitions but we can manually fix this. This is useful for PhoneGap web-views or traditional web-apps using the stock browser.
Diffstat (limited to 'test')
-rw-r--r--test/ng/snifferSpec.js44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/ng/snifferSpec.js b/test/ng/snifferSpec.js
index 5cdc8fd9..c9d0d5a8 100644
--- a/test/ng/snifferSpec.js
+++ b/test/ng/snifferSpec.js
@@ -179,6 +179,28 @@ describe('$sniffer', function() {
expect($sniffer.animations).toBe(true);
});
});
+
+ it('should be true on android with older body style properties', function() {
+ module(function($provide) {
+ var doc = {
+ body : {
+ style : {
+ webkitAnimation: ''
+ }
+ }
+ };
+ var win = {
+ navigator: {
+ userAgent: 'android 2'
+ }
+ };
+ $provide.value('$document', jqLite(doc));
+ $provide.value('$window', win);
+ });
+ inject(function($sniffer) {
+ expect($sniffer.animations).toBe(true);
+ });
+ });
});
describe('transitions', function() {
@@ -238,5 +260,27 @@ describe('$sniffer', function() {
});
});
+ it('should be true on android with older body style properties', function() {
+ module(function($provide) {
+ var doc = {
+ body : {
+ style : {
+ webkitTransition: ''
+ }
+ }
+ };
+ var win = {
+ navigator: {
+ userAgent: 'android 2'
+ }
+ };
+ $provide.value('$document', jqLite(doc));
+ $provide.value('$window', win);
+ });
+ inject(function($sniffer) {
+ expect($sniffer.transitions).toBe(true);
+ });
+ });
+
});
});