gadget.addFeature("opensocial-data-context"); gadget.removeFeature("opensocial-data");
gadget.addFeature("opensocial-data-context"); gadget.removeFeature("opensocial-data");
gadget.addFeature("opensocial-data-context"); gadget.removeFeature("opensocial-data");
@Test public void featuresInjectedWhenAdded() throws Exception { String gadgetXml = "<Module><ModulePrefs title=''>" + "</ModulePrefs>" + "<Content type='html'/>" + "</Module>"; Gadget gadget = makeGadgetWithSpec(gadgetXml); gadget.addFeature("foo"); // add non existing feature, gadget.addFeature("do-not-exists"); expectFeatureCalls(gadget, ImmutableList.of(inline("foo_content();", "foo_content_dbg();")), ImmutableSet.<String>of(), ImmutableList.<FeatureResource>of()); String rewritten = rewrite(gadget, ""); assertTrue("Added script not inlined.", rewritten.contains("foo_content();")); }
@Test public void featuresInjectedWhenAdded() throws Exception { String gadgetXml = "<Module><ModulePrefs title=''>" + "</ModulePrefs>" + "<Content type='html'/>" + "</Module>"; Gadget gadget = makeGadgetWithSpec(gadgetXml); gadget.addFeature("foo"); // add non existing feature, gadget.addFeature("do-not-exists"); expectFeatureCalls(gadget, ImmutableList.of(inline("foo_content();", "foo_content_dbg();")), ImmutableSet.<String>of(), ImmutableList.<FeatureResource>of()); String rewritten = rewrite(gadget, ""); assertTrue("Added script not inlined.", rewritten.contains("foo_content();")); }
@Test public void featuresInjectedWhenAdded() throws Exception { String gadgetXml = "<Module><ModulePrefs title=''>" + "</ModulePrefs>" + "<Content type='html'/>" + "</Module>"; Gadget gadget = makeGadgetWithSpec(gadgetXml); gadget.addFeature("foo"); // add non existing feature, gadget.addFeature("do-not-exists"); expectFeatureCalls(gadget, ImmutableList.of(inline("foo_content();", "foo_content_dbg();")), ImmutableSet.<String>of(), ImmutableList.<FeatureResource>of()); String rewritten = rewrite(gadget, ""); assertTrue("Added script not inlined.", rewritten.contains("foo_content();")); }
gadget.addFeature("caja-debug");
gadget.addFeature("caja-debug"); compiler.setGoals(compiler.getGoals() .without(PipelineMaker.ONE_CAJOLED_MODULE)