Skip to content

Commit fb4c098

Browse files
committed
Internal class WebClientInternals removed
1 parent f4dd896 commit fb4c098

File tree

6 files changed

+4
-146
lines changed

6 files changed

+4
-146
lines changed

src/changes/changes.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
Deprecated http status code constants removed from WebResponse.
2828
</action>
2929

30+
<action type="remove" dev="rbri">
31+
Internal class WebClientInternals removed.
32+
</action>
3033
<action type="add" dev="rbri">
3134
First simple version of HtmlElement innerText setter implemented.
3235
</action>

src/main/java/org/htmlunit/WebClient.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ public class WebClient implements Serializable, AutoCloseable {
218218

219219
private final WebClientOptions options_ = new WebClientOptions();
220220
private final boolean javaScriptEngineEnabled_;
221-
private final WebClientInternals internals_ = new WebClientInternals();
222221
private final StorageHolder storageHolder_ = new StorageHolder();
223222

224223
/**
@@ -2727,16 +2726,6 @@ public WebClientOptions getOptions() {
27272726
return options_;
27282727
}
27292728

2730-
/**
2731-
* <span style="color:red">INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.</span><br>
2732-
*
2733-
* Returns the internals object of this WebClient.
2734-
* @return the internals object
2735-
*/
2736-
public WebClientInternals getInternals() {
2737-
return internals_;
2738-
}
2739-
27402729
/**
27412730
* Gets the holder for the different storages.
27422731
* <p><span style="color:red">Experimental API: May be changed in next release!</span></p>

src/main/java/org/htmlunit/WebClientInternals.java

Lines changed: 0 additions & 91 deletions
This file was deleted.

src/main/java/org/htmlunit/javascript/host/WebSocket.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,6 @@ public void onWebSocketError(final Throwable cause) {
191191
containingPage_.addAutoCloseable(this);
192192
url_ = new URI(url);
193193

194-
webClient.getInternals().created(this);
195-
196194
webSocketImpl_.connect(url_);
197195
}
198196
catch (final Exception e) {

src/test/java/org/htmlunit/general/ElementPropertiesTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7147,7 +7147,7 @@ public void nodeListButtonLabels() throws Exception {
71477147
+ "container,container-name,container-type,containerName,containerType,"
71487148
+ "containIntrinsicBlockSize,containIntrinsicHeight,"
71497149
+ "containIntrinsicInlineSize,containIntrinsicSize,containIntrinsicWidth,"
7150-
+ "content,counter-increment,counter-reset,counter-set,"
7150+
+ "content,content-visibility,contentVisibility,counter-increment,counter-reset,counter-set,"
71517151
+ "counterIncrement,counterReset,counterSet,cssFloat,cssText,cursor,cx,cy,d,direction,display,"
71527152
+ "dominant-baseline,dominantBaseline,empty-cells,emptyCells,fill,fill-opacity,fill-rule,"
71537153
+ "fillOpacity,fillRule,filter,flex,flex-basis,flex-direction,flex-flow,flex-grow,flex-shrink,"

src/test/java/org/htmlunit/javascript/host/WebSocketTest.java

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
import org.eclipse.jetty.websocket.servlet.WebSocketCreator;
3232
import org.eclipse.jetty.websocket.servlet.WebSocketServletFactory;
3333
import org.htmlunit.HttpHeader;
34-
import org.htmlunit.WebClient;
35-
import org.htmlunit.WebClientInternals;
3634
import org.htmlunit.WebDriverTestCase;
3735
import org.htmlunit.junit.BrowserRunner;
3836
import org.htmlunit.junit.BrowserRunner.Alerts;
@@ -43,7 +41,6 @@
4341
import org.openqa.selenium.By;
4442
import org.openqa.selenium.WebDriver;
4543
import org.openqa.selenium.WebElement;
46-
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
4744

4845
/**
4946
* Tests for {@link WebSocket}.
@@ -623,44 +620,6 @@ public void onWebSocketBinary(final byte[] payload, final int offset, final int
623620
}
624621
}
625622

626-
/**
627-
* @throws Exception if the test fails
628-
*/
629-
@Test
630-
public void listener() throws Exception {
631-
startWebServer("src/test/resources/org/htmlunit/javascript/host",
632-
null, null, new EventsWebSocketHandler());
633-
try {
634-
final WebDriver driver = getWebDriver();
635-
final int[] webSocketCreated = {0};
636-
637-
if (driver instanceof HtmlUnitDriver) {
638-
final WebClient webClient = getWebClient();
639-
final WebClientInternals internals = webClient.getInternals();
640-
641-
internals.addListener(new WebClientInternals.Listener() {
642-
@Override
643-
public void webSocketCreated(final WebSocket webSocket) {
644-
webSocketCreated[0]++;
645-
}
646-
});
647-
}
648-
649-
driver.get(URL_FIRST + "WebSocketTest_listener.html");
650-
651-
if (driver instanceof HtmlUnitDriver) {
652-
final long maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME;
653-
while (webSocketCreated[0] < 0 && System.currentTimeMillis() < maxWait) {
654-
Thread.sleep(30);
655-
}
656-
assertEquals(1, webSocketCreated[0]);
657-
}
658-
}
659-
finally {
660-
stopWebServers();
661-
}
662-
}
663-
664623
/**
665624
* @throws Exception if the test fails
666625
*/

0 commit comments

Comments
 (0)