Package com.google.gwt.query.client.impl

Examples of com.google.gwt.query.client.impl.SelectorEngineCssToXPath


    label.removeFromParent();
  }

  public void testXpathSelector() {
    $(e).html("<table border=1 id=idtest width=440><tr><td width=50%>A Text</td><td width=50%>B</td></tr></table>");
    SelectorEngineCssToXPath s = new SelectorEngineCssToXPath();
    for (String selector : Arrays.asList("td[width]", "table > tr > td", "*[width!='440']")) {
      String xselector = s.css2Xpath(selector);
      assertEquals($(selector).size(), $(xselector).size());
    }
  }
View Full Code Here


    // TODO: in XPath engine returns 2 when it should return 1
    executeSelectInAllImplementations("*", q.get(0), 1, 2);
  }

  public void testSelectorEngineCssToXpath() {
    SelectorEngineImpl selEng = new SelectorEngineCssToXPath();
    executeSelectorEngineTests(selEng);
  }
View Full Code Here

  private void executeSelectInAllImplementations(String selector, Element elem, Object... array) {
    SelectorEngineImpl selSizz = new SelectorEngineSizzle();
    SelectorEngineImpl selSizzGwt = new SelectorEngineSizzleGwt();
    SelectorEngineImpl selJS = new SelectorEngineJS();
    SelectorEngineImpl selXpath = new SelectorEngineXPath();
    SelectorEngineImpl selC2X = new SelectorEngineCssToXPath();
    SelectorEngineImpl selNative = new SelectorEngineNative();
    // FIXME: this fails when running in iframe since 2.5.0
//    assertArrayContains(selector + " - (selSizz)", selSizz.select(selector, elem).getLength(), array);
//    assertArrayContains(selector + " - (selSizzGwt) ", selSizzGwt.select(selector, elem).getLength(), array);
    assertArrayContains(selector + " - (selJS)", selJS.select(selector, elem).getLength(), array);
    if (hasNativeSelector()) {
      assertArrayContains(selector + " - (selNative)", selNative.select(selector, elem).getLength(), array);
    }
    assertArrayContains(selector + " - (selXpath)", selXpath.select(selector, elem).getLength(), array);
    assertArrayContains(selector + " - (selC2X)", selC2X.select(selector, elem).getLength(), array);
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.query.client.impl.SelectorEngineCssToXPath

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.