Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
alonhar committed Oct 21, 2024
1 parent 76c4736 commit fe1282a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/test/java/org/htmlunit/SimpleWebTestCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ public final HtmlPage loadPage(final String html) throws Exception {
return loadPage(html, null);
}

public final HtmlPage loadPageOnlyParse(final String html) throws Exception {
return loadPage(html, null);
}

/**
* User the default browser version to load a page with the specified HTML
* and collect alerts into the list.
Expand Down
14 changes: 11 additions & 3 deletions src/test/java/org/htmlunit/benchmarks/HtmlUnitBenchmark.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.htmlunit.BrowserVersion;
import org.htmlunit.SimpleWebTestCase;
import org.htmlunit.WebClient;
import org.htmlunit.html.HtmlPage;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
Expand Down Expand Up @@ -759,16 +760,23 @@ Bachelor of Arts in International Studies (BAIS)
""";

@Benchmark
@Fork(2)
@Fork(1)
@Warmup(iterations = 3)
@Timeout(time = 1000)
@Measurement(iterations = 4)
@BenchmarkMode(Mode.All)
public void JMH() throws Exception {

Check failure on line 769 in src/test/java/org/htmlunit/benchmarks/HtmlUnitBenchmark.java

View workflow job for this annotation

GitHub Actions / build (21)

[CodeStyleTest::codeStyle] reported by reviewdog 🐶 Empty line Raw Output: src/test/java/org/htmlunit/benchmarks/HtmlUnitBenchmark.java, line 769: Empty line
setBrowserVersion(BrowserVersion.CHROME);

HtmlPage pageFromString = loadPage(html);
WebClient webClient = new WebClient(BrowserVersion.getDefault(), false, null, -1);
webClient.getOptions().setJavaScriptEnabled(false);
webClient.getOptions().setThrowExceptionOnFailingStatusCode(false);
webClient.getOptions().setCssEnabled(false);
webClient.getOptions().setHistoryPageCacheLimit(0);
webClient.getOptions().setHistorySizeLimit(0);
webClient.getOptions().setWebSocketEnabled(false);
webClient.setFrameContentHandler(baseFrameElement -> false);
HtmlPage pageFromString = loadPage(webClient, html, null, URL_FIRST);

assert !pageFromString.querySelector("h1").asNormalizedText().contains("Stella");
}
Expand Down

0 comments on commit fe1282a

Please sign in to comment.