Package org.uiautomation.ios.wkrdp.message

Examples of org.uiautomation.ios.wkrdp.message.WebkitPage


                    "new SafariPageNavigator().enter().goToWebView(" + delta + ");");
                break;
              case "7":
                List<WebkitPage> pages = getWebDriver().getPages();

                WebkitPage desired = null;
                for (WebkitPage page : pages) {
                  if (pageId.equals(String.format("%d", page.getPageId()))) {
                    desired = page;
                    break;
                  }
                }
                if (desired == null) {
                  throw new WebDriverException("unknown pageId:" + pageId);
                }
                String title = desired.getTitle();
                By locator = By.xpath("//UIAStaticText[@name='" + title + "']");
                getNativeDriver().executeScript(
                    "new SafariPageNavigator().enter();");

                WebElement element = getNativeDriver().findElement(locator);
View Full Code Here


          if (m.getPages().size() == 0) {
            throw new WebDriverException(m.getPages().size() + " new pages.");
          }

          // TODO there can be more than one 'new' UIWebView, picking the max one for now.
          WebkitPage newOne = Collections.max(m.getPages());
          pages.addAll(m.getPages());

          driver.setPages(pages);

          if (driver.getPages().size() == 0) {
            //log.fine("first page. Nothing to do.");
          } else if (newOne.isITunesAd()) {
            //log.fine("itunes ad - ignoring it.");
          } else {
            WebkitPage focus = newOne;

            if (session != null) {
              waitForWindowSwitchingAnimation();
              driver.switchTo(focus);
            } else {
              driver.switchTo(focus);
            }
          }
          // a page disappeared, the driver needs to know.
        } else if (change < 0) {
          List<WebkitPage> old = new ArrayList<WebkitPage>();
          old.addAll(driver.getPages());

          for (WebkitPage p : m.getPages()) {
            old.remove(p);
          }

          // TODO freynaud problem here.How to handle a window disappearing without loosing the state
          // of the currently selected page. driver.getPages() may need to become mutable again.
          // in the normal case, this is the page with the focus that is closed, so loosing the state
          // is ok. But for the extra window automatically closed ( ie the "there is an app for that
          // page, downlaod it on itune" page header, the header disappears when driver.get navigates
          // to a new page. The header disapeearing shouldn't impact the current state.
          for (WebkitPage p : old) {
            log.fine(
                "the page " + p + " has been deleted and must be removed from the driver cache");
            int currentFocus = driver.getCurrentPageID();
            if (p.getPageId() == currentFocus) {
              log.fine("the page deleted is the one with the focus.");
            } else {
              driver.setPages(m.getPages());
            }
          }
        }

        sync.signalSimSentPages();
      } else {
        driver.setPages(messagePages);
        if (messagePages.size() > 0) {
          if (session != null) {
            waitForWindowSwitchingAnimation();
          }
          WebkitPage focus = selectPage(driver.getPages());
          if (focus != null) {
            driver.switchTo(focus);
          }
        }
        sync.signalSimSentPages();
View Full Code Here

TOP

Related Classes of org.uiautomation.ios.wkrdp.message.WebkitPage

Copyright © 2018 www.massapicom. 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.