Skip to content

Commit a45dc0d

Browse files
committed
Chrome/Edge 134
1 parent a321268 commit a45dc0d

28 files changed

+270
-35
lines changed

src/changes/changes.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</properties>
88

99
<body>
10-
<release version="4.11.0" date="March xx, 2025" description="Firefox 136, less dependencies, Bugfixes">
10+
<release version="4.11.0" date="March xx, 2025" description="Chrome/Edge 134, Firefox 136, less dependencies, Bugfixes">
1111
<action type="remove" dev="rbri">
1212
Deprecated methods removed from EncodingSniffer, HttpClientConverter, WebResponse, and WebResponseWrapper.
1313
</action>

src/main/java/org/htmlunit/BrowserVersion.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ public final class BrowserVersion implements Serializable {
197197
CHROME.scriptAcceptHeader_ = "*/*";
198198

199199
if (CHROME.getBrowserVersionNumeric() % 2 == 0) {
200-
CHROME.secClientHintUserAgentHeader_ = "\"Not A(Brand\";v=\"8\", \"Chromium\";v=\""
201-
+ CHROME.getBrowserVersionNumeric() + "\", \"Google Chrome\";v=\""
200+
CHROME.secClientHintUserAgentHeader_ = "\"Chromium\";v=\""
201+
+ CHROME.getBrowserVersionNumeric() + "\", \"Not:A-Brand\";v=\"24\", \"Google Chrome\";v=\""
202202
+ CHROME.getBrowserVersionNumeric() + "\"";
203203
}
204204
else {
@@ -250,9 +250,9 @@ public final class BrowserVersion implements Serializable {
250250
EDGE.cssAcceptHeader_ = "text/css,*/*;q=0.1";
251251
EDGE.scriptAcceptHeader_ = "*/*";
252252
if (CHROME.getBrowserVersionNumeric() % 2 == 0) {
253-
EDGE.secClientHintUserAgentHeader_ = "\"Microsoft Edge\";v=\""
254-
+ EDGE.getBrowserVersionNumeric() + "\", \"Chromium\";v=\""
255-
+ EDGE.getBrowserVersionNumeric() + "\", \"Not_A Brand\";v=\"24\"";
253+
EDGE.secClientHintUserAgentHeader_ = "\"Chromium\";v=\""
254+
+ EDGE.getBrowserVersionNumeric() + "\", \"Not:A-Brand\";v=\"24\", \"Microsoft Edge\";v=\""
255+
+ EDGE.getBrowserVersionNumeric() + "\"";
256256
}
257257
else {
258258
EDGE.secClientHintUserAgentHeader_ = "\"Not(A:Brand\";v=\"99\", \"Microsoft Edge\";v=\""

src/test/java/org/htmlunit/HistoryTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,17 @@ public void post() throws Exception {
6363
driver.get(URL_FIRST + "post1");
6464

6565
driver.findElement(By.id("mySubmit")).click();
66+
if (useRealBrowser()) {
67+
Thread.sleep(400);
68+
}
6669
assertEquals(URL_FIRST + "post2", driver.getCurrentUrl());
6770
assertTrue(driver.getPageSource().contains("POST"));
6871
assertTrue(driver.getPageSource().contains("para1=value1"));
6972

7073
driver.findElement(By.linkText("Go to GET")).click();
74+
if (useRealBrowser()) {
75+
Thread.sleep(400);
76+
}
7177
assertEquals(URL_FIRST + "post3", driver.getCurrentUrl());
7278
assertTrue(driver.getPageSource().contains("GET"));
7379

src/test/java/org/htmlunit/NoHttpResponseTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ public void submit() throws Exception {
9494

9595
driver.get(URL_FIRST.toString());
9696
driver.findElement(By.id("inputSubmit")).click();
97+
if (useRealBrowser()) {
98+
Thread.sleep(400);
99+
}
97100
assertEquals(getExpectedAlerts()[0], driver.getCurrentUrl());
98101
}
99102
catch (final WebDriverException e) {

src/test/java/org/htmlunit/PageReloadTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,6 +1682,9 @@ private void openUrlAndClickById(
16821682

16831683
// click
16841684
driver.findElement(By.id(id)).click();
1685+
if (useRealBrowser()) {
1686+
Thread.sleep(400);
1687+
}
16851688
assertEquals(counterChange, getMockWebConnection().getRequestCount() - 1);
16861689

16871690
// check location visible to javascript

src/test/java/org/htmlunit/WebClient3Test.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,9 @@ public void windowOpenedByAnchorTargetIsAttachedToJavascriptEventLoop() throws E
215215

216216
final WebDriver driver = loadPage2(firstContent);
217217
driver.findElement(By.id("testAnchor")).click();
218+
if (useRealBrowser()) {
219+
Thread.sleep(400);
220+
}
218221

219222
verifyAlerts(driver, getExpectedAlerts());
220223
}
@@ -260,6 +263,9 @@ public void windowOpenedByFormTargetIsAttachedToJavascriptEventLoop() throws Exc
260263

261264
final WebDriver driver = loadPage2(firstContent);
262265
driver.findElement(By.id("testSubmit")).click();
266+
if (useRealBrowser()) {
267+
Thread.sleep(400);
268+
}
263269

264270
verifyAlerts(driver, getExpectedAlerts());
265271
}

src/test/java/org/htmlunit/WebClient6Test.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,9 @@ private void redirectGet(final int code, final HttpMethod httpMethod, final Stri
397397
expandExpectedAlertsVariables(URL_FIRST);
398398
final WebDriver driver = loadPage2(html);
399399
driver.findElement(By.tagName("a")).click();
400+
if (useRealBrowser()) {
401+
Thread.sleep(400);
402+
}
400403

401404
assertEquals(getExpectedAlerts()[0], getMockWebConnection().getLastWebRequest().getUrl().toString());
402405
assertEquals(reqCount + Integer.parseInt(getExpectedAlerts()[1]), getMockWebConnection().getRequestCount());
@@ -424,6 +427,9 @@ private void redirectPost(final int code, final HttpMethod httpMethod,
424427
expandExpectedAlertsVariables(URL_FIRST);
425428
final WebDriver driver = loadPage2(html);
426429
driver.findElement(By.id("postBtn")).click();
430+
if (useRealBrowser()) {
431+
Thread.sleep(400);
432+
}
427433

428434
assertEquals(reqCount + Integer.parseInt(getExpectedAlerts()[1]), getMockWebConnection().getRequestCount());
429435
assertEquals(httpMethod, getMockWebConnection().getLastWebRequest().getHttpMethod());

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4844,8 +4844,10 @@ public void details() throws Exception {
48444844
* @throws Exception if the test fails
48454845
*/
48464846
@Test
4847-
@Alerts(CHROME = "close(),constructor(),open[GSCE],returnValue[GSCE],show(),showModal()",
4848-
EDGE = "close(),constructor(),open[GSCE],returnValue[GSCE],show(),showModal()",
4847+
@Alerts(CHROME = "close(),closedBy[GSCE],constructor(),open[GSCE],requestClose(),returnValue[GSCE],show(),"
4848+
+ "showModal()",
4849+
EDGE = "close(),closedBy[GSCE],constructor(),open[GSCE],requestClose(),returnValue[GSCE],show(),"
4850+
+ "showModal()",
48494851
FF = "close(),constructor(),open[GSCE],returnValue[GSCE],show(),showModal()",
48504852
FF_ESR = "close(),constructor(),open[GSCE],returnValue[GSCE],show(),showModal()")
48514853
public void dialog() throws Exception {

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

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,25 +1043,25 @@ public void event() throws Exception {
10431043
+ "clearTimeout(),clientInformation,close(),closed,confirm(),cookieStore,createImageBitmap(),"
10441044
+ "credentialless,crossOriginIsolated,crypto,customElements,devicePixelRatio,dispatchEvent(),"
10451045
+ "document,documentPictureInPicture,event,external,fence,fetch(),find(),focus(),frameElement,"
1046-
+ "frames,getComputedStyle(),getScreenDetails(),getSelection(),history,indexedDB,innerHeight,"
1047-
+ "innerWidth,isSecureContext,launchQueue,length,localStorage,location,locationbar,log(),logEx(),"
1048-
+ "matchMedia(),menubar,moveBy(),moveTo(),name,navigation,navigator,onabort,onafterprint,"
1049-
+ "onanimationend,onanimationiteration,onanimationstart,onappinstalled,onauxclick,onbeforeinput,"
1050-
+ "onbeforeinstallprompt,onbeforematch,onbeforeprint,onbeforetoggle,onbeforeunload,onbeforexrselect,"
1051-
+ "onblur,oncancel,oncanplay,oncanplaythrough,onchange,onclick,onclose,"
1052-
+ "oncontentvisibilityautostatechange,oncontextlost,oncontextmenu,oncontextrestored,oncuechange,"
1053-
+ "ondblclick,ondevicemotion,ondeviceorientation,ondeviceorientationabsolute,ondrag,ondragend,"
1054-
+ "ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,onended,onerror,"
1055-
+ "onfocus,onformdata,ongotpointercapture,onhashchange,oninput,oninvalid,onkeydown,onkeypress,"
1056-
+ "onkeyup,onlanguagechange,onload(),onloadeddata,onloadedmetadata,onloadstart,onlostpointercapture,"
1057-
+ "onmessage,onmessageerror,onmousedown,onmouseenter,onmouseleave,onmousemove,onmouseout,"
1058-
+ "onmouseover,onmouseup,onmousewheel,onoffline,ononline,onpagehide,onpagereveal,onpageshow,"
1059-
+ "onpageswap,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,onpointerleave,"
1060-
+ "onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,onpopstate,onprogress,"
1061-
+ "onratechange,onrejectionhandled,onreset,onresize,onscroll,onscrollend,onscrollsnapchange,"
1062-
+ "onscrollsnapchanging,onsearch,onsecuritypolicyviolation,onseeked,onseeking,onselect,"
1063-
+ "onselectionchange,onselectstart,onslotchange,onstalled,onstorage,onsubmit,onsuspend,ontimeupdate,"
1064-
+ "ontoggle,ontransitioncancel,ontransitionend,ontransitionrun,ontransitionstart,"
1046+
+ "frames,getComputedStyle(),getDigitalGoodsService(),getScreenDetails(),getSelection(),history,"
1047+
+ "indexedDB,innerHeight,innerWidth,isSecureContext,launchQueue,length,localStorage,location,"
1048+
+ "locationbar,log(),logEx(),matchMedia(),menubar,moveBy(),moveTo(),name,navigation,navigator,"
1049+
+ "onabort,onafterprint,onanimationend,onanimationiteration,onanimationstart,onappinstalled,"
1050+
+ "onauxclick,onbeforeinput,onbeforeinstallprompt,onbeforematch,onbeforeprint,onbeforetoggle,"
1051+
+ "onbeforeunload,onbeforexrselect,onblur,oncancel,oncanplay,oncanplaythrough,onchange,onclick,"
1052+
+ "onclose,oncontentvisibilityautostatechange,oncontextlost,oncontextmenu,oncontextrestored,"
1053+
+ "oncuechange,ondblclick,ondevicemotion,ondeviceorientation,ondeviceorientationabsolute,ondrag,"
1054+
+ "ondragend,ondragenter,ondragleave,ondragover,ondragstart,ondrop,ondurationchange,onemptied,"
1055+
+ "onended,onerror,onfocus,onformdata,ongotpointercapture,onhashchange,oninput,oninvalid,onkeydown,"
1056+
+ "onkeypress,onkeyup,onlanguagechange,onload(),onloadeddata,onloadedmetadata,onloadstart,"
1057+
+ "onlostpointercapture,onmessage,onmessageerror,onmousedown,onmouseenter,onmouseleave,onmousemove,"
1058+
+ "onmouseout,onmouseover,onmouseup,onmousewheel,onoffline,ononline,onpagehide,onpagereveal,"
1059+
+ "onpageshow,onpageswap,onpause,onplay,onplaying,onpointercancel,onpointerdown,onpointerenter,"
1060+
+ "onpointerleave,onpointermove,onpointerout,onpointerover,onpointerrawupdate,onpointerup,"
1061+
+ "onpopstate,onprogress,onratechange,onrejectionhandled,onreset,onresize,onscroll,onscrollend,"
1062+
+ "onscrollsnapchange,onscrollsnapchanging,onsearch,onsecuritypolicyviolation,onseeked,onseeking,"
1063+
+ "onselect,onselectionchange,onselectstart,onslotchange,onstalled,onstorage,onsubmit,onsuspend,"
1064+
+ "ontimeupdate,ontoggle,ontransitioncancel,ontransitionend,ontransitionrun,ontransitionstart,"
10651065
+ "onunhandledrejection,onunload,onvolumechange,onwaiting,onwebkitanimationend,"
10661066
+ "onwebkitanimationiteration,onwebkitanimationstart,onwebkittransitionend,onwheel,open(),opener,"
10671067
+ "origin,originAgentCluster,outerHeight,outerWidth,pageXOffset,pageYOffset,parent,performance,"
@@ -1736,7 +1736,9 @@ public void details() throws Exception {
17361736
* @throws Exception if the test fails
17371737
*/
17381738
@Test
1739-
@Alerts("close(),open,returnValue,show(),showModal()")
1739+
@Alerts(DEFAULT = "close(),open,returnValue,show(),showModal()",
1740+
CHROME = "close(),closedBy,open,requestClose(),returnValue,show(),showModal()",
1741+
EDGE = "close(),closedBy,open,requestClose(),returnValue,show(),showModal()")
17401742
public void dialog() throws Exception {
17411743
test("dialog");
17421744
}

src/test/java/org/htmlunit/html/DomElementTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ public void sendEnterKeyWithHiddenSubmit() throws Exception {
153153

154154
final WebDriver driver = loadPage2(html);
155155
driver.findElement(By.id("myText")).sendKeys(Keys.ENTER);
156+
if (useRealBrowser()) {
157+
Thread.sleep(400);
158+
}
156159

157160
assertEquals(2, getMockWebConnection().getRequestCount());
158161
assertEquals(URL_SECOND, getMockWebConnection().getLastWebRequest().getUrl());
@@ -176,6 +179,9 @@ public void sendEnterKey() throws Exception {
176179

177180
final WebDriver driver = loadPage2(html);
178181
driver.findElement(By.id("myText")).sendKeys(Keys.ENTER);
182+
if (useRealBrowser()) {
183+
Thread.sleep(400);
184+
}
179185

180186
assertEquals(2, getMockWebConnection().getRequestCount());
181187
assertEquals(URL_SECOND, getMockWebConnection().getLastWebRequest().getUrl());

0 commit comments

Comments
 (0)