Skip to content

Commit

Permalink
add dataurl test
Browse files Browse the repository at this point in the history
  • Loading branch information
rbri committed Sep 18, 2021
1 parent 55da16a commit 7a30c42
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/test/java/com/gargoylesoftware/htmlunit/WebClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1850,6 +1850,19 @@ public void cssEnablementControlsCssLoading() throws Exception {
assertEquals(new String[]{"1"}, actual);
}

/**
* @throws Exception if test fails
*/
@Test
public void getPageDataProtocol() throws Exception {
final WebClient webClient = getWebClient();

final String html = "<html><body>DataUrl Test</body></html>";

final Page page = webClient.getPage("data:text/html;charset=utf-8," + html);
assertEquals("DataUrl Test", ((HtmlPage) page).asNormalizedText());
}

/**
* @throws Exception if test fails
*/
Expand Down

0 comments on commit 7a30c42

Please sign in to comment.