public class ChartPanelTest extends ChronoscopeTestCaseBase {
public void testGssContextOverride() {
ChartPanel cp = Chronoscope
.createTimeseriesChart(Fixtures.getTestDataset(), 600, 400);
final Color color = new Color("#ff0000");
cp.setGssContext(new IEGssContext() {
public GssProperties getProperties(GssElement gssElem, String pseudoElt) {
if ("axes".equals(gssElem.getType())) {
return new GssProperties() {
{
this.bgColor = color;
}
};
}
return super.getProperties(gssElem, pseudoElt);
}
});
cp.setReadyListener(new ViewReadyCallback() {
public void onViewReady(View view) {
GssProperties props = view
.getGssProperties(new GssElementImpl("axes", null), "");
assertEquals(color.toString(), "#ff0000");
finishTest();
}
});
delayTestFinish(15000);
RootPanel.get().add(cp);