Examples of EmbeddedBrowser


Examples of com.crawljax.browser.EmbeddedBrowser

            .addPlugin(domChange).build(), new MetricRegistry());
  }

  @Test
  public void browserCreatedIsCalled() {
    EmbeddedBrowser newBrowser = mock(EmbeddedBrowser.class);
    plugins.runOnBrowserCreatedPlugins(newBrowser);
    verify(browserCreatedPlugin).onBrowserCreated(newBrowser);

    assertThat(counterFor(OnBrowserCreatedPlugin.class), is(1));
  }
View Full Code Here

Examples of com.crawljax.browser.EmbeddedBrowser

     */
    Thread shutdownThread = browserPool.close();

    // TODO Stefan; Now we "re-request" a browser instance for the PostCrawlingPlugins Thread,
    // this is not ideal...
    EmbeddedBrowser b = null;
    try {
      b = this.getBrowserPool().requestBrowser();
    } catch (InterruptedException e1) {
      LOGGER.warn("Re-Request for a browser was interrupted", e1);
    }
View Full Code Here

Examples of com.crawljax.browser.EmbeddedBrowser

            .addPlugin(domChange).build(), new MetricRegistry());
  }

  @Test
  public void browserCreatedIsCalled() {
    EmbeddedBrowser newBrowser = mock(EmbeddedBrowser.class);
    plugins.runOnBrowserCreatedPlugins(newBrowser);
    verify(browserCreatedPlugin).onBrowserCreated(newBrowser);

    assertThat(counterFor(OnBrowserCreatedPlugin.class), is(1));
  }
View Full Code Here

Examples of com.crawljax.browser.EmbeddedBrowser

   * Test get document from browser function.
   */
  @Test
  public void testGetDocumentFromBrowser() throws SAXException, IOException {
    // TODO Stefan; Refactor out the direct use of FirefoxDriver
    EmbeddedBrowser browser =
            WebDriverBackedEmbeddedBrowser.withDriver(new FirefoxDriver(),  ImmutableSortedSet.<String> of(), 200, 300);
    File index = new File(INDEX);
    String html = "";
    browser.goToUrl(new URL("file://" + index.getAbsolutePath()));
    html = browser.getStrippedDom();
    assertNotNull(html);

    Document doc = DomUtils.asDocument(html);
    assertNotNull(doc);

    browser.close();
    browser = null;

  }
View Full Code Here

Examples of com.crawljax.browser.EmbeddedBrowser

     */
    Thread shutdownThread = browserPool.close();

    // TODO Stefan; Now we "re-request" a browser instance for the PostCrawlingPlugins Thread,
    // this is not ideal...
    EmbeddedBrowser b = null;
    try {
      b = this.getBrowserPool().requestBrowser();
    } catch (InterruptedException e1) {
      LOGGER.warn("Re-Request for a browser was interrupted", e1);
    }
View Full Code Here

Examples of com.crawljax.browser.EmbeddedBrowser

     */
    Thread shutdownThread = browserPool.close();

    // TODO Stefan; Now we "re-request" a browser instance for the PostCrawlingPlugins Thread,
    // this is not ideal...
    EmbeddedBrowser b = null;
    try {
      b = this.getBrowserPool().requestBrowser();
    } catch (InterruptedException e1) {
      LOGGER.warn("Re-Request for a browser was interrupted", e1);
    }
View Full Code Here

Examples of com.github.couchapptakeout.ui.EmbeddedBrowser




    private void showEmbedded(String applicationUrl) {
        final EmbeddedBrowser browser = new EmbeddedBrowser();
        browser.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                int value = JOptionPane.showConfirmDialog(browser, "Are you sure you want to exit?", appName, JOptionPane.YES_NO_OPTION);
                if (value == JOptionPane.YES_OPTION) {
                    browser.dispose();
                    EventBus.publish(new ExitApplicationMessage() );
                }
            }
        });

        browser.setVisible(true);
        if (appIcon != null) browser.setIconImage(appIcon.getImage());
        browser.setTitle(appName);

        browser.setExtendedState(JFrame.MAXIMIZED_BOTH);
        try {
            // have some delay before showing? Maybe not init'ed
            Thread.sleep(400);
        } catch (InterruptedException ex) {
            Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex);
        }

        browser.setUrl(applicationUrl);
        browser.invalidate();
        browser.validate();
        browser.repaint();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.