Skip to content

Commit

Permalink
added unit test for 8191758
Browse files Browse the repository at this point in the history
  • Loading branch information
bhawesh authored and bhawesh committed Apr 21, 2020
1 parent d3d3e71 commit 43c7cbf
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
package test.javafx.scene.web;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;

import java.io.File;
import java.util.concurrent.FutureTask;
Expand Down Expand Up @@ -89,4 +90,28 @@ private void setZoom(final WebView view, final float zoom) throws Exception {
view.setZoom(zoom);
});
}

/**
* @test
* @bug 8191758
* To make sure extra-heavy weights of the system font can be achieved
*/
@Test public void testFontWeights() {
loadContent(
"<!DOCTYPE html><html><head></head>" +
"<body>" +
" <div style=\"font: 19px system-ui\">" +
" <div style=\"font-style: italic;\">" +
" <span id=\"six\" style=\"font-weight: 600;\">Hello, World</span>" +
" <span id=\"nine\" style=\"font-weight: 900;\">Hello, World</span>" +
" </div>" +
" </div>" +
"</body> </html>"
);
submit(()->{
assertFalse("Font weight test failed ",
(Boolean) getEngine().executeScript(
"document.getElementById('six').offsetWidth == document.getElementById('nine').offsetWidth"));
});
}
}

0 comments on commit 43c7cbf

Please sign in to comment.