< prev index next >
modules/web/src/test/java/test/javafx/scene/web/MiscellaneousTest.java
Print this page
*** 33,42 ****
--- 33,45 ----
import java.util.concurrent.Callable;
import javafx.application.Platform;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.concurrent.Worker.State;
+ import javafx.scene.canvas.Canvas;
+ import javafx.scene.canvas.GraphicsContext;
+ import javafx.scene.paint.LinearGradient;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
*** 142,150 ****
--- 145,169 ----
// Try accessing the resultObject created in JavaFX Application Thread
// from someother thread. It should throw an exception.
obj.resultObject.toString();
}
+ // JDK-8155903
+ @Test public void testGCfillWithLinearGradient() {
+ submit(()->{
+ Canvas canvas = new Canvas(100, 100);
+ GraphicsContext gc = canvas.getGraphicsContext2D();
+ LinearGradient lg = LinearGradient.valueOf(
+ "linear-gradient(white 0%, black 1%, red 1%, green 2%,"
+ + "yellow 3%, blue 4%, red 5%, red 6%, red 7%, red 8%, red 9%,"
+ + "red 10%, green 70%)");
+ gc.setFill(lg);
+ gc.fill();
+ // Force paint
+ assertNotNull(canvas.snapshot(null, null));
+ });
+ }
+
private WebEngine createWebEngine() {
return submit(() -> new WebEngine());
}
}
< prev index next >