function assertUserAgent(
    expectedAgents, uaString, product = undefined, vendor = undefined) {
  const mockNavigator = {
    'userAgent': uaString,
    'product': product,
    'vendor': vendor,
  };

  mockUserAgent.setNavigator(mockNavigator);
  mockUserAgent.setUserAgentString(uaString);

  userAgentTestUtil.reinitializeUserAgent();
  for (const ua in UserAgents) {
    const isExpected = googArray.contains(expectedAgents, UserAgents[ua]);
    assertEquals(
        isExpected, userAgentTestUtil.getUserAgentDetected(UserAgents[ua]));
  }
}
Test browser detection for a user agent configuration.
@param {Array<number>} expectedAgents Array of expected userAgents.
@param {string} uaString User agent string.
@param {string=} product Navigator product string.
@param {string=} vendor Navigator vendor string.