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

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



  }

  public void testUnique() {
    SelectorEngineImpl selSizz = new SelectorEngineSizzle();
    GQuery g = $(e).html("<div><p></p><p></p><span></span><p></p>");
    JsNodeArray a;
    a = selSizz.select("p", e).cast();
    assertEquals(3, a.getLength());
    a.addNode(a.getNode(0));
    a.addNode(a.getNode(3));
    assertEquals(5, a.getLength());
    a = g.unique(a);
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

  }

  public void testSelectorEngineDomAssistant() {
    if (!runSlow) return;
    // This test runs very slow in chrome
    SelectorEngineImpl selEng = new SelectorEngineJS();
    executeSelectorEngineTests(selEng);
  }
View Full Code Here

    SelectorEngineImpl selEng = new SelectorEngineJS();
    executeSelectorEngineTests(selEng);
  }

  public void testSelectorEngineNative() {
    SelectorEngineImpl selEng = new SelectorEngineNative();
    if (hasNativeSelector()) {
      executeSelectorEngineTests(selEng);
    }
  }
View Full Code Here

      executeSelectorEngineTests(selEng);
    }
  }

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

    executeSelectorEngineTests(selEng);
  }

  public void testSelectorEngineSizzleGwt() {
    if (!runSlow) return;
    SelectorEngineImpl selEng = new SelectorEngineSizzleGwt();
    executeSelectorEngineTests(selEng);
  }
View Full Code Here

    SelectorEngineImpl selEng = new SelectorEngineSizzleGwt();
    executeSelectorEngineTests(selEng);
  }

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

    assertEquals(1, selectors.target().length());
    assertEquals("branchB target", selectors.target().text());
  }

  public void testUnique() {
    SelectorEngineImpl selSizz = new SelectorEngineSizzleGwt();
    $(e).html(getTestContent());

    JsArray<Element> a;
    a = selSizz.select("p", e).cast();
    int n = a.length();
    assertTrue(n > 300);
    for (int i=0; i<n; i++) {
      a.push(a.get(i));
    }
View Full Code Here

    message = message + ", value (" + result + ") not found in: " + values;
    assertTrue(message, done);
  }

  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.SelectorEngineImpl

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.