Examples of PluginMeta


Examples of com.google.caja.plugin.PluginMeta

  private boolean rewriteScriptEl(Node root, EmbeddedContent c) {
    Element scriptEl = (Element) c.getSource();
    Node parent = scriptEl.getParentNode();

    PluginMeta pm = jobs.getPluginMeta();
    UriFetcher fetcher = pm.getUriFetcher();

    // Try looking for the script in the precajole map
    PrecajoleMap precajoled = jobs.getPluginMeta().getPrecajoleMap();
    if (precajoled != null) {
      String sourceText = c.getContent(fetcher).toString();
      boolean minify = pm.getPrecajoleMinify();
      CajoledModule m = precajoled.lookupSource(sourceText, minify);
      if (m != null) {
        Element placeholder = placeholderFor(scriptEl, m);
        if (c.isDeferred()) {
          parent.removeChild(scriptEl);
View Full Code Here

Examples of com.google.caja.plugin.PluginMeta

  private PluginMeta meta;

  @Override
  public void setUp() throws Exception {
    super.setUp();
    meta = new PluginMeta(UriFetcher.NULL_NETWORK, UriPolicy.IDENTITY);
  }
View Full Code Here

Examples of com.google.caja.plugin.PluginMeta

        js(fromResource("template-compiler-golden1-dynamic.js")));
  }

  public final void testSafeHtmlWithNullUriPolicy() throws Exception {
    // Null URI policy also implies dynamic module ID
    meta = new PluginMeta(UriFetcher.NULL_NETWORK, null);
    assertSafeHtml(
        htmlFragment(fromResource("template-compiler-input1.html", is)),
        htmlFragment(fromResource("template-compiler-golden1-nulluripol.html")),
        js(fromResource("template-compiler-golden1-nulluripol.js")));
  }
View Full Code Here

Examples of com.google.caja.plugin.PluginMeta

    // Ensure that the TemplateCompiler calls its PluginEnvironment with the
    // correct information when it encounters a URI-valued HTML attribute.

    final Holder<ExternalReference> savedRef = new Holder<ExternalReference>();

    meta = new PluginMeta(
        UriFetcher.NULL_NETWORK,
        new UriPolicy() {
          public String rewriteUri(
              ExternalReference u, UriEffect effect, LoaderType loader,
              Map<String, ?> hints) {
View Full Code Here

Examples of com.google.caja.plugin.PluginMeta

          LoaderType loader,
          Map<String, ?> hints) {
        return "" + u.getUri() + "/URIPOLICY";
      }
    };
    meta = new PluginMeta(
        meta.getUriFetcher(),
        policy,
        meta.getPrecajoleMap(),
        meta.getPrecajoleMinify());
    assertSafeHtml(
View Full Code Here

Examples of com.google.caja.plugin.PluginMeta

            + "</div>")),
        new Block(), true);
  }

  public final void testStyleAttrsWithoutUriPolicy() throws Exception {
    meta = new PluginMeta(
        meta.getUriFetcher(),
        null,
        meta.getPrecajoleMap(),
        meta.getPrecajoleMinify());
    assertSafeHtml(
View Full Code Here

Examples of com.google.caja.plugin.PluginMeta

  protected PluginMeta meta;
  protected JobCache cache = new StubJobCache();
  private TestUriFetcher uriFetcher;

  protected PluginMeta createPluginMeta() {
    return new PluginMeta(uriFetcher, new TestUriPolicy());
  }
View Full Code Here

Examples of com.google.caja.plugin.PluginMeta

        new Executor.Input("(new Date() - benchmark.startTime)", "elapsed"));
    return elapsed.doubleValue();
  }

  private double runCajoledES53(String filename) throws Exception {
    PluginMeta meta = new PluginMeta();
    MessageQueue mq = new SimpleMessageQueue();
    PluginCompiler pc = new PluginCompiler(new TestBuildInfo(), meta, mq);
    CharProducer src = fromString(plain(fromResource(filename)));
    pc.addInput(js(src), is.getUri());
View Full Code Here

Examples of com.google.caja.plugin.PluginMeta

    return stream.toByteArray();
  }

  public CajoledModule es53(Block plain) {
    CajoledModule result = null;
    PluginMeta meta = new PluginMeta();
    MessageQueue mq = TestUtil.createTestMessageQueue(this.mc);
    PluginCompiler pc = new PluginCompiler(
        TestBuildInfo.getInstance(), meta, mq);
    pc.addInput(plain, null);
    if (pc.run()) {
View Full Code Here

Examples of com.google.caja.plugin.PluginMeta

    Node outputHtml;

    Map<InputSource, ? extends CharSequence> originalSources
        = Collections.singletonMap(new InputSource(guessURI(base, url)), input);

    PluginMeta meta = new PluginMeta(fetcher, null);
    if (opt_idClass != null && opt_idClass.length() != 0) {
      meta.setIdClass(opt_idClass);
    }
    PluginCompiler compiler = makePluginCompiler(meta, mq);
    compiler.setJobCache(new AppEngineJobCache());
    compiler.setMessageContext(mc);
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.