/** * Returns {@code true} if this <tt>BrowserVersion</tt> instance represents some * version of Microsoft Edge. * @return whether or not this version is a version of an Edge browser */ public boolean isEdge() { return getNickname().startsWith("Edge"); }
/** * Returns {@code true} if this <tt>BrowserVersion</tt> instance represents some * version of Firefox. * @return whether or not this version is a version of a Firefox browser */ public boolean isFirefox() { return getNickname().startsWith("FF"); }
/** * Returns {@code true} if this <tt>BrowserVersion</tt> instance represents some * version of Internet Explorer. * @return whether or not this version is a version of IE */ public boolean isIE() { return getNickname().startsWith("IE"); }
/** * Returns {@code true} if this <tt>BrowserVersion</tt> instance represents some * version of Internet Explorer. * @return whether or not this version is a version of IE */ public boolean isIE() { return getNickname().startsWith("IE"); }
/** * Returns {@code true} if this <tt>BrowserVersion</tt> instance represents some * version of Google Chrome. Note that Google Chrome does not return 'Chrome' * in the application name, we have to look in the nickname. * @return whether or not this version is a version of a Chrome browser */ public boolean isChrome() { return getNickname().startsWith("Chrome"); }
/** * Returns {@code true} if this <tt>BrowserVersion</tt> instance represents some * version of Firefox. * @return whether or not this version is a version of a Firefox browser */ public boolean isFirefox() { return getNickname().startsWith("FF"); }
/** * Returns {@code true} if this <tt>BrowserVersion</tt> instance represents some * version of Google Chrome. Note that Google Chrome does not return 'Chrome' * in the application name, we have to look in the nickname. * @return whether or not this version is a version of a Chrome browser */ public boolean isChrome() { return getNickname().startsWith("Chrome"); }
/** * Returns {@code true} if this <tt>BrowserVersion</tt> instance represents some * version of Microsoft Edge. * @return whether or not this version is a version of an Edge browser */ public boolean isEdge() { return getNickname().startsWith("Edge"); }
private static void addBrowser(BrowserVersion browser, String userAgent) { BROWSER_MAP.put(browser.getNickname(), browser); USER_AGENT_MAP.put(browser, userAgent); }
private static void addBrowser(BrowserVersion browser, String userAgent) { BROWSER_MAP.put(browser.getNickname(), browser); USER_AGENT_MAP.put(browser, userAgent); }
/** * Returns the instance that represents the configuration for the specified {@link BrowserVersion}. * This method is synchronized to allow multi-threaded access to the JavaScript configuration. * @param browserVersion the {@link BrowserVersion} * @return the instance for the specified {@link BrowserVersion} */ public static synchronized JavaScriptConfiguration getInstance(final BrowserVersion browserVersion) { if (browserVersion == null) { throw new IllegalArgumentException("BrowserVersion must be provided"); } JavaScriptConfiguration configuration = CONFIGURATION_MAP_.get(browserVersion.getNickname()); if (configuration == null) { configuration = new JavaScriptConfiguration(browserVersion); CONFIGURATION_MAP_.put(browserVersion.getNickname(), configuration); } return configuration; }
/** * Returns the instance that represents the configuration for the specified {@link BrowserVersion}. * This method is synchronized to allow multi-threaded access to the JavaScript configuration. * @param browserVersion the {@link BrowserVersion} * @return the instance for the specified {@link BrowserVersion} */ public static synchronized MSXMLConfiguration getInstance(final BrowserVersion browserVersion) { if (browserVersion == null) { throw new IllegalStateException("BrowserVersion must be defined"); } MSXMLConfiguration configuration = CONFIGURATION_MAP_.get(browserVersion.getNickname()); if (configuration == null) { configuration = new MSXMLConfiguration(browserVersion); CONFIGURATION_MAP_.put(browserVersion.getNickname(), configuration); } return configuration; }
/** * Returns the instance that represents the configuration for the specified {@link BrowserVersion}. * This method is synchronized to allow multi-threaded access to the JavaScript configuration. * @param browserVersion the {@link BrowserVersion} * @return the instance for the specified {@link BrowserVersion} */ public static synchronized MSXMLConfiguration getInstance(final BrowserVersion browserVersion) { if (browserVersion == null) { throw new IllegalStateException("BrowserVersion must be defined"); } MSXMLConfiguration configuration = CONFIGURATION_MAP_.get(browserVersion.getNickname()); if (configuration == null) { configuration = new MSXMLConfiguration(browserVersion); CONFIGURATION_MAP_.put(browserVersion.getNickname(), configuration); } return configuration; }
/** * Returns the instance that represents the configuration for the specified {@link BrowserVersion}. * This method is synchronized to allow multi-threaded access to the JavaScript configuration. * @param browserVersion the {@link BrowserVersion} * @return the instance for the specified {@link BrowserVersion} */ public static synchronized JavaScriptConfiguration getInstance(final BrowserVersion browserVersion) { if (browserVersion == null) { throw new IllegalArgumentException("BrowserVersion must be provided"); } JavaScriptConfiguration configuration = CONFIGURATION_MAP_.get(browserVersion.getNickname()); if (configuration == null) { configuration = new JavaScriptConfiguration(browserVersion); CONFIGURATION_MAP_.put(browserVersion.getNickname(), configuration); } return configuration; }
static BrowserConfiguration getMatchingConfiguration( final BrowserVersion browserVersion, final BrowserConfiguration[] browserConfigurations) { for (final BrowserConfiguration browserConfiguration : browserConfigurations) { if (browserVersion.getNickname().startsWith(browserConfiguration.browserFamily_) && browserVersion.getBrowserVersionNumeric() >= browserConfiguration.minVersionNumber_ && browserVersion.getBrowserVersionNumeric() <= browserConfiguration.maxVersionNumber_) { return browserConfiguration; } } return null; }
static BrowserConfiguration getMatchingConfiguration( final BrowserVersion browserVersion, final BrowserConfiguration[] browserConfigurations) { for (final BrowserConfiguration browserConfiguration : browserConfigurations) { if (browserVersion.getNickname().startsWith(browserConfiguration.browserFamily_) && browserVersion.getBrowserVersionNumeric() >= browserConfiguration.minVersionNumber_ && browserVersion.getBrowserVersionNumeric() <= browserConfiguration.maxVersionNumber_) { return browserConfiguration; } } return null; }
@Override public void launchModule(String moduleName) { for (BrowserVersion browser : browsers) { String url = shell.getModuleUrl(moduleName); HtmlUnitThread hut = createHtmlUnitThread(browser, url); TreeLogger logger = shell.getTopLogger(); if (logger.isLoggable(TreeLogger.INFO)) { logger.log(TreeLogger.INFO, "Starting " + url + " on browser " + browser.getNickname()); } /* * TODO (amitmanjhi): Is it worth pausing here and waiting for the main * test thread to get to an "okay" state. */ hut.start(); threads.add(hut); } }
@Override public void launchModule(String moduleName) { for (BrowserVersion browser : browsers) { String url = shell.getModuleUrl(moduleName); HtmlUnitThread hut = createHtmlUnitThread(browser, url); TreeLogger logger = shell.getTopLogger(); if (logger.isLoggable(TreeLogger.INFO)) { logger.log(TreeLogger.INFO, "Starting " + url + " on browser " + browser.getNickname()); } /* * TODO (amitmanjhi): Is it worth pausing here and waiting for the main * test thread to get to an "okay" state. */ hut.start(); threads.add(hut); } }
workPiece_ = new BrowserVersion(version.getBrowserVersionNumeric(), version.getNickname());
workPiece_ = new BrowserVersion(version.getBrowserVersionNumeric(), version.getNickname());