diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2019-09-23 20:00:24 +0200 |
---|---|---|
committer | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2019-09-24 00:46:21 +0200 |
commit | 6276cb2e23375c1f2837b34bd9072ef804f996f1 (patch) | |
tree | de4175c3c64af21ba11b4ac53e8617744f43e160 /test/unit/support.js | |
parent | 8167327fd940c420854b68f425a84207abf3c44f (diff) | |
download | jquery-6276cb2e23375c1f2837b34bd9072ef804f996f1.tar.gz jquery-6276cb2e23375c1f2837b34bd9072ef804f996f1.zip |
Tests: Move Android user agent detection above iOS, put Safari last
Android was catching the generic iOS regex. Checking for Android first should
eliminate that issue as iOS user agents don't contain the word "Android".
Putting Safari last makes Android UAs not be tested against it.
Diffstat (limited to 'test/unit/support.js')
-rw-r--r-- | test/unit/support.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/unit/support.js b/test/unit/support.js index 2aad3a968..b280e364e 100644 --- a/test/unit/support.js +++ b/test/unit/support.js @@ -294,12 +294,12 @@ testIframe( expected = expectedMap.chrome; } else if ( /\b(?:9|10)\.\d+(\.\d+)* safari/i.test( userAgent ) ) { expected = expectedMap.safari_9_10; - } else if ( /\b\d+(\.\d+)+ safari/i.test( userAgent ) ) { - expected = expectedMap.safari; } else if ( /firefox\/(?:52|60)/i.test( userAgent ) ) { expected = expectedMap.firefox_60; } else if ( /firefox/i.test( userAgent ) ) { expected = expectedMap.firefox; + } else if ( /android 4\.[0-3]/i.test( userAgent ) ) { + expected = expectedMap.android; } else if ( /iphone os (?:9|10)_/i.test( userAgent ) ) { expected = expectedMap.ios_9_10; } else if ( /iphone os 8_/i.test( userAgent ) ) { @@ -308,8 +308,8 @@ testIframe( expected = expectedMap.ios_7; } else if ( /(?:iphone|ipad);.*(?:iphone)? os \d+_/i.test( userAgent ) ) { expected = expectedMap.ios; - } else if ( /android 4\.[0-3]/i.test( userAgent ) ) { - expected = expectedMap.android; + } else if ( /\b\d+(\.\d+)+ safari/i.test( userAgent ) ) { + expected = expectedMap.safari; } QUnit.test( "Verify that support tests resolve as expected per browser", function( assert ) { |