Add Nexus 5 to device list

User agent string taken from Chrome (Beta) Desktop's user-agent override in its
developer tools. Added to test plan.
This commit is contained in:
Douglas Li 2013-12-04 17:10:26 -08:00
parent 3901fbe532
commit 7c1397cdcc
3 changed files with 15 additions and 4 deletions

View File

@ -207,7 +207,7 @@
/(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, // Opera Mobi/Tablet /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, // Opera Mobi/Tablet
/(opera).+version\/((\d+)?[\w\.]+)/i, // Opera > 9.80 /(opera).+version\/((\d+)?[\w\.]+)/i, // Opera > 9.80
/(opera)[\/\s]+((\d+)?[\w\.]+)/i // Opera < 9.80 /(opera)[\/\s]+((\d+)?[\w\.]+)/i // Opera < 9.80
], [NAME, VERSION, MAJOR], [ ], [NAME, VERSION, MAJOR], [
/\s(opr)\/((\d+)?[\w\.]+)/i // Opera Webkit /\s(opr)\/((\d+)?[\w\.]+)/i // Opera Webkit
@ -374,6 +374,7 @@
/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i // LG /android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i // LG
], [[VENDOR, 'LG'], MODEL, [TYPE, TABLET]], [ ], [[VENDOR, 'LG'], MODEL, [TYPE, TABLET]], [
/((nexus\s4))/i, /((nexus\s4))/i,
/((nexus\s5))/i,
/(lg)[e;\s-\/]+(\w+)*/i /(lg)[e;\s-\/]+(\w+)*/i
], [[VENDOR, 'LG'], MODEL, [TYPE, MOBILE]], [ ], [[VENDOR, 'LG'], MODEL, [TYPE, MOBILE]], [
@ -508,7 +509,7 @@
////////// //////////
// check js environment // check js environment
if (typeof(exports) !== UNDEF_TYPE) { if (typeof(exports) !== UNDEF_TYPE) {
// nodejs env // nodejs env
if (typeof(module) !== UNDEF_TYPE && module.exports) { if (typeof(module) !== UNDEF_TYPE && module.exports) {
@ -517,7 +518,7 @@
exports.UAParser = UAParser; exports.UAParser = UAParser;
} else { } else {
// browser env // browser env
window.UAParser = UAParser; window.UAParser = UAParser;
// requirejs env (optional) // requirejs env (optional)
if (typeof(define) === FUNC_TYPE && define.amd) { if (typeof(define) === FUNC_TYPE && define.amd) {
define(function () { define(function () {

File diff suppressed because one or more lines are too long

View File

@ -19,6 +19,16 @@
"type" : "mobile" "type" : "mobile"
} }
}, },
{
"desc" : "LG Nexus 5",
"ua" : "Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 5 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19",
"expect" :
{
"vendor" : "LG",
"model" : "Nexus 5",
"type" : "mobile"
}
},
{ {
"desc" : "Motorola Droid RAZR 4G", "desc" : "Motorola Droid RAZR 4G",
"ua" : "Mozilla/5.0 (Linux; U; Android 2.3; xx-xx; DROID RAZR 4G Build/6.5.1-73_DHD-11_M1-29) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1", "ua" : "Mozilla/5.0 (Linux; U; Android 2.3; xx-xx; DROID RAZR 4G Build/6.5.1-73_DHD-11_M1-29) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",