Package com.google.collide.client.util

Examples of com.google.collide.client.util.PathUtil


  }

  public void testPopupDoNotAnnoyUsers() {
    final MockAutocompleterEnvironment helper = new MockAutocompleterEnvironment();

    helper.setup(new PathUtil("foo.html"),
        "<html>\n <body>\n  <script>\n\n  </script>\n </body>\n</html>", 3, 0, true);
    ExplicitActionType action = helper.autocompleter.htmlAutocompleter.getExplicitAction(
        helper.editor.getSelection(), new SignalEventEssence(' '), false).getType();
    assertTrue("no popup before mode is determined", action == ExplicitActionType.DEFAULT);
View Full Code Here


  }

  public void testNoPopupAfterClosingTag() {
    final MockAutocompleterEnvironment helper = new MockAutocompleterEnvironment();

    helper.setup(new PathUtil("foo.html"), "<html>\n <script\n<body style=''>\n", 2, 8, true);

    helper.parser.getListenerRegistrar().add(new DocumentParserListenerAdapter(
        helper.autocompleter, helper.editor));
    helper.parser.begin();
    helper.parseScheduler.requests.pop().run(10);
View Full Code Here

   * content "inside-out".
   */
  public void testScriptTagDoNotConfuseXmlProcessing() {
    MockAutocompleterEnvironment helper = new MockAutocompleterEnvironment();

    helper.setup(new PathUtil("foo.html"),
        "<html>\n <script></script>\n <body>\n", 2, 7, true);

    helper.parser.getListenerRegistrar().add(new DocumentParserListenerAdapter(
        helper.autocompleter, helper.editor));
    helper.parser.begin();
View Full Code Here

   * when user press space just after "&gt;".
   */
  public void testNoJsPopupOnAfterSpace() {
    MockAutocompleterEnvironment helper = new MockAutocompleterEnvironment();

    helper.setup(new PathUtil("foo.html"),
        "<html>\n <script>\n", 1, 9, true);

    helper.parser.getListenerRegistrar().add(new DocumentParserListenerAdapter(
        helper.autocompleter, helper.editor));
    helper.parser.begin();
View Full Code Here

   * <p>Previously we got NPE in this case.
   */
  public void testNoProposalsOnGrayLine() {
    MockAutocompleterEnvironment helper = new MockAutocompleterEnvironment();

    helper.setup(new PathUtil("foo.html"),
        "<html>\n <body>\n  <di", 2, 5, true);

    helper.parser.getListenerRegistrar().add(new DocumentParserListenerAdapter(
        helper.autocompleter, helper.editor));
    helper.parser.begin();
View Full Code Here

    assertEquals("variable set", createStringSet("aaa", "bbb"), createNameSet(proposals));
  }

  private MockAutocompleterEnvironment configureHelper(String text) {
    final MockAutocompleterEnvironment helper = new MockAutocompleterEnvironment();
    helper.setup(new PathUtil("foo.js"), text, 0, 0, true);
    analyzer = new ParsingTask(helper.autocompleter.localPrefixIndexStorage);
    JsonArray<IncrementalScheduler.Task> parseRequests = helper.parseScheduler.requests;

    assertEquals("parsing not scheduled initially", 0, parseRequests.size());
View Full Code Here

  }

  public void testTemplate() {
    MockAutocompleterEnvironment helper = new MockAutocompleterEnvironment();

    helper.setup(new PathUtil("foo.js"), "WhI", 0, 3, true);
    AutocompleteProposals proposals = helper.autocompleter.jsAutocompleter.findAutocompletions(
        helper.editor.getSelection(), CTRL_SPACE);
    AutocompleteProposals.ProposalWithContext proposal = TestUtils.selectProposalByName(
        proposals, "while");
    assertNotNull(proposal);
View Full Code Here

    String text = "function foo() {\n"
        + "  var barBeQue;\n"
        + "  BArbE\n" // Cursor here.
        + "}";

    helper.setup(new PathUtil("foo.js"), text, 2, 7, true);
    helper.parser.begin();
    helper.parseScheduler.requests.get(0).run(10);
    AutocompleteProposals proposals = helper.autocompleter.jsAutocompleter.findAutocompletions(
        helper.editor.getSelection(), CTRL_SPACE);
    AutocompleteProposals.ProposalWithContext proposal = TestUtils.selectProposalByName(
View Full Code Here

  public void testCssProperty() {
    MockAutocompleterEnvironment helper = new MockAutocompleterEnvironment();

    String prefix = "td {bORDEr: black; ";
    helper.setup(new PathUtil("foo.css"), prefix + "boR", 0, prefix.length() + 3, true);
    AutocompleteProposals proposals = helper.autocompleter.cssAutocompleter.findAutocompletions(
        helper.editor.getSelection(), CTRL_SPACE);
    assertNull(TestUtils.selectProposalByName(proposals, "border"));

    AutocompleteProposals.ProposalWithContext proposal = TestUtils.selectProposalByName(
View Full Code Here

  public void testCssValue() {
    MockAutocompleterEnvironment helper = new MockAutocompleterEnvironment();

    String prefix = "td {color: ";
    helper.setup(new PathUtil("foo.css"), prefix + "BLA", 0, prefix.length() + 3, true);
    AutocompleteProposals proposals = helper.autocompleter.cssAutocompleter.findAutocompletions(
        helper.editor.getSelection(), CTRL_SPACE);
    AutocompleteProposals.ProposalWithContext proposal = TestUtils.selectProposalByName(
        proposals, "black");
    assertNotNull(proposal);
View Full Code Here

TOP

Related Classes of com.google.collide.client.util.PathUtil

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.