When different tests run a similar userAgent string but with
a different platform, it returns an inappropiate cache object
e.g.
userAgent: Firefox
platform: Linux x86_64
-> { platform: 'linux' }
userAgent: Firefox
platform: MacIntel
-> { platform: 'linux' }
(instead of platform: 'mac' )
Change-Id: Iaf2a5711ace82cbd2b68486e9680c7a6bcb7f9da
if ( nav === undefined ) {
nav = window.navigator;
}
+
// Use the cached version if possible
- if ( profileCache[nav.userAgent] === undefined ) {
+ if ( profileCache[ nav.userAgent + '|' + nav.platform ] === undefined ) {
var
versionNumber,
/* Caching */
- profileCache[nav.userAgent] = {
+ profileCache[ nav.userAgent + '|' + nav.platform ] = {
name: name,
layout: layout,
layoutVersion: layoutversion,
versionNumber: versionNumber
};
}
- return profileCache[nav.userAgent];
+ return profileCache[ nav.userAgent + '|' + nav.platform ];
},
/**