diff --git a/.github/workflows/checkstyle.yml b/.github/workflows/checkstyle.yml index 594e9878e8d..de6521deb8d 100644 --- a/.github/workflows/checkstyle.yml +++ b/.github/workflows/checkstyle.yml @@ -22,12 +22,12 @@ jobs: steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Set up JDK - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 + uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 with: java-version: 21 distribution: 'temurin' cache: maven - - uses: reviewdog/action-setup@3f401fe1d58fe77e10d665ab713057375e39b887 # v0.20.1 + - uses: reviewdog/action-setup@e04ffabe3898a0af8d0fb1af00c188831c4b5893 # v0.20.1 name: Set up reviewdog with: reviewdog_version: latest diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index e0c5c1693ce..cd6dabaf43e 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -24,12 +24,12 @@ jobs: steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Set up JDK ${{ matrix.Java }} - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 + uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 with: java-version: ${{ matrix.Java }} distribution: 'temurin' cache: maven - - uses: reviewdog/action-setup@3f401fe1d58fe77e10d665ab713057375e39b887 # v0.20.1 + - uses: reviewdog/action-setup@e04ffabe3898a0af8d0fb1af00c188831c4b5893 # v0.20.1 name: Set up reviewdog with: reviewdog_version: latest diff --git a/.github/workflows/pmd.yml b/.github/workflows/pmd.yml index b5f1a3d3c9f..51bc4988d02 100644 --- a/.github/workflows/pmd.yml +++ b/.github/workflows/pmd.yml @@ -20,12 +20,12 @@ jobs: steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Set up JDK - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 + uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 with: java-version: 21 distribution: 'temurin' cache: maven - - uses: reviewdog/action-setup@3f401fe1d58fe77e10d665ab713057375e39b887 # v0.20.1 + - uses: reviewdog/action-setup@e04ffabe3898a0af8d0fb1af00c188831c4b5893 # v0.20.1 name: Set up reviewdog with: reviewdog_version: latest diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 562589dacba..3536fd3b400 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -37,7 +37,7 @@ jobs: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0 + uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1 with: results_file: results.sarif results_format: sarif @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: SARIF file path: results.sarif diff --git a/README.md b/README.md index 393e8eea5ae..aa727ffb546 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ![HtmlUnit Logo](https://github.com/HtmlUnit/htmlunit/blob/master/src/site/resources/images/htmlunit.png) -Version 4.7.0 / November 29, 2024 +Version 4.14.0 / July 30, 2025 :heart: [Sponsor](https://github.com/sponsors/rbri) @@ -9,40 +9,48 @@ Version 4.7.0 / November 29, 2024 ### Homepage -[htmlunit.org][4] +[htmlunit.org](https://www.htmlunit.org) ### News -**[Developer Blog][15]** +**[Developer Blog](https://htmlunit.github.io/htmlunit-blog/)** + +[HtmlUnit@mastodon](https://fosstodon.org/@HtmlUnit) | [HtmlUnit@bsky](https://bsky.app/profile/htmlunit.bsky.social) | [HtmlUnit@Twitter](https://twitter.com/HtmlUnit) + + +## Table of Contents +- [Overview](#overview) +- [Get it!](#get-it) + - [Maven](#maven) + - [Gradle](#gradle) +- [Getting Started](#getting-started) +- [Features](#features) + - [Selenium Integration](#selenium-integration) + - [jsoup Bridge](#jsoup-bridge) + - [HtmlUnit satellite projects](#htmlunit-satellite-projects) + - [Built on HtmlUnit](#built-on-htmlunit) +- [Vulnerabilities](#vulnerabilities) +- [Sponsoring](#sponsoring) +- [Contributing](#contributing) +- [Last CI build](#last-ci-build) + - [Maven](#maven-1) + - [Gradle](#gradle-1) +- [License](#license) +- [Development](#development) +- [Some insights](#some-insights) -[HtmlUnit@mastodon][13] | [HtmlUnit@Twitter][3] - -[HtmlUnit Kanban Board][6] - -> **Check out HtmlUnit [satellite projects](https://github.com/orgs/HtmlUnit/repositories)**, -such as: -> * [HtmlUnit on android](https://github.com/HtmlUnit/htmlunit-android) -> * [HtmlUnit for .Net](https://github.com/HtmlUnit/NHtmlUnit) -> * or [our Rhino fork](https://github.com/HtmlUnit/htmlunit-rhino-fork) (the JS engine) -> -> Note as well that you can use HtmlUnit with [Selenium](https://www.selenium.dev/) via -> their [htmlunit-driver](https://github.com/SeleniumHQ/htmlunit-driver)! - - -## Sponsoring +## Overview +HtmlUnit is a "GUI-less browser for Java programs". It models HTML documents and provides an API that allows you to invoke pages, fill out forms, click links, etc... just like you do in your "normal" browser. -Constantly updating and maintaining the HtmlUnit code base already takes a lot of time. +It has fairly good JavaScript support (which is constantly improving) and is able to work even with quite complex AJAX libraries, simulating Chrome, Firefox or Internet Explorer depending on the configuration used. -I would like to make 2 major extensions in the next few months -* [Add HTTP/2 support](https://github.com/HtmlUnit/htmlunit/issues/370) -* [Replace the Rhino based JavaScript engine](https://github.com/HtmlUnit/htmlunit/issues/755) +HtmlUnit is typically used for testing purposes or to retrieve information from web sites. -For doing this I need your [sponsoring](https://github.com/sponsors/rbri). ## Get it! -* [Download from GitHub][12] -* [Download from Sourceforge][1] +* [Download from GitHub](https://github.com/HtmlUnit/htmlunit/releases) +* [Download from Sourceforge](https://sourceforge.net/projects/htmlunit/files/htmlunit/) * [Release History](https://www.htmlunit.org/changes-report.html) ### Maven @@ -53,7 +61,7 @@ Add to your `pom.xml`: org.htmlunit htmlunit - 4.7.0 + 4.14.0 ``` @@ -62,21 +70,19 @@ Add to your `pom.xml`: Add to your `build.gradle`: ```groovy -implementation group: 'org.htmlunit', name: 'htmlunit', version: '4.7.0' +implementation group: 'org.htmlunit', name: 'htmlunit', version: '4.14.0' ``` -## Vulnerabilities - -[List of Vulnerabilities](https://github.com/HtmlUnit/htmlunit/blob/master/CVE.md) - -[Security Policy](https://github.com/HtmlUnit/htmlunit/blob/master/SECURITY.md) - -## Overview -HtmlUnit is a "GUI-less browser for Java programs". It models HTML documents and provides an API that allows you to invoke pages, fill out forms, click links, etc... just like you do in your "normal" browser. - -It has fairly good JavaScript support (which is constantly improving) and is able to work even with quite complex AJAX libraries, simulating Chrome, Firefox or Internet Explorer depending on the configuration used. +## Getting Started +You can start here: +* [Getting Started](https://www.htmlunit.org/gettingStarted.html) +* [Introduction to HtmlUnit - Baeldung](https://www.baeldung.com/htmlunit) +* [The Java Web Scraping Handbook](https://www.scrapingbee.com/java-webscraping-book/) A nice tutorial about webscraping with a lot of background information and details about HtmlUnit. +* [Web Scraping](https://www.innoq.com/en/blog/webscraping/) Examples how to implement web scraping using HtmlUnit, Selenium or jaunt and compares them. +* [The Complete Guide to Web Scraping with Java](https://www.webscrapingapi.com/java-web-scraping/) A small straightforward guide to web scraping with Java. +* [How to test Jakarta Faces with HtmlUnit and Arquillian](http://www.mastertheboss.com/java-ee/jsf/how-to-test-jakarta-faces-with-htmlunit-and-arquillian) +* [WebScraping.AI HtmlUnit FAQ](https://webscraping.ai/faq/htmlunit) -HtmlUnit is typically used for testing purposes or to retrieve information from web sites. ## Features * Support for the HTTP and HTTPS protocols @@ -93,21 +99,99 @@ HtmlUnit is typically used for testing purposes or to retrieve information from * Support for basic and NTLM authentication * Excellent JavaScript support -## Getting Started -You can start here: -* [Getting Started][7] -* [The Java Web Scraping Handbook][8] A nice tutorial about webscraping with a lot of background information and details about HtmlUnit. -* [Web Scraping][9] Examples how to implement web scraping using HtmlUnit, Selenium or jaunt and compares them. -* [The Complete Guide to Web Scraping with Java][10] A small straightforward guide to web scraping with Java. -* [How to test Jakarta Faces with HtmlUnit and Arquillian][11] -* [WebScraping.AI HtmlUnit FAQ][13]: +### Selenium Integration + +HtmlUnit can be used as a [Selenium](https://www.selenium.dev/) +[WebDriver](https://www.selenium.dev/documentation/webdriver/)-compatible browser through the +[htmlunit-driver](https://github.com/SeleniumHQ/htmlunit-driver). +This integration allows you to use HtmlUnit as a headless browser option within Selenium test suites, +providing fast execution without the overhead of launching a full browser instance. + +Please have a look at the [HtmlUnit Remote](https://github.com/HtmlUnit/htmlunit-remote) project +if you like to use this driver from Selenium 4 Grid. + + +### jsoup Bridge + +The [htmlunit-jsoup](https://github.com/HtmlUnit/htmlunit-jsoup) library provides utilities +to bridge the gap between [HtmlUnit](https://htmlunit.org) and [jsoup](https://jsoup.org/). +The `HtmlUnitDOMToJsoupConverter` enables seamless integration between HtmlUnit's comprehensive +browser simulation capabilities and all the jsoup-based libraries, +allowing you to leverage the full ecosystem of jsoup tools +while maintaining HtmlUnit's JavaScript execution and dynamic content handling. + + +### HtmlUnit [satellite projects](https://github.com/orgs/HtmlUnit/repositories) + +* [HtmlUnit on android](https://github.com/HtmlUnit/htmlunit-android) +* [Htmlunit - NekoHtml Parser](https://github.com/HtmlUnit/htmlunit-neko) +* [HtmlUnit - CSSParser](https://github.com/HtmlUnit/htmlunit-cssparser) +* [HtmlUnit - CSP](https://github.com/HtmlUnit/htmlunit-csp) +* or [core-js](https://github.com/HtmlUnit/htmlunit-core-js) our [Rhino](https://github.com/mozilla/rhino) fork + + +### Built on HtmlUnit + +HtmlUnit is used as the underlying "browser" by different Open Source tools like + * [WebDriver](https://github.com/SeleniumHQ/selenium) + * [Arquillian Drone](https://arquillian.org/arquillian-extension-drone) + * [Serenity BDD](https://serenity-bdd.info) + * [XLT](https://www.xceptance.com/en/products/xlt/) + * [FluentLenium](https://github.com/FluentLenium/FluentLenium) + * [WETATOR](https://www.wetator.org/) + * [Selenium Foundation](https://github.com/sbabcoc/Selenium-Foundation) + * [Spring Testing](https://docs.spring.io/spring/docs/current/spring-framework-reference/testing.html#spring-mvc-test-server-htmlunit) + * [Selenide](https://selenide.org/) + * [JWebUnit](https://jwebunit.github.io/jwebunit/) + * [JSFUnit](http://www.jboss.org/jsfunit/) + * ... + +HtmlUnit is used by many projects for automated web testing + * [jenkins-test-harness](https://github.com/jenkinsci/jenkins-test-harness) + * [Apache Shiro](https://shiro.apache.org/) + * [Apache Struts](https://struts.apache.org/) + * [Quarkus](https://quarkus.io/) + * [Togglz](https://www.togglz.org/) + * [Dataverse](https://dataverse.org/) + * [Janssen Project](https://github.com/JanssenProject/jans) + * [Apache TomEE](https://github.com/apache/tomee) + * [Apache Maven Surefire](https://maven.apache.org/surefire/) + * [JSCover](http://tntim96.github.io/JSCover/) + * [Apache Jackrabbit](https://jackrabbit.apache.org/jcr/index.html) + * [Apache MyFaces](https://myfaces.apache.org/) + * [JakartaEE TCK](https://github.com/jakartaee/platform-tck) + * [Jakarta Security](https://github.com/jakartaee/security) + * [OpenXava](https://github.com/openxava/openxava) + * [Cargo](https://github.com/codehaus-cargo/cargo) + * [piranha cloud](https://github.com/piranhacloud/piranha) + * ... + +## Vulnerabilities + +[List of Vulnerabilities](https://github.com/HtmlUnit/htmlunit/blob/master/CVE.md) + +[Security Policy](https://github.com/HtmlUnit/htmlunit/blob/master/SECURITY.md) + + +## Sponsoring + +Constantly updating and maintaining the HtmlUnit code base already takes a lot of time. + +I would like to make 2 major extensions in the next few months +* [Add HTTP/2 support](https://github.com/HtmlUnit/htmlunit/issues/370) +* [Replace the Rhino based JavaScript engine](https://github.com/HtmlUnit/htmlunit/issues/755) + +For doing this I need your [sponsoring](https://github.com/sponsors/rbri). + ## Contributing Pull Requests and all other Community Contributions are essential for open source software. Every contribution - from bug reports to feature requests, typos to full new features - are greatly appreciated. +Please try to keep your pull requests small (don't bundle unrelated changes) and try to include test cases. + ## Last CI build The latest builds are available from our -[Jenkins CI build server][2] +[Jenkins CI build server](https://jenkins.wetator.org/view/HtmlUnit/) [![Build Status](https://jenkins.wetator.org/buildStatus/icon?job=HtmlUnit+-+Headless)](https://jenkins.wetator.org/job/HtmlUnit%20-%20Headless/) @@ -120,15 +204,15 @@ Add the snapshot repository and dependency to your `pom.xml`: ```xml - OSS Sonatype snapshots - https://s01.oss.sonatype.org/content/repositories/snapshots/ - - true - always - - - false - + Central Portal Snapshots + central-portal-snapshots + https://central.sonatype.com/repository/maven-snapshots/ + + false + + + true + @@ -136,7 +220,7 @@ Add the snapshot repository and dependency to your `pom.xml`: org.htmlunit htmlunit - 4.8.0-SNAPSHOT + 4.15.0-SNAPSHOT @@ -150,12 +234,12 @@ Add the snapshot repository and dependency to your `build.gradle`: ```groovy repositories { - maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots" } + maven { url "https://central.sonatype.com/repository/maven-snapshots/" } // ... } // ... dependencies { - implementation group: 'org.htmlunit', name: 'htmlunit', version: '4.8.0-SNAPSHOT' + implementation group: 'org.htmlunit', name: 'htmlunit', version: '4.15.0-SNAPSHOT' // ... } ``` @@ -168,49 +252,14 @@ This project is licensed under the Apache 2.0 License ## Development -### useful mvn command lines -setup as or refresh the eclipse project - -``` -mvn eclipse:eclipse -DdownloadSources=true -``` - -run the whole core test suite (no huge tests, no libary tests) +Checkout these pages on our website for detailed hints about starting with the development: + * [HtmlUnit Development](https://www.htmlunit.org/development.html) + * [Coding Conventions](https://www.htmlunit.org/codingConventions.html) -``` -mvn test -U -P without-library-and-huge-tests -Dgpg.skip -Djava.awt.headless=true -``` -check dependencies for known security problems - -``` -mvn dependency-check:check -``` - -### Contributing - -I welcome contributions, especially in the form of pull requests. -Please try to keep your pull requests small (don't bundle unrelated changes) and try to include test cases. ## Some insights -[HtmlUnit at openhub][5] +[HtmlUnit at openhub](https://www.openhub.net/p/HtmlUnit) ### Stargazers [![Stargazers](https://starchart.cc/HtmlUnit/htmlunit.svg)](https://starchart.cc/HtmlUnit/htmlunit) - - -[1]: https://sourceforge.net/projects/htmlunit/files/htmlunit/4.1.0/ "HtmlUnit on sourceforge" -[2]: https://jenkins.wetator.org/view/HtmlUnit/ "HtmlUnit CI" -[3]: https://twitter.com/HtmlUnit "https://twitter.com/HtmlUnit" -[4]: https://www.htmlunit.org "https://www.htmlunit.org" -[5]: https://www.openhub.net/p/HtmlUnit "https://www.openhub.net/p/HtmlUnit" -[6]: https://github.com/HtmlUnit/htmlunit/projects/1 "https://github.com/HtmlUnit/htmlunit/projects/1" -[7]: https://www.htmlunit.org/gettingStarted.html -[8]: https://www.scrapingbee.com/java-webscraping-book/ -[9]: https://www.innoq.com/en/blog/webscraping/ -[10]: https://www.webscrapingapi.com/java-web-scraping/ -[11]: http://www.mastertheboss.com/java-ee/jsf/how-to-test-jakarta-faces-with-htmlunit-and-arquillian -[12]: https://github.com/HtmlUnit/htmlunit/releases -[13]: https://fosstodon.org/@HtmlUnit -[14]: https://webscraping.ai/faq/htmlunit -[15]: https://htmlunit.github.io/htmlunit-blog/ diff --git a/checkstyle.xml b/checkstyle.xml index 801f430d970..b6e52d0a9b1 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -24,7 +24,7 @@ - + @@ -122,6 +122,10 @@ + + + + @@ -130,7 +134,7 @@ - + @@ -138,6 +142,16 @@ + + + + + + + + + + @@ -250,7 +264,6 @@ - \ No newline at end of file diff --git a/checkstyle_suppressions.xml b/checkstyle_suppressions.xml index c095435aad1..4f6e265723d 100644 --- a/checkstyle_suppressions.xml +++ b/checkstyle_suppressions.xml @@ -39,9 +39,10 @@ - + + @@ -73,6 +74,7 @@ + diff --git a/pom.xml b/pom.xml index 3735a0c0ea8..0f9ed14a8e9 100644 --- a/pom.xml +++ b/pom.xml @@ -3,18 +3,20 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 + org.htmlunit htmlunit - 4.7.0 + 4.14.0 + jar + HtmlUnit + + A headless browser intended for use in testing web-based applications. + Gargoyle Software Inc. http://www.GargoyleSoftware.com/ - jar - - A headless browser intended for use in testing web-based applications. - https://www.htmlunit.org @@ -25,30 +27,54 @@ 8 8 - 4.7.0 - 4.7.0 - 4.7.0 - 4.7.0 - 4.7.0 - 4.7.0 + 4.14.0 + 4.14.0 + 4.14.0 + 4.14.0 + 4.14.0 + 4.14.0 4.5.14 + 3.18.0 + 2.20.0 + 1.3.5 + 0.1.2 - 4.27.0 - 4.27.0 - selenium-devtools-v131 + + 4.34.0 + 4.34.0 + selenium-devtools-v138 - 9.4.56.v20240826 - 2.24.2 - 2.0.16 + + 5.13.4 + 1.13.4 + 2.3.0 + 9.4.57.v20241219 + 4.0.66 + 2.25.1 + 2.0.17 + 1.14.0 + 1.6.0 + 4.4.0 + 1.5.6 - - 10.20.1 - 4.8.6 - 7.7.0 - 4.13.2 - 1.3.0 + + 10.26.1 + 4.9.3 + 7.16.0 + 1.4.1 10.0.4 + + + 0.8.0 + 3.6.0 + 3.27.0 + 4.9.3.2 + 3.2.8 + 3.6.1 + 2.12.1 + 3.4.2 + 2.9.1 @@ -56,12 +82,12 @@ org.apache.maven.plugins maven-compiler-plugin - 3.13.0 + 3.14.0 org.apache.maven.plugins maven-checkstyle-plugin - 3.6.0 + ${checkstyle-plugin.version} checkstyle.xml checkstyle_suppressions.xml @@ -78,7 +104,7 @@ com.github.spotbugs spotbugs-maven-plugin - 4.8.6.6 + ${spotbugs-plugin.version} com.github.spotbugs @@ -93,7 +119,7 @@ org.apache.maven.plugins maven-pmd-plugin - 3.26.0 + ${pmd-plugin.version} net.sourceforge.pmd @@ -126,7 +152,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.4.2 + ${jar-plugin.version} @@ -190,19 +216,19 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 org.apache.maven.plugins maven-javadoc-plugin - 3.11.1 + 3.11.2 true protected - html,missing,reference,syntax + html,reference,syntax true true - netscape:netscape.*:org.htmlunit.platform.util + org.htmlunit.platform.util @@ -215,7 +241,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.7 + ${gpg-plugin.version} verify @@ -225,6 +251,15 @@ + + org.sonatype.central + central-publishing-maven-plugin + ${central-publishing-plugin.version} + true + + central + + org.owasp dependency-check-maven @@ -246,7 +281,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.5.0 + ${enforcer-plugin.version} @@ -266,10 +301,29 @@ + + org.cyclonedx + cyclonedx-maven-plugin + ${cyclonedx-plugin.version} + + + package + + makeAggregateBom + + + + + library + json + + false + + org.apache.felix maven-bundle-plugin - 6.0.0 + 5.1.9 true @@ -284,7 +338,7 @@ org.simplify4u.plugins pgpverify-maven-plugin - 1.18.2 + 1.19.1 @@ -309,7 +363,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false @@ -318,12 +372,36 @@ **/huge/*.java **/encoding/*.java - -Xms128m -Xmx512m -Dsun.reflect.noInflation=true + -Xms128m -Xmx1g -Dsun.reflect.noInflation=true maven + + org.jacoco + jacoco-maven-plugin + 0.8.13 + + + + prepare-agent + + + + report + prepare-package + + report + + + + + + org/htmlunit/cssparser/** + + + @@ -339,7 +417,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false @@ -370,7 +448,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false @@ -398,11 +476,12 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false + **/huge/CtorPrototypeTest.java **/huge/ElementClosesElementTest.java -Xms256m -Xmx512m @@ -426,7 +505,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false @@ -456,7 +535,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false @@ -485,7 +564,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false @@ -514,7 +593,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false @@ -543,7 +622,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false @@ -571,7 +650,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false @@ -599,7 +678,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false @@ -627,7 +706,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false @@ -656,7 +735,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.2 + 3.5.3 false @@ -678,14 +757,14 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.11.1 + 3.11.2 true protected - html,missing,reference,syntax + html,reference,syntax true true - netscape:netscape.*:org.htmlunit.platform.util + org.htmlunit.platform.util @@ -698,7 +777,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.8.0 + 3.9.0 org.apache.maven.plugins @@ -708,7 +787,7 @@ org.apache.maven.plugins maven-changes-plugin - 2.12.1 + ${changes-plugin.version} @@ -1196,6 +1275,9 @@ Markus Winter + + Christoph Burgmer + @@ -1204,10 +1286,6 @@ httpmime ${httpcomponents.version} - - commons-codec - commons-codec - commons-logging commons-logging @@ -1255,55 +1333,53 @@ org.apache.commons commons-lang3 - 3.17.0 - - - org.apache.commons - commons-text - 1.12.0 - - - org.apache.commons - commons-lang3 - - + ${commons-lang3.version} commons-io commons-io - 2.18.0 + ${commons-io.version} commons-logging commons-logging - 1.3.4 - - - commons-net - commons-net - 3.11.1 - - - commons-codec - commons-codec - 1.17.1 + ${commons-logging.version} org.brotli dec - 0.1.2 + ${brotli.version} - junit - junit + org.junit.jupiter + junit-jupiter-engine + ${junit.version} + test + + + org.junit.jupiter + junit-jupiter-params ${junit.version} test + + org.junit.platform + junit-platform-launcher + ${junit-launcher.version} + test + + + org.junit-pioneer + junit-pioneer + ${junit-pioneer.version} + test + + com.tngtech.archunit - archunit-junit4 + archunit-junit5 ${archunit.version} test @@ -1367,7 +1443,7 @@ org.apache.xmlgraphics batik-transcoder - 1.18 + 1.19 test @@ -1381,10 +1457,23 @@ + + org.apache.commons + commons-text + ${commons-text.version} + test + + + org.apache.commons + commons-lang3 + + + + commons-fileupload commons-fileupload - 1.5 + ${commons-fileupload.version} test @@ -1400,13 +1489,13 @@ com.github.romankh3 image-comparison - 4.4.0 + ${image-comparison.version} test org.jfree jfreechart - 1.5.5 + ${jfreechart.version} test @@ -1425,7 +1514,7 @@ com.caucho quercus - 4.0.66 + ${quercus.version} test @@ -1475,39 +1564,19 @@ - - - s01-sonatype-nexus-snapshots - https://s01.oss.sonatype.org/content/repositories/snapshots - - - s01-sonatype-nexus-staging - https://s01.oss.sonatype.org/service/local/staging/deploy/maven2 - - - + - - true - always - + Central Portal Snapshots + central-portal-snapshots + https://central.sonatype.com/repository/maven-snapshots/ false - OSS Sonatype snapshots - https://oss.sonatype.org/content/repositories/snapshots/ - - true - always - - false - - S01 OSS Sonatype snapshots - https://s01.oss.sonatype.org/content/repositories/snapshots/ + diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 6260cda210e..b513b1bf097 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -7,6 +7,735 @@ + + + New sister project 'jsoup-bridge' (https://github.com/HtmlUnit/htmlunit?tab=readme-ov-file#jsoup-bridge). + + + Switched to sonatype central-publishing for snapshots and release builds. + + + Avoid ConcurrentModificationException if HtmlPage.deregisterFramesIfNeeded() + + + Separate developer docu to help peoples to start working on this project + + + MutationEvent is still available in FF but not as global + + + Some fixes for the ctor prototype setup + + + code cleanup based on pmd - use isEmpty() at more places + + + core-js: Infer function name when declared in a var/let statement implemented + + + core-js: Promise.withResolvers() added + + + core-js: assigning values to super got some improvements + + + core-js: BigInt.asUintN and BigInt.asIntN implementation fixed + + + core-js: code simplification regarding support of different jdk's + + + core-js: huge refactoring of the interpreter for more speed and easier maintenance + + + core-js: '__parent__' property is no longer available + + + core-js: refactored exception and stack handling + + + core-js: The Builtins and the Regexp initializer migrated from reflection to lambda + + + core-js: major '__proto__' support update bringing the '__proto__' support in line + with the spec and with real browsers. This also includes support for + the strange function 'shorthand' case for __proto_. + + + core-js: refactored CallFrame to keep stack as immutable linked list. + + + core-js: fix how 'this' is handled when calling `Array.from` in some edge cases, + when `null` or 'undefined' were passed as the `this` argument + + + SBOM (CycloneDX format) added. + + + core-js: minor code optimization. + + + core-js: typo in prototype detection fixed. + + + core-js: Code cleanup. + + + neko: fix ParentNode#getTextContent() + + + neko: introduce Element.SCRIPT_SUPPORTING flag for HTMLElements + + + Upgrade Apache commons-io to 2.20.0. + + + Upgrade Apache commons-lang3 to 3.18.0. + + + core-js: UnicodeMode support for regexp added. + + + core-js: ArrayBuffer detach() support added. + + + Major improvements for the asXML() function. + + + Test suite updated to junit 5 and cleaned up. + + + The hidden attribute now supports the 'until-found' value. + + + INCOMPATIBLE CHANGE: To add support for the 'until-found' hidden attribute value, the parameter + handing of method HtmlElement.setHidden(String) was changed. Please have a look at the javadoc for + details about the current implementation. + + + jQuery 1.12.4 test suite added. + + + jQuery 1.8.2, 1.11.3, and 3.3.1 test suite refreshed. + + + FF139: SVGDiscardElement is gone (again). + + + getClientRects() returns an empty list for hidden inputs. This fixes also a problem with + the :hidden jQuery selector. + + + + + + + The prototype for DOMRect is now DOMRectReadOnly. + + + Internal javascript class ClientRect renamed to DOMRect (the old name was a leftover from IE). + + + Internal javascript class ClientRectList renamed to DOMRectList (the old name was a leftover from IE). + + + core-js: Adjust order of evaluation of function arguments to match the spec. + + + core-js: Major tidy up of 'NativeTypedArrayView' to better match spec. + + + core-js: Refactor functions to be lambdas rather than IdScriptableObject's. + + + The prototype for HTMLAllCollectionis no longer the HTMLCollection, it is now object. + + + HTMLTableCellElement now supports the 'align', 'ch', 'chOff', 'headers', 'height', 'noWrap', + 'rowSpan', 'scope', 'vAlign', 'width' properties. + + + HTMLTableColElement now supports the 'align', 'ch', 'chOff', and 'vAlign' properties. + + + Internal javascript class HTMLTableComponent removed. The prototype for HTMLTableCellElement, + HTMLTableColElement, and HTMLTableRowElement is now the correct HTMLElement. + + + HTMLTableSectionElement now supports the deleteRow() and insertRow() functions. + + + HTMLTableSectionElement now supports the 'align' and 'rows' properties. + + + HTMLTableElement now supports the deleteRow() and insertRow() functions. + + + HTMLTableElement now supports the 'align' and 'rows' properties. + + + Internal javascript class RowContainer removed. The prototype for HTMLTableElement, and + HTMLTableSectionElement is now the correct HTMLElement. + + + HTMLUListElement now supports the 'compact' property. + + + HTMLOListElement now supports the 'compact' property. + + + HTMLMenuElement now supports the 'compact' property. + + + HTMLLIElement now supports the 'type' property. + + + HTMLDListElement now supports the 'compact' property. + + + HTMLDListElement now supports the 'compact' property. + + + Internal javascript class HTMLListElement removed. The prototype for HTMLDListElement, + HTMLDirectoryElement, HTMLLIElement, HTMLMenuElement, HTMLOListElement, and HTMLUListElement + is now the correct HTMLElement. + + + Internal javascript class HTMLListElement removed. The prototype for HTMLDListElement, + HTMLDirectoryElement, HTMLLIElement, HTMLMenuElement, HTMLOListElement, andHTMLUListElement + is now the correct HTMLElement. + + + Javascript class configuration reworked, this allows some optimizations in the furture. + + + Constructor prototype fixes, now we have the correct prototypes for most classes. + The RecursiveFunctionObject workaround is no longer required. + + + DomNodeIterator is now serializable. + + + FF138: adjust datetimeformat for several locales. + + + Chrome/Edge 136: Clicking an image input no longer submits the value as param. + + + FF138: Frame elements are accessible by name. + + + FF138: Error.captureStackTrace() is supported. + + + FF138: js constant maxActions added to Notification. + + + FF138: stylesheet links checking the content type for 'text/css'. + + + + + + + WebClient option NekoReaderBufferSize added. You can use this to increase the buffer size used by + the Neko Html parser to optimize parsing performance. + + + HTMLParser parseFragment(DomNode, String), parse(WebResponse, HtmlPage, boolean, boolean), and + parseFragment(DomNode, DomNode, String, boolean) are deprecated. + + + neko: HTMLScanner always requires a document handler; the null check is moved to the setter + and all the others are removed. + + + neko: avoid HTML1011 error for self closing tags. + + + neko: ignore whitespace before the closing > when parsing special tags. + + + neko: remove two superfluous conversions from the code. + + + core-js: NativeArray impl is now lambda based. + + + core-js: improved date string parser; support optional ms digits, + skip ms digits, extended year support is not available in es6 + + + core-js: detailed message added to IndexOutOfBoundsExceptions + + + core-js: add double null check pattern when initializing cache values. + + + DomTokenList.forEach() now takes care of the current state of the list + (e.g. the forEach function might add/remove elements to the list itself). + + + NodeList.forEach() now takes care of the current state of the list + (e.g. the forEach function might add/remove elements to the list itself). + + + AlertHandler, ConfirmHandler, FrameContentHandler, CharacterDataChangeListener, and IncorrectnessListener + marked as @FunctionalInterface. + + + Upgrade Apache commons-io to 2.19.0. + + + Element.scrollIntoView() now triggers scroll events on all parents. + + + For FF scroll events are of type UIEvent. + + + Scroll events are not bubbling and not cancelable. + + + core-js: Function.prototype[Symbol.hasInstance] fixed. + + + core-js: regression in hex and unicode hex parsing or regexp fixed + + + CSS blockSize support improved. + + + core-js: Complete reimplementation of 'String.prototype.search', 'String.prototype.replace', + 'String.prototype.replaceAll', and 'String.prototype.split'. The new impl is much closer to the spec. + + + core-js: Fix a character class parsing regression for regexp. + + + core-js: Fix handling of \x and \u in regexp. + + + FF137: SVGDiscardElement added. + + + Chrome/Edge 135, FF137: Setter validation for length style properties adjusted. + + + Chrome/Edge 135: Style properties 'interactivity', 'overflowBlock', 'overflowInline', and 'scrollMarkerGroup' added. + + + FF137: Adjust clientHeight for some ruby related tags. + + + Chrome/Edge 135, FF137: Improved namespace handling when sending an html document via XMLHttpRequest. + + + Chrome/Edge 135: Improved <br> handling in options tags. + + + Chrome/Edge 135, FF137: Fixed font sizes for smaller/larger css prooerty value. + + + FF137: Set span for table cells to zero if provided value is invalid. + + + core-js: Some fixes for strict handling. + + + core-js: Several code improvements for the RegExp implementation. + + + WebClient.setWebSocketAdapter(WebSocketAdapterFactory) added. This should + help to use a different WebSocket implementation. + + + WebSocketAdapter splitted into WebSocketAdapter and WebSocketListener. + New interface WebSocketAdapterFactory introduced. This should help to + make it simpler to use a different WebSocket implementation. + + + core-js: Named capture groups in RegularExpressions now supported. + + + Deprecated method CssStyleSheet.validateSelectors(SelectorList, int, DomNode) removed. + + + Deprecated method HtmlForm.getElements() removed. + + + Deprecated method WebRequest.setRefererlHeader(URL) removed. + + + + + + + NumberFormatException when calculating the clientHeight/offsetHeight. + + + + + + + Event 'onload' is trigger by FF ESR also if the frame content was not shown because of csp. + + + Initial support for font sizes 'xx-small', 'x-small', 'small', 'medium', 'large', + 'x-large', 'xx-large', 'xxx-large', 'smaller', and 'larger'. + + + core-js: Refactor NativeString based on lambdas and stop using IdScriptableObject. + + + The style cache has to handle all parents of added or deleted nodes. + + + Class HiddenFunctionObject removed, this was a leftover from the IE age. + + + core-js: Arguments.callee is always the same function in strict mode. + + + core-js: Arguments.caller is not available in real browsers. + + + core-js: An issue where capture groups in quantified expressions (min = 2) were not cleared between iterations fixed. + For example, in /(?:(\2)(\d)){2}/, during the second iteration, \2 incorrectly retained the first iteration's value instead of being reset. + + + Switched back from our RegExp translation into java regular expressions to use the core Rhino stuff. Rhino mades significant + progress in this arae. This simplifies out impl and supports more features in the future. + + + core-js: RegExp lookbehind implemented. + + + core-js: NativeObject converted from IdScriptableObject to lambda constructor + + + core-js: problem with 'super' and nested lambdas + + + core-js: RegExp.prototype[Symbol.match] and String.prototype.match. + + + core-js: Implement Symbol.match. + + + core-js: String.prototype.match. As per the spec, it is simply supposed to invoke the Symbol.match of the regexp. + + + core-js: Fix the behaviour of Regexp sticky flag. + + + Deprecated methods removed from EncodingSniffer, HttpClientConverter, WebResponse, and WebResponseWrapper. + + + cssparser: improved support for var initial values. + + + Apache commons-codec is no longer a runtime dependency. + + + atob() has to remove all whitespace from the provided string. + + + atob() must always fail on invalid input. + + + The script async attribute is ignored if the src attribute is absent. + + + Many more checkstyle jdoc rules enabled and all violations fixed. + + + HtmlImage onerror event is triggerd for 204 responses. + + + Some minor code improvements found by spotbugs. + + + Some more event initialization fixes. + + + Fix various event initialization when working with WebSocket's. + + + + + + + core-js: NativeGlobal now based on lambda functions. + + + Avoid using XPath for implementing form submit on enter key pressed. + + + Implement Document.getElementById() without using XPath. + + + NPE in org.htmlunit.javascript.JavaScriptEngine.asJavaScriptException(). + + + Upgrade commons-logging to 1.3.5. + + + StyleElement implements no longer the Comparable interface. For our special needs we now using the + static method compareToByImportanceAndSpecificity(StyleElement, StyleElement). + + + core-js: load more classes lazily. + + + HtmlUrlInput value trimming fixed. + + + Replace the deprecated WebElement.getAttribute(String) with getDomAttribute(String) and getDomProperty(String) + at many places in the test suite. + + + Use StandardCharsets.UTF_8 instead of Charsets.UTF_8 for the sample code. + + + HtmlTextArea - several fixes to throw the correct error. + + + AudioContext/OfflineAudioContext - several fixes to throw the correct error. + + + 'Illegal constructor' is a type error. + + + Firefox ESR accept header no longer contains 'image/avif,image/webp,image/png,image/svg+xml'. + + + core-js: BigInt, Boolean and Number converted to use lambdas. + + + core-js: Function hoisting inside blocks is now a core Rhino feature, our own hack is gone. + + + core-js: Map and Set converted to use lambdas. + + + core-js: lambda-based classes serializable are serializable. + + + core-js: bunch of changes to make the SlotMap handling faster. + + + CSSStyleSheet - several fixes to throw the correct error. + + + XPath.evaluate() throws a TypeError. + + + Document - several fixes to throw the correct error. + + + XMLHttpRequest - several fixes to throw the correct error. + + + Geolocation.ctor() throws a TypeError. + + + TreeWalker.ctor() throws a TypeError. + + + MutationObserver.observe() throws a TypeError. + + + DOMParser.parseFromString() throws a TypeError. + + + Window.postMessage() throws a SyntaxError. + + + Window.atob()/btoa() throws an InvalidCharacterError. + + + DomNode.appendChild() throws a HierarchyRequstError. + + + AbstractRange.ctor() throws a TypeError. + + + DOMTokenList - several fixes to throw the correct error. + + + CSSGroupingRule - several fixes to throw the correct error. + + + HTMLInputElement value/selectionStart/selectionEnd properties throws the correct error (InvalidStateError). + + + SVGMatrix.rotateFromVector()/inverse() throws the correct error (InvalidAccessError/InvalidStateError). + + + Crypto.getRandomValues() throws a QuotaExceededError. + + + CanvasRenderingContext2D.measureText() throws a TypeError. + + + HTMLTableElement/HTMLTableRowElement - several fixes to throw the correct error. + + + Element.querySelectorAll()/querySelector() throws a SyntaxError. + + + HTMLOptionsCollection.add() throws a NotFoundError. + + + Accessing a HTMLDocument without a js peer throws a TypeError. + + + Document.createElementNS() throws a TypeError. + + + Document.createElementNS() throws a TypeError. + + + Selection.getRangeAt() throws an IndexSizeError. + + + Node.replaceChild()/removeChild()/insertBefore() several fixes to throw the correct error. + + + HTMLDocument.appendChild() throws HierarchyRequstError. + + + Document.createElement() throws InvalidCharacterError. + + + ImageData.ctor() various fixes to throw the correct error in different situations. + + + CharacterData.deleteData() throws an IndexSizeError. + + + Document.querySelectorAll() throws a SyntaxError if the selector is invalid. + + + Document.createEvent() creates the correct exception when the event type is not supported. + + + DOMException name property was missing. + + + Handling of the error code when construction DOMException is fixed. + + + Document.evaluate() now throws a SyntaxError instead of an InternalError. + + + Upgrade commons-codec to 1.18.0. + + + WebClientOptions sslClientCertificateStore is transient. + + + + + + + WebClientOptions SSLTrustStore is transient. + + + WebClientOptions.Geolocation is serializable now + + + HtmlDomTreeWalker is serializable now + + + core-js: junit-vintage-engine was NOT marked as 'test' dependency, therefore we had junit + as part of our depenencies/lib/diestribution (regression from 4.8.0) + + + BigInt support added. + + + core-js: Symbol.hasInstance for Function.prototype implemented. + + + core-js: Context#emptyArgs is deprecated. + + + + + + + cssparser: support plain color definitions with var/calc. + + + cssparser: 'and' is a valid class name. + + + cssparser: support relative color definitions. + + + websocket-client: jetty updated to 9.4.57.v20241219. + + + core-js: add an empty slot map (singleton) for cases where no slots exist; this should reduce the memory needed a bit + + + core-js: methods cannot be used as constructor fixed + + + Upgrade commons-codec to 1.17.2. + + + Apache commons-net is no longer a runtime dependency. + + + Apache commons-text is no longer a runtime dependency. + + + core-js: Extract function calling out of the interpreter loop for performance. + + + Avoid ConcurrentModificationExceptions in frame processing. + + + core-js: handle stack frames in the correct order. + + + cssparser: support hwb(), lab(), lch(), oklab(), and oklch() color definitions. + + + cssparser: add support for 'none' in modern color definitions. + + + core-js: fix border checks for typedarray set-method (see https://github.com/HtmlUnit/htmlunit-core-js/issues/27) + + + core-js: Allow symbol keys in getter/setter in object literal syntax like 'var o = { get [aSymbol]: value }'. + + + core-js: Support for generator methods in object literals like 'o = {*g() {...}}' added. + + + core-js: Implement the super operator - which can actually be used outside of classes and will do something that intuitively is "refer to the prototype". + + + core-js: Fix tokenEnd and cursor for string, template, xml literals and multiline comments when using multibyte characters. + + + FAQ updated with some info about page history. + + + DomElement#getStaticElementsByTagName() has to check for prefix. + + + Upgrade Apache commons-text to 1.13.0. + + + core-js: Some improvments for the interpreter by generating smaller interpreter bytecode. + + + + core-js: String.prototype.matchAll, Symbol.matchAll, and RegExp.prototype[Symbol.matchAll] added. diff --git a/src/jenkins/huge-tests-m-o b/src/jenkins/huge-tests-m-o index cdd22ad9987..4b04403eeb3 100644 --- a/src/jenkins/huge-tests-m-o +++ b/src/jenkins/huge-tests-m-o @@ -4,7 +4,7 @@ pipeline { lock resource: 'htmlunit-test-ports' disableConcurrentBuilds() timestamps() - timeout(time: 15, unit: 'MINUTES') + timeout(time: 35, unit: 'MINUTES') } tools { jdk 'openjdk-11+28' diff --git a/src/main/java/org/htmlunit/AbstractPage.java b/src/main/java/org/htmlunit/AbstractPage.java index 1ddf2d29272..940d8c67a5c 100644 --- a/src/main/java/org/htmlunit/AbstractPage.java +++ b/src/main/java/org/htmlunit/AbstractPage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/AjaxController.java b/src/main/java/org/htmlunit/AjaxController.java index f845bbef786..bd8cb6674c6 100644 --- a/src/main/java/org/htmlunit/AjaxController.java +++ b/src/main/java/org/htmlunit/AjaxController.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/AlertHandler.java b/src/main/java/org/htmlunit/AlertHandler.java index 41b4508b5c6..d8b768a0f6c 100644 --- a/src/main/java/org/htmlunit/AlertHandler.java +++ b/src/main/java/org/htmlunit/AlertHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ * @author Mike Bowler * @author Ronald Brill */ +@FunctionalInterface public interface AlertHandler extends Serializable { /** diff --git a/src/main/java/org/htmlunit/BrowserVersion.java b/src/main/java/org/htmlunit/BrowserVersion.java index 2912be38195..d37b66c972b 100644 --- a/src/main/java/org/htmlunit/BrowserVersion.java +++ b/src/main/java/org/htmlunit/BrowserVersion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ import java.util.TimeZone; import org.apache.commons.io.FilenameUtils; -import org.htmlunit.javascript.configuration.AbstractJavaScriptConfiguration; +import org.htmlunit.css.CssPixelValueConverter; import org.htmlunit.javascript.configuration.BrowserFeature; import org.htmlunit.javascript.configuration.SupportedBrowser; import org.htmlunit.util.MimeType; @@ -61,31 +61,11 @@ * @author Frank Danek * @author Ronald Brill */ -@SuppressWarnings("PMD.AvoidDuplicateLiterals") +@SuppressWarnings({"PMD.AvoidDuplicateLiterals", "PMD.TooManyFields"}) public final class BrowserVersion implements Serializable { - /** - * Application name the Netscape navigator series of browsers. - */ - private static final String NETSCAPE = "Netscape"; - - /** - * United States English language identifier. - */ - private static final String LANGUAGE_ENGLISH_US = "en-US"; - - /** - * United States. - */ - private static final String TIMEZONE_NEW_YORK = "America/New_York"; - - /** - * The WIN32 platform. - */ - private static final String PLATFORM_WIN32 = "Win32"; - /** Latest Firefox. */ - public static final BrowserVersion FIREFOX = new BrowserVersion(133, "FF"); + public static final BrowserVersion FIREFOX = new BrowserVersion(140, "FF"); private static final int FIREFOX_ESR_NUMERIC = 128; @@ -93,10 +73,10 @@ public final class BrowserVersion implements Serializable { public static final BrowserVersion FIREFOX_ESR = new BrowserVersion(FIREFOX_ESR_NUMERIC, "FF-ESR"); /** Latest Edge. */ - public static final BrowserVersion EDGE = new BrowserVersion(131, "Edge"); + public static final BrowserVersion EDGE = new BrowserVersion(138, "Edge"); /** Latest Chrome. */ - public static final BrowserVersion CHROME = new BrowserVersion(131, "Chrome"); + public static final BrowserVersion CHROME = new BrowserVersion(138, "Chrome"); /** * Array with all supported browsers. @@ -117,6 +97,7 @@ public final class BrowserVersion implements Serializable { + FIREFOX_ESR.getBrowserVersionNumeric() + ".0) Gecko/20100101 Firefox/" + FIREFOX_ESR.getBrowserVersionNumeric() + ".0"; FIREFOX_ESR.buildId_ = "20181001000000"; + FIREFOX_ESR.vendor_ = ""; FIREFOX_ESR.productSub_ = "20100101"; FIREFOX_ESR.headerNamesOrdered_ = new String[] { HttpHeader.HOST, @@ -133,7 +114,7 @@ public final class BrowserVersion implements Serializable { HttpHeader.SEC_FETCH_SITE, HttpHeader.SEC_FETCH_USER, HttpHeader.PRIORITY}; - FIREFOX_ESR.htmlAcceptHeader_ = "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8"; + FIREFOX_ESR.htmlAcceptHeader_ = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; FIREFOX_ESR.acceptLanguageHeader_ = "en-US,en;q=0.5"; FIREFOX_ESR.xmlHttpRequestAcceptHeader_ = "*/*"; FIREFOX_ESR.imgAcceptHeader_ = "image/avif,image/webp,image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5"; @@ -152,6 +133,7 @@ public final class BrowserVersion implements Serializable { + FIREFOX.getBrowserVersionNumeric() + ".0) Gecko/20100101 Firefox/" + FIREFOX.getBrowserVersionNumeric() + ".0"; FIREFOX.buildId_ = "20181001000000"; + FIREFOX.vendor_ = ""; FIREFOX.productSub_ = "20100101"; FIREFOX.headerNamesOrdered_ = new String[] { HttpHeader.HOST, @@ -188,7 +170,6 @@ public final class BrowserVersion implements Serializable { CHROME.userAgent_ = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/" + CHROME.getBrowserVersionNumeric() + ".0.0.0 Safari/537.36"; - CHROME.applicationCodeName_ = "Mozilla"; CHROME.vendor_ = "Google Inc."; CHROME.productSub_ = "20030107"; CHROME.headerNamesOrdered_ = new String[] { @@ -215,9 +196,38 @@ public final class BrowserVersion implements Serializable { CHROME.imgAcceptHeader_ = "image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8"; CHROME.cssAcceptHeader_ = "text/css,*/*;q=0.1"; CHROME.scriptAcceptHeader_ = "*/*"; + + /* + CHROME.secClientHintUserAgentHeader_ = "\"Not(A:Brand\";v=\"99\", \"Google Chrome\";v=\"" + + CHROME.getBrowserVersionNumeric() + "\", \"Chromium\";v=\"" + + CHROME.getBrowserVersionNumeric() + "\""; + CHROME.secClientHintUserAgentHeader_ = "\"Chromium\";v=\"" + + CHROME.getBrowserVersionNumeric() + "\", \"Not:A-Brand\";v=\"24\", \"Google Chrome\";v=\"" + + CHROME.getBrowserVersionNumeric() + "\""; + */ + // 135 + /* + CHROME.secClientHintUserAgentHeader_ = "\"Google Chrome\";v=\"" + + CHROME.getBrowserVersionNumeric() + "\", \"Not-A.Brand\";v=\"8\", \"Chromium\";v=\"" + + CHROME.getBrowserVersionNumeric() + "\""; + */ + // 136 + /* + CHROME.secClientHintUserAgentHeader_ = "\"Chromium\";v=\"" + + CHROME.getBrowserVersionNumeric() + "\", \"Google Chrome\";v=\"" + + CHROME.getBrowserVersionNumeric() + "\", \"Not.A/Brand\";v=\"99\""; + */ + // 137 + /* CHROME.secClientHintUserAgentHeader_ = "\"Google Chrome\";v=\"" - + CHROME.getBrowserVersionNumeric() + "\", \"Chromium\";v=\"" - + CHROME.getBrowserVersionNumeric() + "\", \"Not_A Brand\";v=\"24\""; + + CHROME.getBrowserVersionNumeric() + "\", \"Chromium\";v=\"" + + CHROME.getBrowserVersionNumeric() + "\", \"Not/A)Brand\";v=\"24\""; + */ + // 138 + CHROME.secClientHintUserAgentHeader_ = "\"Not)A;Brand\";v=\"8\", \"Chromium\";v=\"" + + CHROME.getBrowserVersionNumeric() + "\", \"Google Chrome\";v=\"" + + CHROME.getBrowserVersionNumeric() + "\""; + CHROME.fontHeights_ = new int[] { 0, 1, 2, 4, 5, 5, 6, 8, 9, 10, 11, 12, 15, 16, 16, 17, 18, 20, 21, 22, 23, 25, 26, 26, 27, 28, 30, 31, 32, 33, 34, 36, 37, 37, 38, 40, 42, 43, 44, 45, 47, 48, 48, 49, 51, 52, 53, 54, 55, 57, @@ -234,7 +244,6 @@ public final class BrowserVersion implements Serializable { + EDGE.getBrowserVersionNumeric() + ".0.0.0 Safari/537.36 Edg/" + EDGE.getBrowserVersionNumeric() + ".0.0.0"; - EDGE.applicationCodeName_ = "Mozilla"; EDGE.vendor_ = "Google Inc."; EDGE.productSub_ = "20030107"; EDGE.headerNamesOrdered_ = new String[] { @@ -261,9 +270,39 @@ public final class BrowserVersion implements Serializable { EDGE.imgAcceptHeader_ = "image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8"; EDGE.cssAcceptHeader_ = "text/css,*/*;q=0.1"; EDGE.scriptAcceptHeader_ = "*/*"; + + /* + EDGE.secClientHintUserAgentHeader_ = "\"Chromium\";v=\"" + + EDGE.getBrowserVersionNumeric() + "\", \"Not:A-Brand\";v=\"24\", \"Microsoft Edge\";v=\"" + + EDGE.getBrowserVersionNumeric() + "\""; + EDGE.secClientHintUserAgentHeader_ = "\"Not(A:Brand\";v=\"99\", \"Microsoft Edge\";v=\"" + + EDGE.getBrowserVersionNumeric() + "\", \"Chromium\";v=\"" + + EDGE.getBrowserVersionNumeric() + "\""; + */ + // 135 + /* EDGE.secClientHintUserAgentHeader_ = "\"Microsoft Edge\";v=\"" - + EDGE.getBrowserVersionNumeric() + "\", \"Chromium\";v=\"" - + EDGE.getBrowserVersionNumeric() + "\", \"Not_A Brand\";v=\"24\""; + + EDGE.getBrowserVersionNumeric() + "\", \"Not-A.Brand\";v=\"8\", \"Chromium\";v=\"" + + EDGE.getBrowserVersionNumeric() + "\""; + */ + // 136 + /* + EDGE.secClientHintUserAgentHeader_ = "\"Chromium\";v=\"" + + EDGE.getBrowserVersionNumeric() + "\", \"Microsoft Edge\";v=\"" + + EDGE.getBrowserVersionNumeric() + "\", \"Not.A/Brand\";v=\"99\""; + */ + // 137 + /* + EDGE.secClientHintUserAgentHeader_ = "\"Microsoft Edge\";v=\"" + + EDGE.getBrowserVersionNumeric() + "\", \"Chromium\";v=\"" + + EDGE.getBrowserVersionNumeric() + "\", \"Not/A)Brand\";v=\"24\""; + */ + + // 138 + EDGE.secClientHintUserAgentHeader_ = "\"Not)A;Brand\";v=\"8\", \"Chromium\";v=\"" + + EDGE.getBrowserVersionNumeric() + "\", \"Microsoft Edge\";v=\"" + + EDGE.getBrowserVersionNumeric() + "\""; + EDGE.fontHeights_ = new int[] { 0, 1, 2, 4, 5, 5, 6, 8, 9, 10, 11, 12, 15, 16, 16, 17, 18, 20, 21, 22, 23, 25, 26, 26, 27, 28, 30, 31, 32, 33, 34, 36, 37, 37, 38, 40, 42, 43, 44, 45, 47, 48, 48, 49, 51, 52, 53, 54, 55, 57, @@ -371,7 +410,7 @@ public final class BrowserVersion implements Serializable { FIREFOX.registerUploadMimeType("mp3", "audio/mpeg"); FIREFOX.registerUploadMimeType("ogv", "video/ogg"); FIREFOX.registerUploadMimeType("ogm", "video/ogg"); - FIREFOX.registerUploadMimeType("ogg", "video/ogg"); + FIREFOX.registerUploadMimeType("ogg", "application/ogg"); FIREFOX.registerUploadMimeType("oga", "audio/ogg"); FIREFOX.registerUploadMimeType("opus", "audio/ogg"); FIREFOX.registerUploadMimeType("webm", "video/webm"); @@ -387,17 +426,17 @@ public final class BrowserVersion implements Serializable { private final int browserVersionNumeric_; private final String nickname_; - private String applicationCodeName_ = "Mozilla"; - private String applicationMinorVersion_ = "0"; + private String applicationCodeName_; + private String applicationMinorVersion_; private String applicationName_; private String applicationVersion_; private String buildId_; private String productSub_; - private String vendor_ = ""; - private Locale browserLocale_ = Locale.forLanguageTag(LANGUAGE_ENGLISH_US); - private boolean onLine_ = true; - private String platform_ = PLATFORM_WIN32; - private TimeZone systemTimezone_ = TimeZone.getTimeZone(TIMEZONE_NEW_YORK); + private String vendor_; + private Locale browserLocale_; + private boolean onLine_; + private String platform_; + private TimeZone systemTimezone_; private String userAgent_; private final Set features_; private String acceptEncodingHeader_; @@ -423,7 +462,15 @@ public final class BrowserVersion implements Serializable { browserVersionNumeric_ = browserVersionNumeric; nickname_ = nickname; - applicationName_ = NETSCAPE; + applicationCodeName_ = "Mozilla"; + applicationMinorVersion_ = "0"; + applicationName_ = "Netscape"; + onLine_ = true; + platform_ = "Win32"; + + browserLocale_ = Locale.forLanguageTag("en-US"); + systemTimezone_ = TimeZone.getTimeZone("America/New_York"); + acceptEncodingHeader_ = "gzip, deflate, br"; htmlAcceptHeader_ = "*/*"; imgAcceptHeader_ = "*/*"; @@ -468,7 +515,7 @@ else if (isFirefox()) { final BrowserFeature browserFeature = field.getAnnotation(BrowserFeature.class); if (browserFeature != null) { for (final SupportedBrowser browser : browserFeature.value()) { - if (AbstractJavaScriptConfiguration.isCompatible(expectedBrowser, browser)) { + if (expectedBrowser == browser) { features_.add(features); } } @@ -598,7 +645,7 @@ public String getVendor() { /** * Returns the browser locale. - * Default value is {@link #LANGUAGE_ENGLISH_US} if not explicitly configured. + * Default value is ENGLISH_US if not explicitly configured. * @return the system locale */ public Locale getBrowserLocale() { @@ -607,7 +654,7 @@ public Locale getBrowserLocale() { /** * Returns the browser application language, for example "en-us". - * Default value is {@link #LANGUAGE_ENGLISH_US} if not explicitly configured. + * Default value is ENGLISH_US if not explicitly configured. * @return the browser application language * @see MSDN documentation */ @@ -627,7 +674,7 @@ public boolean isOnLine() { /** * Returns the platform on which the application is running, for example "Win32". - * Default value is {@link #PLATFORM_WIN32} if not explicitly configured. + * Default value is 'Win32' if not explicitly configured. * @return the platform on which the application is running * @see MSDN documentation */ @@ -797,13 +844,47 @@ public String getUploadMimeType(final File file) { * @return the corresponding height */ public int getFontHeight(final String fontSize) { - if (fontHeights_ == null) { + if (fontHeights_ == null || fontSize.isEmpty()) { return 18; } - final int fontSizeInt = Integer.parseInt(fontSize.substring(0, fontSize.length() - 2)); + + if ("xx-small".equalsIgnoreCase(fontSize)) { + return fontHeights_[9]; + } + if ("x-small".equalsIgnoreCase(fontSize)) { + return fontHeights_[10]; + } + if ("small".equalsIgnoreCase(fontSize)) { + return fontHeights_[13]; + } + if ("medium".equalsIgnoreCase(fontSize)) { + return fontHeights_[16]; + } + if ("large".equalsIgnoreCase(fontSize)) { + return fontHeights_[18]; + } + if ("x-large".equalsIgnoreCase(fontSize)) { + return fontHeights_[24]; + } + if ("xx-large".equalsIgnoreCase(fontSize)) { + return fontHeights_[32]; + } + if ("xxx-large".equalsIgnoreCase(fontSize)) { + return fontHeights_[48]; + } + + if ("smaller".equalsIgnoreCase(fontSize)) { + return fontHeights_[13]; + } + if ("larger".equalsIgnoreCase(fontSize)) { + return fontHeights_[19]; + } + + final int fontSizeInt = CssPixelValueConverter.pixelValue(fontSize); if (fontSizeInt < fontHeights_.length) { return fontHeights_[fontSizeInt]; } + return (int) (fontSizeInt * 1.2); } @@ -1020,7 +1101,7 @@ public BrowserVersionBuilder setScriptAcceptHeader(final String scriptAcceptHead /** * @param xmlHttpRequestAcceptHeader the {@code Accept} header to be used when - * performing XMLHttpRequests + * performing XMLHttpRequests * @return this for fluent use */ public BrowserVersionBuilder setXmlHttpRequestAcceptHeader(final String xmlHttpRequestAcceptHeader) { diff --git a/src/main/java/org/htmlunit/BrowserVersionFeatures.java b/src/main/java/org/htmlunit/BrowserVersionFeatures.java index 6253793c5c7..6c26dd35f6e 100644 --- a/src/main/java/org/htmlunit/BrowserVersionFeatures.java +++ b/src/main/java/org/htmlunit/BrowserVersionFeatures.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -90,7 +90,11 @@ public enum BrowserVersionFeatures { @BrowserFeature({FF, FF_ESR}) EVENT_ONPOPSTATE_DOCUMENT_CREATE_NOT_SUPPORTED, - /** Supports event type 'TextEvent'. */ + /** Scroll events are of type 'UIEvent'. */ + @BrowserFeature({FF, FF_ESR}) + EVENT_SCROLL_UIEVENT, + + /** Supports event type 'MutationEvent'. */ @BrowserFeature({FF, FF_ESR}) EVENT_TYPE_MUTATIONEVENT, @@ -133,7 +137,7 @@ public enum BrowserVersionFeatures { HTMLDOCUMENT_ELEMENTS_BY_NAME_EMPTY, /** Calls to document.XYZ also looks at frames. */ - @BrowserFeature({CHROME, EDGE}) + @BrowserFeature({CHROME, EDGE, FF}) HTMLDOCUMENT_GET_ALSO_FRAMES, /** Removing the active element from the dom tree triggers the onblur event. */ @@ -156,10 +160,6 @@ public enum BrowserVersionFeatures { @BrowserFeature({CHROME, EDGE}) HTMLIMAGE_HTMLUNKNOWNELEMENT, - /** Clicking an image input submits the value as param if defined. */ - @BrowserFeature({CHROME, EDGE}) - HTMLIMAGE_NAME_VALUE_PARAMS, - /** HTMLInputElement image type is not supported. */ @BrowserFeature({CHROME, EDGE}) HTMLINPUT_TYPE_IMAGE_IGNORES_CUSTOM_VALIDITY, @@ -172,6 +172,10 @@ public enum BrowserVersionFeatures { @BrowserFeature({CHROME, EDGE}) HTMLINPUT_TYPE_WEEK_SUPPORTED, + /** For a stylesheet link report an error if the response type is not text/css. */ + @BrowserFeature({FF, FF_ESR}) + HTMLLINK_CHECK_RESPONSE_TYPE_FOR_STYLESHEET, + /** If the type is present for a link only use if type is text/css. */ @BrowserFeature({CHROME, EDGE}) HTMLLINK_CHECK_TYPE_FOR_STYLESHEET, @@ -220,7 +224,8 @@ public enum BrowserVersionFeatures { @BrowserFeature(FF_ESR) JS_ANCHOR_PATHNAME_DETECT_WIN_DRIVES_URL, - /** The anchor pathname detects url's starting with one letter as file url's + /** + * The anchor pathname detects url's starting with one letter as file url's * and replaces them with the file protocol. */ @BrowserFeature({CHROME, EDGE}) JS_ANCHOR_PATHNAME_DETECT_WIN_DRIVES_URL_REPLACE, @@ -265,6 +270,22 @@ public enum BrowserVersionFeatures { @BrowserFeature(FF) JS_CLIENTHEIGHT_RADIO_CHECKBOX_14, + /** ClientHeight for rb is 17. */ + @BrowserFeature({FF, FF_ESR}) + JS_CLIENTHEIGHT_RB_17, + + /** ClientHeight for rt is 9. */ + @BrowserFeature({FF, FF_ESR}) + JS_CLIENTHEIGHT_RT_9, + + /** ClientHeight for ruby is 17. */ + @BrowserFeature({FF, FF_ESR}) + JS_CLIENTHEIGHT_RUBY_17, + + /** ClientWidth for text/password input is 154. */ + @BrowserFeature(FF_ESR) + JS_CLIENTWIDTH_INPUT_TEXT_154, + /** ClientWidth for text/password input is 173. */ @BrowserFeature({CHROME, EDGE}) JS_CLIENTWIDTH_INPUT_TEXT_173, @@ -290,7 +311,7 @@ public enum BrowserVersionFeatures { JS_DOCUMENT_SELECTION_RANGE_COUNT, /** Javascript {@code Error.captureStackTrace}. */ - @BrowserFeature({CHROME, EDGE}) + @BrowserFeature({CHROME, EDGE, FF}) JS_ERROR_CAPTURE_STACK_TRACE, /** Javascript {@code Error.stackTraceLimit}. */ @@ -305,19 +326,10 @@ public enum BrowserVersionFeatures { @BrowserFeature({FF, FF_ESR}) JS_EVENT_KEYBOARD_CTOR_WHICH, - /** do not trigger the onload event if the frame content - * was not shown because of the csp. */ - @BrowserFeature(FF_ESR) - JS_EVENT_LOAD_SUPPRESSED_BY_CONTENT_SECURIRY_POLICY, - /** form.dispatchEvent(e) submits the form if the event is of type 'submit'. */ @BrowserFeature({FF, FF_ESR}) JS_FORM_DISPATCHEVENT_SUBMITS, - /** HTMLObject Validity isValid ignores custom error property. */ - @BrowserFeature({CHROME, EDGE}) - JS_HTML_OBJECT_VALIDITYSTATE_ISVALID_IGNORES_CUSTOM_ERROR, - /** Executes the {@code onload} handler, regardless of the whether the element was already attached to the page. */ @BrowserFeature({FF, FF_ESR}) JS_IFRAME_ALWAYS_EXECUTE_ONLOAD, @@ -412,14 +424,14 @@ public enum BrowserVersionFeatures { @BrowserFeature({FF, FF_ESR}) JS_STORAGE_PRESERVED_INCLUDED, + /** Indicates letterSpacing support percent values. */ + @BrowserFeature(FF) + JS_STYLE_LETTER_SPACING_ACCEPTS_PERCENT, + /** Indicates wordSpacing support percent values. */ @BrowserFeature({FF, FF_ESR}) JS_STYLE_WORD_SPACING_ACCEPTS_PERCENT, - /** Set span zo zero if provided value is invalid. */ - @BrowserFeature({CHROME, EDGE}) - JS_TABLE_SPAN_SET_ZERO_IF_INVALID, - /** window.getComputedStyle works with pseudo selectors without colon in front. */ @BrowserFeature({CHROME, EDGE}) JS_WINDOW_COMPUTED_STYLE_PSEUDO_ACCEPT_WITHOUT_COLON, @@ -429,10 +441,10 @@ public enum BrowserVersionFeatures { JS_WINDOW_INSTALL_TRIGGER_NULL, /** - * Difference of window.outer/inner height is 136. + * Difference of window.outer/inner height is 138. */ @BrowserFeature(EDGE) - JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_136, + JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_138, /** * Difference of window.outer/inner height is 147. @@ -443,9 +455,15 @@ public enum BrowserVersionFeatures { /** * Difference of window.outer/inner height is 91. */ - @BrowserFeature({FF, FF_ESR}) + @BrowserFeature(FF_ESR) JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_91, + /** + * Difference of window.outer/inner height is 93. + */ + @BrowserFeature(FF) + JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_93, + /** Window.getSelection returns null, if the window is not visible. */ @BrowserFeature({FF, FF_ESR}) JS_WINDOW_SELECTION_NULL_IF_INVISIBLE, diff --git a/src/main/java/org/htmlunit/Cache.java b/src/main/java/org/htmlunit/Cache.java index b9ad5bf8a86..3b9e14523d0 100644 --- a/src/main/java/org/htmlunit/Cache.java +++ b/src/main/java/org/htmlunit/Cache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -169,7 +169,7 @@ else if (response.getResponseHeaderValue(HttpHeader.LAST_MODIFIED) != null) { * @param request the request corresponding to the specified compiled script * @param response the response corresponding to the specified compiled script * @param toCache the object that is to be cached, if possible (may be for instance a compiled script or - * simply a WebResponse) + * simply a WebResponse) * @return whether the response was cached or not */ public boolean cacheIfPossible(final WebRequest request, final WebResponse response, final Object toCache) { diff --git a/src/main/java/org/htmlunit/ClipboardHandler.java b/src/main/java/org/htmlunit/ClipboardHandler.java index 5bb4ae0bacc..e00a2a57097 100644 --- a/src/main/java/org/htmlunit/ClipboardHandler.java +++ b/src/main/java/org/htmlunit/ClipboardHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/CollectingAlertHandler.java b/src/main/java/org/htmlunit/CollectingAlertHandler.java index e86c785ca5b..76ca4d2aae2 100644 --- a/src/main/java/org/htmlunit/CollectingAlertHandler.java +++ b/src/main/java/org/htmlunit/CollectingAlertHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/ConfirmHandler.java b/src/main/java/org/htmlunit/ConfirmHandler.java index 77c3727c58a..1502869f3e2 100644 --- a/src/main/java/org/htmlunit/ConfirmHandler.java +++ b/src/main/java/org/htmlunit/ConfirmHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,9 @@ * are triggered when the JavaScript function window.confirm() is invoked. * * @author Mike Bowler + * @author Ronald Brill */ +@FunctionalInterface public interface ConfirmHandler extends Serializable { /** diff --git a/src/main/java/org/htmlunit/CookieManager.java b/src/main/java/org/htmlunit/CookieManager.java index ce71e3ae66b..063e3c417da 100644 --- a/src/main/java/org/htmlunit/CookieManager.java +++ b/src/main/java/org/htmlunit/CookieManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/DefaultCredentialsProvider.java b/src/main/java/org/htmlunit/DefaultCredentialsProvider.java index 59012821abe..b9c3478866e 100644 --- a/src/main/java/org/htmlunit/DefaultCredentialsProvider.java +++ b/src/main/java/org/htmlunit/DefaultCredentialsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ public class DefaultCredentialsProvider implements CredentialsProvider, Serializ /** The {@code null} value represents any host. */ public static final String ANY_HOST = null; - /**The {@code -1} value represents any port. */ + /** The {@code -1} value represents any port. */ public static final int ANY_PORT = -1; /** The {@code null} value represents any realm. */ diff --git a/src/main/java/org/htmlunit/DefaultCssErrorHandler.java b/src/main/java/org/htmlunit/DefaultCssErrorHandler.java index 6cb7c625360..ecbc2bbc23b 100644 --- a/src/main/java/org/htmlunit/DefaultCssErrorHandler.java +++ b/src/main/java/org/htmlunit/DefaultCssErrorHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/DefaultPageCreator.java b/src/main/java/org/htmlunit/DefaultPageCreator.java index 1b0f996d933..85aff6db4ca 100644 --- a/src/main/java/org/htmlunit/DefaultPageCreator.java +++ b/src/main/java/org/htmlunit/DefaultPageCreator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -297,7 +297,7 @@ protected HtmlPage createHtmlPage(final WebResponse webResponse, final WebWindow final HtmlPage page = new HtmlPage(webResponse, webWindow); webWindow.setEnclosedPage(page); - HTML_PARSER.parse(webResponse, page, false, false); + HTML_PARSER.parse(webWindow.getWebClient(), webResponse, page, false, false); return page; } @@ -313,7 +313,7 @@ protected XHtmlPage createXHtmlPage(final WebResponse webResponse, final WebWind final XHtmlPage page = new XHtmlPage(webResponse, webWindow); webWindow.setEnclosedPage(page); - HTML_PARSER.parse(webResponse, page, true, false); + HTML_PARSER.parse(webWindow.getWebClient(), webResponse, page, true, false); return page; } diff --git a/src/main/java/org/htmlunit/DialogWindow.java b/src/main/java/org/htmlunit/DialogWindow.java index 571a691f723..12e5e0ac4a7 100644 --- a/src/main/java/org/htmlunit/DialogWindow.java +++ b/src/main/java/org/htmlunit/DialogWindow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/DownloadedContent.java b/src/main/java/org/htmlunit/DownloadedContent.java index a3654cb8d20..29d6d2443dc 100644 --- a/src/main/java/org/htmlunit/DownloadedContent.java +++ b/src/main/java/org/htmlunit/DownloadedContent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/ElementNotFoundException.java b/src/main/java/org/htmlunit/ElementNotFoundException.java index 18341269852..3f178ad5159 100644 --- a/src/main/java/org/htmlunit/ElementNotFoundException.java +++ b/src/main/java/org/htmlunit/ElementNotFoundException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/FailingHttpStatusCodeException.java b/src/main/java/org/htmlunit/FailingHttpStatusCodeException.java index 1ccc2ff1089..98b652d6803 100644 --- a/src/main/java/org/htmlunit/FailingHttpStatusCodeException.java +++ b/src/main/java/org/htmlunit/FailingHttpStatusCodeException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/FormEncodingType.java b/src/main/java/org/htmlunit/FormEncodingType.java index d395c57c560..1033fef81f5 100644 --- a/src/main/java/org/htmlunit/FormEncodingType.java +++ b/src/main/java/org/htmlunit/FormEncodingType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/FrameContentHandler.java b/src/main/java/org/htmlunit/FrameContentHandler.java index 0bde91b58de..90917500cba 100644 --- a/src/main/java/org/htmlunit/FrameContentHandler.java +++ b/src/main/java/org/htmlunit/FrameContentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ * * @author Ronald Brill */ +@FunctionalInterface public interface FrameContentHandler { /** diff --git a/src/main/java/org/htmlunit/History.java b/src/main/java/org/htmlunit/History.java index 6122e714716..15ac7a25907 100644 --- a/src/main/java/org/htmlunit/History.java +++ b/src/main/java/org/htmlunit/History.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/HttpHeader.java b/src/main/java/org/htmlunit/HttpHeader.java index d61c962bf34..b71be6f696c 100644 --- a/src/main/java/org/htmlunit/HttpHeader.java +++ b/src/main/java/org/htmlunit/HttpHeader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/HttpMethod.java b/src/main/java/org/htmlunit/HttpMethod.java index a77391a2234..36002469782 100644 --- a/src/main/java/org/htmlunit/HttpMethod.java +++ b/src/main/java/org/htmlunit/HttpMethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/HttpWebConnection.java b/src/main/java/org/htmlunit/HttpWebConnection.java index 7f266d0ebb2..a5304245782 100644 --- a/src/main/java/org/htmlunit/HttpWebConnection.java +++ b/src/main/java/org/htmlunit/HttpWebConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -426,7 +426,8 @@ private static Charset getCharset(final Charset charset, final List 127) { return charset; } @@ -1288,6 +1289,8 @@ public synchronized String toString() { @Override public void close() { httpClientBuilder_.clear(); + sharedAuthCache_.clear(); + httpClientContextByThread_.clear(); if (connectionManager_ != null) { connectionManager_.shutdown(); diff --git a/src/main/java/org/htmlunit/ImmediateRefreshHandler.java b/src/main/java/org/htmlunit/ImmediateRefreshHandler.java index 9aa782d7d51..de10d5746cd 100644 --- a/src/main/java/org/htmlunit/ImmediateRefreshHandler.java +++ b/src/main/java/org/htmlunit/ImmediateRefreshHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/IncorrectnessListener.java b/src/main/java/org/htmlunit/IncorrectnessListener.java index c7d539e5872..be471515020 100644 --- a/src/main/java/org/htmlunit/IncorrectnessListener.java +++ b/src/main/java/org/htmlunit/IncorrectnessListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,9 @@ * that HtmlUnit can handle but that denote a badly written application. * * @author Marc Guillemot + * @author Ronald Brill */ +@FunctionalInterface public interface IncorrectnessListener { /** diff --git a/src/main/java/org/htmlunit/IncorrectnessListenerImpl.java b/src/main/java/org/htmlunit/IncorrectnessListenerImpl.java index ddf3bf0ab3d..b966c7c19e0 100644 --- a/src/main/java/org/htmlunit/IncorrectnessListenerImpl.java +++ b/src/main/java/org/htmlunit/IncorrectnessListenerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/MockWebConnection.java b/src/main/java/org/htmlunit/MockWebConnection.java index 52e5c4c6bdf..4e28befb684 100644 --- a/src/main/java/org/htmlunit/MockWebConnection.java +++ b/src/main/java/org/htmlunit/MockWebConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -386,7 +386,7 @@ public void setResponse(final URL url, final String content, final String conten * @param title the title of the page */ public void setResponseAsGenericHtml(final URL url, final String title) { - final String content = "" + title + ""; + final String content = "" + title + ""; setResponse(url, content); } diff --git a/src/main/java/org/htmlunit/NiceRefreshHandler.java b/src/main/java/org/htmlunit/NiceRefreshHandler.java index 58d61966d4e..0a369a13082 100644 --- a/src/main/java/org/htmlunit/NiceRefreshHandler.java +++ b/src/main/java/org/htmlunit/NiceRefreshHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/NicelyResynchronizingAjaxController.java b/src/main/java/org/htmlunit/NicelyResynchronizingAjaxController.java index 90e3b2b3e07..99305812765 100644 --- a/src/main/java/org/htmlunit/NicelyResynchronizingAjaxController.java +++ b/src/main/java/org/htmlunit/NicelyResynchronizingAjaxController.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/NotYetImplementedException.java b/src/main/java/org/htmlunit/NotYetImplementedException.java index e837e64928f..daeac7bdd2a 100644 --- a/src/main/java/org/htmlunit/NotYetImplementedException.java +++ b/src/main/java/org/htmlunit/NotYetImplementedException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/ObjectInstantiationException.java b/src/main/java/org/htmlunit/ObjectInstantiationException.java index 25a22cb349d..4645bcfeafb 100644 --- a/src/main/java/org/htmlunit/ObjectInstantiationException.java +++ b/src/main/java/org/htmlunit/ObjectInstantiationException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/OnbeforeunloadHandler.java b/src/main/java/org/htmlunit/OnbeforeunloadHandler.java index 401828f4fc8..232da80ac69 100644 --- a/src/main/java/org/htmlunit/OnbeforeunloadHandler.java +++ b/src/main/java/org/htmlunit/OnbeforeunloadHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/Page.java b/src/main/java/org/htmlunit/Page.java index 57f40739fe2..e721620594d 100644 --- a/src/main/java/org/htmlunit/Page.java +++ b/src/main/java/org/htmlunit/Page.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/PageCreator.java b/src/main/java/org/htmlunit/PageCreator.java index 0d134e25403..d774a5fb750 100644 --- a/src/main/java/org/htmlunit/PageCreator.java +++ b/src/main/java/org/htmlunit/PageCreator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/PrintHandler.java b/src/main/java/org/htmlunit/PrintHandler.java index cf7ebfad005..1cf16eff3da 100644 --- a/src/main/java/org/htmlunit/PrintHandler.java +++ b/src/main/java/org/htmlunit/PrintHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/PromptHandler.java b/src/main/java/org/htmlunit/PromptHandler.java index 5947e7baf0e..484aa3cc45b 100644 --- a/src/main/java/org/htmlunit/PromptHandler.java +++ b/src/main/java/org/htmlunit/PromptHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/ProxyConfig.java b/src/main/java/org/htmlunit/ProxyConfig.java index c4433cddb54..5b3aca2dbf9 100644 --- a/src/main/java/org/htmlunit/ProxyConfig.java +++ b/src/main/java/org/htmlunit/ProxyConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -156,7 +156,7 @@ public void removeHostsFromProxyBypass(final String pattern) { * configured proxy. * @param hostname the name of the host to check * @return {@code true} if the host with the specified hostname should be accessed bypassing the - * configured proxy, {@code false} otherwise. + * configured proxy, {@code false} otherwise. */ protected boolean shouldBypassProxy(final String hostname) { boolean bypass = false; diff --git a/src/main/java/org/htmlunit/RefreshHandler.java b/src/main/java/org/htmlunit/RefreshHandler.java index b05f15addb1..aec83a4600b 100644 --- a/src/main/java/org/htmlunit/RefreshHandler.java +++ b/src/main/java/org/htmlunit/RefreshHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/Screen.java b/src/main/java/org/htmlunit/Screen.java index 7c9f382d46f..739c5131858 100644 --- a/src/main/java/org/htmlunit/Screen.java +++ b/src/main/java/org/htmlunit/Screen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/ScriptException.java b/src/main/java/org/htmlunit/ScriptException.java index c8687e62bda..275b3248f57 100644 --- a/src/main/java/org/htmlunit/ScriptException.java +++ b/src/main/java/org/htmlunit/ScriptException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,8 +52,8 @@ public class ScriptException extends RuntimeException { * @param page the page in which the script causing this exception was executed * @param throwable the exception that was thrown from the script engine * @param scriptSourceCode the code that was being executed when this exception - * was thrown. This may be null if the exception was not caused by execution - * of JavaScript. + * was thrown. This may be null if the exception was not caused by execution + * of JavaScript. */ public ScriptException(final HtmlPage page, final Throwable throwable, final String scriptSourceCode) { @@ -192,7 +192,7 @@ public String getScriptSourceCode() { * thrown. * * @return the line of source or an empty string if the exception was not thrown - * due to the execution of a script. + * due to the execution of a script. */ public String getFailingLine() { final int lineNumber = getFailingLineNumber(); @@ -218,7 +218,7 @@ public String getFailingLine() { * Returns the line number of the source that was executing at the time of the exception. * * @return the line number or -1 if the exception was not thrown due to the - * execution of a script. + * execution of a script. */ public int getFailingLineNumber() { if (getCause() instanceof RhinoException) { @@ -233,7 +233,7 @@ public int getFailingLineNumber() { * Returns the column number of the source that was executing at the time of the exception. * * @return the column number or -1 if the exception was not thrown due to the - * execution of a script. + * execution of a script. */ public int getFailingColumnNumber() { if (getCause() instanceof RhinoException) { diff --git a/src/main/java/org/htmlunit/ScriptPreProcessor.java b/src/main/java/org/htmlunit/ScriptPreProcessor.java index c8eb14602fd..b5c0ede9770 100644 --- a/src/main/java/org/htmlunit/ScriptPreProcessor.java +++ b/src/main/java/org/htmlunit/ScriptPreProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/ScriptResult.java b/src/main/java/org/htmlunit/ScriptResult.java index 554c8103672..c30b5630433 100644 --- a/src/main/java/org/htmlunit/ScriptResult.java +++ b/src/main/java/org/htmlunit/ScriptResult.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/SgmlPage.java b/src/main/java/org/htmlunit/SgmlPage.java index 6b643e27f63..33250378c75 100644 --- a/src/main/java/org/htmlunit/SgmlPage.java +++ b/src/main/java/org/htmlunit/SgmlPage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -347,24 +347,23 @@ public Comment createComment(final String data) { * Create a new NodeIterator over the subtree rooted at the * specified node. * @param root The node which will be iterated together with its - * children. The NodeIterator is initially positioned - * just before this node. The whatToShow flags and the - * filter, if any, are not considered when setting this position. The - * root must not be null. + * children. The NodeIterator is initially positioned + * just before this node. The whatToShow flags and the + * filter, if any, are not considered when setting this position. The + * root must not be null. * @param whatToShow This flag specifies which node types may appear in - * the logical view of the tree presented by the - * NodeIterator. See the description of - * NodeFilter for the set of possible SHOW_ - * values.These flags can be combined using OR. + * the logical view of the tree presented by the + * NodeIterator. See the description of + * NodeFilter for the set of possible SHOW_ + * values.These flags can be combined using OR. * @param filter The NodeFilter to be used with this - * NodeIterator, or null to indicate no - * filter. + * NodeIterator, or null to indicate no + * filter. * @param entityReferenceExpansion The value of this flag determines - * whether entity reference nodes are expanded. + * whether entity reference nodes are expanded. * @return The newly created NodeIterator. * @exception DOMException - * NOT_SUPPORTED_ERR: Raised if the specified root is - * null. + * NOT_SUPPORTED_ERR: Raised if the specified root is null. */ public DomNodeIterator createNodeIterator(final Node root, final int whatToShow, final NodeFilter filter, final boolean entityReferenceExpansion) throws DOMException { diff --git a/src/main/java/org/htmlunit/SilentCssErrorHandler.java b/src/main/java/org/htmlunit/SilentCssErrorHandler.java index 88d44bf8f9d..c7022d09a81 100644 --- a/src/main/java/org/htmlunit/SilentCssErrorHandler.java +++ b/src/main/java/org/htmlunit/SilentCssErrorHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/SilentIncorrectnessListener.java b/src/main/java/org/htmlunit/SilentIncorrectnessListener.java index fe95df873b2..e8e1dfa1995 100644 --- a/src/main/java/org/htmlunit/SilentIncorrectnessListener.java +++ b/src/main/java/org/htmlunit/SilentIncorrectnessListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/StatusHandler.java b/src/main/java/org/htmlunit/StatusHandler.java index f1a7a07c8d4..2ea5ff8be5b 100644 --- a/src/main/java/org/htmlunit/StatusHandler.java +++ b/src/main/java/org/htmlunit/StatusHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/StorageHolder.java b/src/main/java/org/htmlunit/StorageHolder.java index 73e4e970334..19b917817a7 100644 --- a/src/main/java/org/htmlunit/StorageHolder.java +++ b/src/main/java/org/htmlunit/StorageHolder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/StringWebResponse.java b/src/main/java/org/htmlunit/StringWebResponse.java index 5ac6e4e6464..0f1d0fbd791 100644 --- a/src/main/java/org/htmlunit/StringWebResponse.java +++ b/src/main/java/org/htmlunit/StringWebResponse.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/TextPage.java b/src/main/java/org/htmlunit/TextPage.java index fe21deaf77f..1c30e4c721d 100644 --- a/src/main/java/org/htmlunit/TextPage.java +++ b/src/main/java/org/htmlunit/TextPage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/ThreadedRefreshHandler.java b/src/main/java/org/htmlunit/ThreadedRefreshHandler.java index b2925a38d2a..756f11401e8 100644 --- a/src/main/java/org/htmlunit/ThreadedRefreshHandler.java +++ b/src/main/java/org/htmlunit/ThreadedRefreshHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/TopLevelWindow.java b/src/main/java/org/htmlunit/TopLevelWindow.java index 99bf5c5dfa4..178006f2c30 100644 --- a/src/main/java/org/htmlunit/TopLevelWindow.java +++ b/src/main/java/org/htmlunit/TopLevelWindow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -115,7 +115,7 @@ public void close() { * * Closes this window. * @param ignoreOnbeforeunloadAccepted if true the result of triggering the OnbeforeunloadAccepted event - * will be ignored + * will be ignored */ public void close(final boolean ignoreOnbeforeunloadAccepted) { final Page page = getEnclosedPage(); diff --git a/src/main/java/org/htmlunit/UnexpectedPage.java b/src/main/java/org/htmlunit/UnexpectedPage.java index 2040e4afaf0..faa027e247d 100644 --- a/src/main/java/org/htmlunit/UnexpectedPage.java +++ b/src/main/java/org/htmlunit/UnexpectedPage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/Version.java b/src/main/java/org/htmlunit/Version.java index d737e259004..dcb6d452021 100644 --- a/src/main/java/org/htmlunit/Version.java +++ b/src/main/java/org/htmlunit/Version.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -79,6 +79,6 @@ public static String getProductVersion() { * @return the copyright notice */ public static String getCopyright() { - return "Copyright (c) 2002-2024 Gargoyle Software Inc. All rights reserved."; + return "Copyright (c) 2002-2025 Gargoyle Software Inc. All rights reserved."; } } diff --git a/src/main/java/org/htmlunit/WaitingRefreshHandler.java b/src/main/java/org/htmlunit/WaitingRefreshHandler.java index 91186fce65b..1d26563b47d 100644 --- a/src/main/java/org/htmlunit/WaitingRefreshHandler.java +++ b/src/main/java/org/htmlunit/WaitingRefreshHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/WebAssert.java b/src/main/java/org/htmlunit/WebAssert.java index ceaa25d46fd..612e444cc46 100644 --- a/src/main/java/org/htmlunit/WebAssert.java +++ b/src/main/java/org/htmlunit/WebAssert.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/WebClient.java b/src/main/java/org/htmlunit/WebClient.java index 08f92818e53..0baa51a91b9 100644 --- a/src/main/java/org/htmlunit/WebClient.java +++ b/src/main/java/org/htmlunit/WebClient.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -99,6 +99,10 @@ import org.htmlunit.util.MimeType; import org.htmlunit.util.NameValuePair; import org.htmlunit.util.UrlUtils; +import org.htmlunit.websocket.JettyWebSocketAdapter.JettyWebSocketAdapterFactory; +import org.htmlunit.websocket.WebSocketAdapter; +import org.htmlunit.websocket.WebSocketAdapterFactory; +import org.htmlunit.websocket.WebSocketListener; import org.htmlunit.webstart.WebStartHandler; /** @@ -147,6 +151,7 @@ * @author René Schwietzke * @author Sven Strickroth */ +@SuppressWarnings("PMD.TooManyFields") public class WebClient implements Serializable, AutoCloseable { /** Logging support. */ @@ -191,6 +196,7 @@ public class WebClient implements Serializable, AutoCloseable { private transient WebConnection webConnection_; private CredentialsProvider credentialsProvider_ = new DefaultCredentialsProvider(); private CookieManager cookieManager_ = new CookieManager(); + private WebSocketAdapterFactory webSocketAdapterFactory_; private transient AbstractJavaScriptEngine scriptEngine_; private transient List loadQueue_; private final Map requestHeaders_ = Collections.synchronizedMap(new HashMap<>(89)); @@ -332,6 +338,8 @@ public WebClient(final BrowserVersion browserVersion, final boolean javaScriptEn } loadQueue_ = new ArrayList<>(); + webSocketAdapterFactory_ = new JettyWebSocketAdapterFactory(); + // The window must be constructed AFTER the script engine. currentWindowTracker_ = new CurrentWindowTracker(this, true); currentWindow_ = new TopLevelWindow("", this); @@ -507,7 +515,8 @@

P getPage(final WebWindow webWindow, final WebRequest webReques /** * Convenient method to build a URL and load it into the current WebWindow as it would be done * by {@link #getPage(WebWindow, WebRequest)}. - * @param url the URL of the new content + * @param url the URL of the new content; in contrast to real browsers plain file url's are not supported. + * You have to use the 'file', 'data', 'blob', 'http' or 'https' protocol. * @param

the page type * @return the new page * @throws FailingHttpStatusCodeException if the server returns a failing status code AND the property @@ -523,7 +532,8 @@ public

P getPage(final String url) throws IOException, FailingH /** * Convenient method to load a URL into the current top WebWindow as it would be done * by {@link #getPage(WebWindow, WebRequest)}. - * @param url the URL of the new content + * @param url the URL of the new content; in contrast to real browsers plain file url's are not supported. + * You have to use the 'file', 'data', 'blob', 'http' or 'https' protocol. * @param

the page type * @return the new page * @throws FailingHttpStatusCodeException if the server returns a failing status code AND the property @@ -534,7 +544,6 @@ public

P getPage(final URL url) throws IOException, FailingHttp final WebRequest request = new WebRequest(url, getBrowserVersion().getHtmlAcceptHeader(), getBrowserVersion().getAcceptEncodingHeader()); request.setCharset(UTF_8); - return getPage(getCurrentWindow().getTopWindow(), request); } @@ -589,7 +598,7 @@ public Page loadWebResponseInto(final WebResponse webResponse, final WebWindow w * @param webResponse the response that will be used to create the new page * @param webWindow the window that the new page will be placed within * @param forceAttachmentWithFilename if not {@code null}, handle this as an attachment with the specified name - * or if an empty string ("") use the filename provided in the response + * or if an empty string ("") use the filename provided in the response * @throws IOException if an IO error occurs * @throws FailingHttpStatusCodeException if the server returns a failing status code AND the property * {@link WebClientOptions#setThrowExceptionOnFailingStatusCode(boolean)} is set to true @@ -1539,7 +1548,8 @@ private WebResponse makeWebResponseForJavaScriptUrl(final WebWindow webWindow, f * @return the WebResponse */ public WebResponse loadWebResponse(final WebRequest webRequest) throws IOException { - switch (webRequest.getUrl().getProtocol()) { + final String protocol = webRequest.getUrl().getProtocol(); + switch (protocol) { case UrlUtils.ABOUT: return makeWebResponseForAboutUrl(webRequest); @@ -1552,8 +1562,12 @@ public WebResponse loadWebResponse(final WebRequest webRequest) throws IOExcepti case "blob": return makeWebResponseForBlobUrl(webRequest); - default: + case "http": + case "https": return loadWebResponseFromWebConnection(webRequest, ALLOWED_REDIRECTIONS_SAME_URL); + + default: + throw new IOException("Unsupported protocol '" + protocol + "'"); } } @@ -2080,7 +2094,7 @@ public void setClipboardHandler(final ClipboardHandler handler) { /** * Returns the current {@link PrintHandler}. * @return the current {@link PrintHandler} or null if print - * requests are ignored + * requests are ignored */ public PrintHandler getPrintHandler() { return printHandler_; @@ -2091,7 +2105,7 @@ public PrintHandler getPrintHandler() { * (Printing Spec). * * @param handler the new {@link PrintHandler} or null if you like to - * ignore print requests (default is null) + * ignore print requests (default is null) */ public void setPrintHandler(final PrintHandler handler) { printHandler_ = handler; @@ -2471,8 +2485,44 @@ public int waitForBackgroundJavaScript(final long timeoutMillis) { * method returns; will be 0 if there are no jobs left to execute */ public int waitForBackgroundJavaScriptStartingBefore(final long delayMillis) { + return waitForBackgroundJavaScriptStartingBefore(delayMillis, -1); + } + + /** + *

Experimental API: May be changed in next release + * and may not yet work perfectly!

+ * + *

This method blocks until all background JavaScript tasks scheduled to start executing before + * (now + delayMillis) have finished executing. Background JavaScript tasks are JavaScript + * tasks scheduled for execution via window.setTimeout, window.setInterval or + * asynchronous XMLHttpRequest.

+ * + *

If there is no background JavaScript task currently executing, and there is no background JavaScript + * task scheduled to start executing within the specified time, this method returns immediately -- even + * if there are tasks scheduled to be executed after (now + delayMillis).

+ * + *

Note that the total time spent executing a background JavaScript task is never known ahead of + * time, so this method makes no guarantees as to how long it will block.

+ * + *

Use this method instead of {@link #waitForBackgroundJavaScript(long)} if you know roughly when + * your background JavaScript is supposed to start executing, but you're not necessarily sure how long + * it will take to execute.

+ * + * @param delayMillis the delay which determines the background tasks to wait for (in milliseconds) + * @param timeoutMillis the maximum amount of time to wait (in milliseconds); this has to be larger than + * the delayMillis parameter, otherwise the timeout is ignored + * @return the number of background JavaScript jobs still executing or waiting to be executed when this + * method returns; will be 0 if there are no jobs left to execute + */ + public int waitForBackgroundJavaScriptStartingBefore(final long delayMillis, final long timeoutMillis) { int count = 0; - final long endTime = System.currentTimeMillis() + delayMillis; + long now = System.currentTimeMillis(); + final long endTime = now + delayMillis; + long endTimeout = now + timeoutMillis; + if (timeoutMillis < 0 || timeoutMillis < delayMillis) { + endTimeout = -1; + } + for (Iterator> i = jobManagers_.iterator(); i.hasNext();) { final JavaScriptJobManager jobManager; final WeakReference reference; @@ -2489,12 +2539,16 @@ public int waitForBackgroundJavaScriptStartingBefore(final long delayMillis) { count = 0; continue; } - final long newDelay = endTime - System.currentTimeMillis(); - count += jobManager.waitForJobsStartingBefore(newDelay); + now = System.currentTimeMillis(); + final long newDelay = endTime - now; + final long newTimeout = (endTimeout == -1) ? -1 : endTimeout - now; + count += jobManager.waitForJobsStartingBefore(newDelay, newTimeout); } if (count != getAggregateJobCount()) { - final long newDelay = endTime - System.currentTimeMillis(); - return waitForBackgroundJavaScriptStartingBefore(newDelay); + now = System.currentTimeMillis(); + final long newDelay = endTime - now; + final long newTimeout = (endTimeout == -1) ? -1 : endTimeout - now; + return waitForBackgroundJavaScriptStartingBefore(newDelay, newTimeout); } return count; } @@ -2540,6 +2594,7 @@ private void readObject(final ObjectInputStream in) throws IOException, ClassNot scriptEngine_ = new JavaScriptEngine(this); jobManagers_ = Collections.synchronizedList(new ArrayList<>()); loadQueue_ = new ArrayList<>(); + css3ParserPool_ = new CSS3ParserPool(); } private static class LoadJob { @@ -2589,13 +2644,12 @@ public boolean isOutdated() { * @param target the name of the target window * @param request the request to perform * @param checkHash if true check for hashChenage - * @param forceLoad if true always load the request even if there is already the same in the queue * @param forceAttachmentWithFilename if not {@code null} the AttachmentHandler isAttachment() method is not called, - * the response has to be handled as attachment in any case + * the response has to be handled as attachment in any case * @param description information about the origin of the request. Useful for debugging. */ public void download(final WebWindow requestingWindow, final String target, - final WebRequest request, final boolean checkHash, final boolean forceLoad, + final WebRequest request, final boolean checkHash, final String forceAttachmentWithFilename, final String description) { final WebWindow targetWindow = resolveWindow(requestingWindow, target); @@ -2632,9 +2686,7 @@ public void download(final WebWindow requestingWindow, final String target, final WebRequest otherRequest = otherLoadJob.request_; final URL otherUrl = otherRequest.getUrl(); - // TODO: investigate but it seems that IE considers query string too but not FF - if (!forceLoad - && url.getPath().equals(otherUrl.getPath()) // fail fast + if (url.getPath().equals(otherUrl.getPath()) // fail fast && url.toString().equals(otherUrl.toString()) && request.getRequestParameters().equals(otherRequest.getRequestParameters()) && Objects.equals(request.getRequestBody(), otherRequest.getRequestBody())) { @@ -2863,7 +2915,7 @@ public HtmlPage loadHtmlCodeIntoCurrentWindow(final String htmlCode) throws IOEx final HtmlPage page = new HtmlPage(webResponse, webWindow); webWindow.setEnclosedPage(page); - htmlParser.parse(webResponse, page, false, false); + htmlParser.parse(this, webResponse, page, false, false); return page; } @@ -2884,15 +2936,34 @@ public XHtmlPage loadXHtmlCodeIntoCurrentWindow(final String xhtmlCode) throws I final XHtmlPage page = new XHtmlPage(webResponse, webWindow); webWindow.setEnclosedPage(page); - htmlParser.parse(webResponse, page, true, false); + htmlParser.parse(this, webResponse, page, true, false); return page; } + /** + * Creates a new {@link WebSocketAdapter}. + * + * @param webSocketListener the {@link WebSocketListener} + * @return a new {@link WebSocketAdapter} + */ + public WebSocketAdapter buildWebSocketAdapter(final WebSocketListener webSocketListener) { + return webSocketAdapterFactory_.buildWebSocketAdapter(this, webSocketListener); + } + + /** + * Defines a new factory method to create a new WebSocketAdapter. + * + * @param factory a {@link WebSocketAdapterFactory} + */ + public void setWebSocketAdapter(final WebSocketAdapterFactory factory) { + webSocketAdapterFactory_ = factory; + } + /** * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
* * @return a CSS3Parser that will return to an internal pool for reuse if closed using the - * try-with-resource concept + * try-with-resource concept */ public PooledCSS3Parser getCSS3Parser() { return this.css3ParserPool_.get(); @@ -2919,7 +2990,7 @@ static class CSS3ParserPool { * Our pool. We only hold data when it is available. In addition, synchronization against * this deque is cheap. */ - private ConcurrentLinkedDeque parsers_ = new ConcurrentLinkedDeque<>(); + private final ConcurrentLinkedDeque parsers_ = new ConcurrentLinkedDeque<>(); /** * Fetch a new or recycled CSS3parser. Make sure you use the try-with-resource concept diff --git a/src/main/java/org/htmlunit/WebClientOptions.java b/src/main/java/org/htmlunit/WebClientOptions.java index 030d13981f1..71d0df3aacf 100644 --- a/src/main/java/org/htmlunit/WebClientOptions.java +++ b/src/main/java/org/htmlunit/WebClientOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ * @author Madis Pärn * @author Ronald Brill */ +@SuppressWarnings("PMD.TooManyFields") public class WebClientOptions implements Serializable { /** 1920. */ @@ -53,9 +54,9 @@ public class WebClientOptions implements Serializable { private boolean isRedirectEnabled_ = true; private File tempFileDirectory_; - private KeyStore sslClientCertificateStore_; + private transient KeyStore sslClientCertificateStore_; private char[] sslClientCertificatePassword_; - private KeyStore sslTrustStore_; + private transient KeyStore sslTrustStore_; private String[] sslClientProtocols_; private String[] sslClientCipherSuites_; @@ -82,6 +83,8 @@ public class WebClientOptions implements Serializable { private boolean geolocationEnabled_; private Geolocation geolocation_; + private int nekoReaderBufferSize_ = -1; + private boolean webSocketEnabled_ = true; private int webSocketMaxTextMessageSize_ = -1; private int webSocketMaxTextMessageBufferSize_ = -1; @@ -188,6 +191,7 @@ public boolean isRedirectEnabled() { * In some cases the impl seems to pick old certificates from the {@link KeyStore}. To avoid * that, wrap your {@link KeyStore} inside your own {@link KeyStore} impl and filter out outdated * certificates. + *

This property is transient (because KeyStore is not serializable) * * @param keyStore {@link KeyStore} to use * @param keyStorePassword the keystore password @@ -205,6 +209,7 @@ public void setSSLClientCertificateKeyStore(final KeyStore keyStore, final char[ * "sun.security.ssl.allowUnsafeRenegotiation" to true, as hinted in * * TLS Renegotiation Issue. + *

This property is transient (because KeyStore is not serializable) * * @param keyStoreUrl the URL which locates the certificate {@link KeyStore} * @param keyStorePassword the certificate {@link KeyStore} password @@ -253,6 +258,8 @@ public void setSSLClientCertificateKeyStore(final InputStream keyStoreInputStrea /** * Gets the SSLClientCertificateStore. + *

This property is transient (because KeyStore is not serializable) + * * @return the KeyStore for use on SSL connections */ public KeyStore getSSLClientCertificateStore() { @@ -541,8 +548,8 @@ public String getSSLInsecureProtocol() { /** * Sets the SSL server certificate trust store. All server certificates will be validated against * this trust store. - *

- * The needed parameters are used to construct a {@link java.security.KeyStore}. + *

This property is transient (because KeyStore is not serializable) + *

The needed parameters are used to construct a {@link java.security.KeyStore}. * * @param sslTrustStoreUrl the URL which locates the trust store * @param sslTrustStorePassword the trust store password @@ -564,6 +571,7 @@ void setSSLTrustStore(final KeyStore keyStore) { /** * Gets the SSL TrustStore. + *

This property is transient (because KeyStore is not serializable) * @return the SSL TrustStore for insecure SSL connections */ public KeyStore getSSLTrustStore() { @@ -635,8 +643,8 @@ public int getHistoryPageCacheLimit() { * entries in the history. For older entries only the url is saved; the page * will be (re)retrieved on demand. * @param historyPageCacheLimit maximum number of pages to cache in history - * default is Integer.MAX_VALUE; negative values are having the same effect - * as setting this to zero. + * default is Integer.MAX_VALUE; negative values are having the same effect + * as setting this to zero. */ public void setHistoryPageCacheLimit(final int historyPageCacheLimit) { historyPageCacheLimit_ = historyPageCacheLimit; @@ -720,6 +728,22 @@ public int getScreenHeight() { return screenHeight_; } + /** + * @return the Neko Html parser reader buffer size + */ + public int getNekoReaderBufferSize() { + return nekoReaderBufferSize_; + } + + /** + * Sets the Neko Html parser reader buffer size. + * + * @param nekoReaderBufferSize the new value + */ + public void setNekoReaderBufferSize(final int nekoReaderBufferSize) { + nekoReaderBufferSize_ = nekoReaderBufferSize; + } + /** * Enables/disables WebSocket support. By default, this property is enabled. * @@ -848,7 +872,10 @@ public void setGeolocation(final Geolocation geolocation) { geolocation_ = geolocation; } - public static class Geolocation { + /** + * Support class for Geolocation. + */ + public static class Geolocation implements Serializable { private final double accuracy_; private final double latitude_; private final double longitude_; diff --git a/src/main/java/org/htmlunit/WebConnection.java b/src/main/java/org/htmlunit/WebConnection.java index 758d96744f6..956d3f41f93 100644 --- a/src/main/java/org/htmlunit/WebConnection.java +++ b/src/main/java/org/htmlunit/WebConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/WebConsole.java b/src/main/java/org/htmlunit/WebConsole.java index 8d3de6d1b90..1656f3bf7bf 100644 --- a/src/main/java/org/htmlunit/WebConsole.java +++ b/src/main/java/org/htmlunit/WebConsole.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/WebRequest.java b/src/main/java/org/htmlunit/WebRequest.java index 2ef4fd3857b..137225f8c17 100644 --- a/src/main/java/org/htmlunit/WebRequest.java +++ b/src/main/java/org/htmlunit/WebRequest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,8 +54,12 @@ * @author Lai Quang Duong * @author Kristof Neirynck */ +@SuppressWarnings("PMD.TooManyFields") public class WebRequest implements Serializable { + /** + * Enum to configure request creation. + */ public enum HttpHint { /** Force to include the charset. */ IncludeCharsetInContentTypeHeader, @@ -456,7 +460,7 @@ public String getRequestBody() { * Other request types result in {@link RuntimeException}. * Should not be used in combination with {@link #setRequestParameters(List) request parameters}. * @param requestBody the body content to be submitted if this is a {@code POST}, {@code PUT} - * or {@code PATCH} request + * or {@code PATCH} request * @throws RuntimeException if the request parameters have already been set * or this is not a {@code POST}, {@code PUT} or {@code PATCH} request. */ @@ -556,17 +560,6 @@ public void setRefererHeader(final URL url) { } } - /** - * Sets the referer HTTP header - only if the provided url is valid. - * @param url the url for the referer HTTP header - * - * @deprecated as of version 4.5.0; use {@link #setRefererHeader(URL)} instead - */ - @Deprecated - public void setRefererlHeader(final URL url) { - setRefererHeader(url); - } - /** * Sets the specified name/value pair in the additional HTTP headers. * @param name the name of the additional HTTP header @@ -655,6 +648,10 @@ public void setDefaultResponseContentCharset(final Charset defaultResponseConten this.defaultResponseContentCharset_ = Objects.requireNonNull(defaultResponseContentCharset); } + /** + * @param hint the hint to check for + * @return true if the hint is enabled + */ public boolean hasHint(final HttpHint hint) { if (httpHints_ == null) { return false; @@ -662,6 +659,10 @@ public boolean hasHint(final HttpHint hint) { return httpHints_.contains(hint); } + /** + * Enables the hint. + * @param hint the hint to add + */ public void addHint(final HttpHint hint) { if (httpHints_ == null) { httpHints_ = EnumSet.noneOf(HttpHint.class); diff --git a/src/main/java/org/htmlunit/WebResponse.java b/src/main/java/org/htmlunit/WebResponse.java index c54359fd360..4661bde6bb1 100644 --- a/src/main/java/org/htmlunit/WebResponse.java +++ b/src/main/java/org/htmlunit/WebResponse.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -174,25 +174,6 @@ public Charset getHeaderContentCharset() { return EncodingSniffer.extractEncodingFromContentType(contentType); } - /** - * Returns the content charset specified explicitly in the header or in the content, - * or {@code null} if none was specified. - * @return the content charset specified explicitly in the header or in the content, - * or {@code null} if none was specified - * - * @deprecated as of version 4.0.0; use {@link #getContentCharset()} instead - */ - @Deprecated - public Charset getContentCharsetOrNull() { - try (InputStream is = getContentAsStream()) { - return EncodingSniffer.sniffEncoding(getResponseHeaders(), is); - } - catch (final IOException e) { - LOG.warn("Error trying to sniff encoding.", e); - return null; - } - } - /** * Returns the content charset for this response, even if no charset was specified explicitly. *

@@ -257,9 +238,9 @@ public Charset getContentCharset() { * For example, HTML meta-tag sniffing can be fooled by text that looks-like-a-meta-tag inside * JavaScript code (false positive) or if the meta-tag is after the first 1024 bytes (false negative). * @return {@code true} if the charset of the previous call to {@link #getContentCharset()} was - * "tentative". + * "tentative". * @see - * https://html.spec.whatwg.org/multipage/parsing.html#concept-encoding-confidence + * https://html.spec.whatwg.org/multipage/parsing.html#concept-encoding-confidence */ public boolean wasContentCharsetTentative() { return wasContentCharsetTentative_; @@ -268,7 +249,7 @@ public boolean wasContentCharsetTentative() { /** * Returns the response content as a string, using the charset/encoding specified in the server response. * @return the response content as a string, using the charset/encoding specified in the server response - * or null if the content retrieval was failing + * or null if the content retrieval was failing */ public String getContentAsString() { return getContentAsString(getContentCharset()); @@ -362,15 +343,6 @@ public void cleanUp() { } } - /** - * Mark this response for using UTF-8 as default charset. - * @deprecated as of version 4.0.0; use {@link WebRequest#setDefaultResponseContentCharset(Charset)} instead - */ - @Deprecated - public void defaultCharsetUtf8() { - getWebRequest().setDefaultResponseContentCharset(UTF_8); - } - /** * @return true if the 2xx */ diff --git a/src/main/java/org/htmlunit/WebResponseData.java b/src/main/java/org/htmlunit/WebResponseData.java index bd9b11f9d5f..6f55e37a4ab 100644 --- a/src/main/java/org/htmlunit/WebResponseData.java +++ b/src/main/java/org/htmlunit/WebResponseData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -113,7 +113,7 @@ private InputStream getStream(final ByteOrderMark... bomHeaders) throws IOExcept LOG.error("Reading gzip encodec content failed.", e); stream.close(); stream = IOUtils.toInputStream( - "\n" + "\n" + "Problem loading page\n" + "\n" + "

Content Encoding Error

\n" @@ -136,7 +136,7 @@ private InputStream getStream(final ByteOrderMark... bomHeaders) throws IOExcept LOG.error("Reading Brotli encodec content failed.", e); stream.close(); stream = IOUtils.toInputStream( - "\n" + "\n" + "Problem loading page\n" + "\n" + "

Content Encoding Error

\n" diff --git a/src/main/java/org/htmlunit/WebResponseFromCache.java b/src/main/java/org/htmlunit/WebResponseFromCache.java index 1354fbaf09f..287d62fe213 100644 --- a/src/main/java/org/htmlunit/WebResponseFromCache.java +++ b/src/main/java/org/htmlunit/WebResponseFromCache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/WebWindow.java b/src/main/java/org/htmlunit/WebWindow.java index b6b44ecb0b0..09612fd7ce4 100644 --- a/src/main/java/org/htmlunit/WebWindow.java +++ b/src/main/java/org/htmlunit/WebWindow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,7 +71,7 @@ public interface WebWindow extends Serializable { * is a top level window, then return this window. * * @return the top level window that contains this window or this - * window if there is no parent. + * window if there is no parent. */ WebWindow getTopWindow(); @@ -187,15 +187,15 @@ public interface WebWindow extends Serializable { Screen getScreen(); /** - * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
- * + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * * Returns computed style of the element. Computed style represents the final computed values * of all CSS properties for the element. This method's return value is of the same type as * that of element.style, but the value returned by this method is read-only. * * @param element the element * @param pseudoElement a string specifying the pseudo-element to match (may be {@code null}); - * e.g. ':before' + * e.g. ':before' * @return the computed style */ ComputedCssStyleDeclaration getComputedStyle(DomElement element, String pseudoElement); diff --git a/src/main/java/org/htmlunit/WebWindowAdapter.java b/src/main/java/org/htmlunit/WebWindowAdapter.java index c6f71d85dba..e23da1d128d 100644 --- a/src/main/java/org/htmlunit/WebWindowAdapter.java +++ b/src/main/java/org/htmlunit/WebWindowAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/WebWindowEvent.java b/src/main/java/org/htmlunit/WebWindowEvent.java index b1e440081a5..bbe17d7b1dc 100644 --- a/src/main/java/org/htmlunit/WebWindowEvent.java +++ b/src/main/java/org/htmlunit/WebWindowEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -169,7 +169,9 @@ public String toString() { return builder.toString(); } - /** @return the event type */ + /** + * @return the event type + */ public int getEventType() { return type_; } diff --git a/src/main/java/org/htmlunit/WebWindowImpl.java b/src/main/java/org/htmlunit/WebWindowImpl.java index 9d3f4fcb536..0fa11202ca0 100644 --- a/src/main/java/org/htmlunit/WebWindowImpl.java +++ b/src/main/java/org/htmlunit/WebWindowImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,9 +15,10 @@ package org.htmlunit; import static org.htmlunit.BrowserVersionFeatures.JS_WINDOW_COMPUTED_STYLE_PSEUDO_ACCEPT_WITHOUT_COLON; -import static org.htmlunit.BrowserVersionFeatures.JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_136; +import static org.htmlunit.BrowserVersionFeatures.JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_138; import static org.htmlunit.BrowserVersionFeatures.JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_147; import static org.htmlunit.BrowserVersionFeatures.JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_91; +import static org.htmlunit.BrowserVersionFeatures.JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_93; import java.io.IOException; import java.io.ObjectInputStream; @@ -88,8 +89,12 @@ public WebWindowImpl(final WebClient webClient) { outerHeight_ = innerHeight_ + 91; outerWidth_ = innerWidth_ + 12; } - else if (webClient.getBrowserVersion().hasFeature(JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_136)) { - outerHeight_ = innerHeight_ + 136; + else if (webClient.getBrowserVersion().hasFeature(JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_93)) { + outerHeight_ = innerHeight_ + 93; + outerWidth_ = innerWidth_ + 16; + } + else if (webClient.getBrowserVersion().hasFeature(JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_138)) { + outerHeight_ = innerHeight_ + 138; outerWidth_ = innerWidth_ + 24; } else if (webClient.getBrowserVersion().hasFeature(JS_WINDOW_OUTER_INNER_HEIGHT_DIFF_147)) { diff --git a/src/main/java/org/htmlunit/WebWindowListener.java b/src/main/java/org/htmlunit/WebWindowListener.java index 9c2752ef638..e111fc50c70 100644 --- a/src/main/java/org/htmlunit/WebWindowListener.java +++ b/src/main/java/org/htmlunit/WebWindowListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,10 @@ * process. This implies, the initial window is already open at the time you attach this listener. * Therefore you will receive no open event for this. *

+ *

+ * Caution: Frames and also iFrames are handled as separate windows. Therefore the listener is also + * called for each and every containing (i)Frame when e.g. closing a {@link TopLevelWindow}. + *

* * @author Mike Bowler * @author Ronald Brill @@ -37,7 +41,7 @@ public interface WebWindowListener { * This usually takes place AFTER the event was processed

* * @param event the event (the oldPage and newPage properties will be {@code null} - * because the event is generated after the window is opened but before the content is loaded) + * because the event is generated after the window is opened but before the content is loaded) */ void webWindowOpened(WebWindowEvent event); diff --git a/src/main/java/org/htmlunit/WebWindowNotFoundException.java b/src/main/java/org/htmlunit/WebWindowNotFoundException.java index 8c40836c47e..a0624ad929e 100644 --- a/src/main/java/org/htmlunit/WebWindowNotFoundException.java +++ b/src/main/java/org/htmlunit/WebWindowNotFoundException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/attachment/Attachment.java b/src/main/java/org/htmlunit/attachment/Attachment.java index 2aeab16c191..3c2c0682897 100644 --- a/src/main/java/org/htmlunit/attachment/Attachment.java +++ b/src/main/java/org/htmlunit/attachment/Attachment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/attachment/AttachmentHandler.java b/src/main/java/org/htmlunit/attachment/AttachmentHandler.java index 6835646fcce..fa0e5138fe4 100644 --- a/src/main/java/org/htmlunit/attachment/AttachmentHandler.java +++ b/src/main/java/org/htmlunit/attachment/AttachmentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/attachment/CollectingAttachmentHandler.java b/src/main/java/org/htmlunit/attachment/CollectingAttachmentHandler.java index 8d63e7f30e1..3bd87518d39 100644 --- a/src/main/java/org/htmlunit/attachment/CollectingAttachmentHandler.java +++ b/src/main/java/org/htmlunit/attachment/CollectingAttachmentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/attachment/DownloadingAttachmentHandler.java b/src/main/java/org/htmlunit/attachment/DownloadingAttachmentHandler.java index 80ab43ffd5f..92d80ffe9ec 100644 --- a/src/main/java/org/htmlunit/attachment/DownloadingAttachmentHandler.java +++ b/src/main/java/org/htmlunit/attachment/DownloadingAttachmentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/attachment/package-info.java b/src/main/java/org/htmlunit/attachment/package-info.java index a17bceabe77..a487aac832e 100644 --- a/src/main/java/org/htmlunit/attachment/package-info.java +++ b/src/main/java/org/htmlunit/attachment/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/css/AbstractCssStyleDeclaration.java b/src/main/java/org/htmlunit/css/AbstractCssStyleDeclaration.java index 893ed286ca2..c0baff12da7 100644 --- a/src/main/java/org/htmlunit/css/AbstractCssStyleDeclaration.java +++ b/src/main/java/org/htmlunit/css/AbstractCssStyleDeclaration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -137,7 +137,7 @@ public String getStyleAttribute(final Definition definition1, final Definition d return element1.getValue(); } if (element1 != null) { - if (element1.compareTo(element2) > 0) { + if (StyleElement.compareToByImportanceAndSpecificity(element1, element2) > 0) { return element1.getValue(); } } @@ -437,6 +437,14 @@ public String getBackgroundRepeat() { return value; } + /** + * Gets the {@code blockSize} style attribute. + * @return the style attribute + */ + public String getBlockSize() { + return getStyleAttribute(Definition.BLOCK_SIZE, true); + } + /** * Gets the {@code borderBottomColor} style attribute. * @return the style attribute diff --git a/src/main/java/org/htmlunit/css/BrowserConfiguration.java b/src/main/java/org/htmlunit/css/BrowserConfiguration.java index a360971c379..2aa740da734 100644 --- a/src/main/java/org/htmlunit/css/BrowserConfiguration.java +++ b/src/main/java/org/htmlunit/css/BrowserConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/css/ComputedCssStyleDeclaration.java b/src/main/java/org/htmlunit/css/ComputedCssStyleDeclaration.java index 9ee4b96f342..702b704a269 100644 --- a/src/main/java/org/htmlunit/css/ComputedCssStyleDeclaration.java +++ b/src/main/java/org/htmlunit/css/ComputedCssStyleDeclaration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,10 @@ import static org.htmlunit.BrowserVersionFeatures.JS_CLIENTHEIGHT_INPUT_18; import static org.htmlunit.BrowserVersionFeatures.JS_CLIENTHEIGHT_RADIO_CHECKBOX_10; import static org.htmlunit.BrowserVersionFeatures.JS_CLIENTHEIGHT_RADIO_CHECKBOX_14; +import static org.htmlunit.BrowserVersionFeatures.JS_CLIENTHEIGHT_RB_17; +import static org.htmlunit.BrowserVersionFeatures.JS_CLIENTHEIGHT_RT_9; +import static org.htmlunit.BrowserVersionFeatures.JS_CLIENTHEIGHT_RUBY_17; +import static org.htmlunit.BrowserVersionFeatures.JS_CLIENTWIDTH_INPUT_TEXT_154; import static org.htmlunit.BrowserVersionFeatures.JS_CLIENTWIDTH_INPUT_TEXT_173; import static org.htmlunit.BrowserVersionFeatures.JS_CLIENTWIDTH_RADIO_CHECKBOX_10; import static org.htmlunit.BrowserVersionFeatures.JS_CLIENTWIDTH_RADIO_CHECKBOX_14; @@ -43,6 +47,7 @@ import org.htmlunit.BrowserVersion; import org.htmlunit.BrowserVersionFeatures; import org.htmlunit.Page; +import org.htmlunit.SgmlPage; import org.htmlunit.WebWindow; import org.htmlunit.css.CssPixelValueConverter.CssValue; import org.htmlunit.css.StyleAttributes.Definition; @@ -86,6 +91,12 @@ import org.htmlunit.html.HtmlFileInput; import org.htmlunit.html.HtmlFooter; import org.htmlunit.html.HtmlHeader; +import org.htmlunit.html.HtmlHeading1; +import org.htmlunit.html.HtmlHeading2; +import org.htmlunit.html.HtmlHeading3; +import org.htmlunit.html.HtmlHeading4; +import org.htmlunit.html.HtmlHeading5; +import org.htmlunit.html.HtmlHeading6; import org.htmlunit.html.HtmlHiddenInput; import org.htmlunit.html.HtmlImage; import org.htmlunit.html.HtmlInlineFrame; @@ -103,6 +114,7 @@ import org.htmlunit.html.HtmlNoLayer; import org.htmlunit.html.HtmlNoScript; import org.htmlunit.html.HtmlOutput; +import org.htmlunit.html.HtmlPage; import org.htmlunit.html.HtmlPasswordInput; import org.htmlunit.html.HtmlPlainText; import org.htmlunit.html.HtmlRadioButtonInput; @@ -135,7 +147,6 @@ import org.htmlunit.html.HtmlUnknownElement; import org.htmlunit.html.HtmlVariable; import org.htmlunit.html.HtmlWordBreak; -import org.htmlunit.javascript.host.html.HTMLElement; import org.htmlunit.platform.Platform; /** @@ -201,7 +212,7 @@ public class ComputedCssStyleDeclaration extends AbstractCssStyleDeclaration { * The computed, cached height of the element to which this computed style belongs (no padding, borders, etc.), * not taking child elements into account. */ - private Integer height2_; + private Integer emptyHeight_; /** The computed, cached horizontal padding (left + right) of the element to which this computed style belongs. */ private Integer paddingHorizontal_; @@ -234,7 +245,7 @@ public class ComputedCssStyleDeclaration extends AbstractCssStyleDeclaration { public ComputedCssStyleDeclaration(final ElementCssStyleDeclaration styleDeclaration) { super(); elementStyleDeclaration_ = styleDeclaration; - getDomElement().setDefaults(this); + elementStyleDeclaration_.getDomElement().setDefaults(this); } /** @@ -499,7 +510,7 @@ public Map getStyleMap() { /** * @return the {@link DomElement} the backing {@link ElementCssStyleDeclaration} - * is associated with + * is associated with */ public DomElement getDomElement() { return elementStyleDeclaration_.getDomElement(); @@ -518,6 +529,10 @@ public String getBackgroundAttachment() { */ @Override public String getBackgroundColor() { + if (!getDomElement().isAttachedToPage()) { + return EMPTY_FINAL; + } + final String value = super.getBackgroundColor(); if (StringUtils.isEmpty(value)) { return Definition.BACKGROUND_COLOR.getDefaultComputedValue(getBrowserVersion()); @@ -550,6 +565,38 @@ public String getBackgroundRepeat() { return defaultIfEmpty(super.getBackgroundRepeat(), Definition.BACKGROUND_REPEAT); } + /** + * {@inheritDoc} + */ + @Override + public String getBlockSize() { + if (NONE.equals(getDisplay())) { + return defaultIfEmpty(super.getBlockSize(), Definition.BLOCK_SIZE); + } + + final DomElement domElem = getDomElement(); + if (!domElem.isAttachedToPage()) { + return defaultIfEmpty(super.getBlockSize(), Definition.BLOCK_SIZE); + } + + return CssPixelValueConverter.pixelString(domElem, new CssPixelValueConverter.CssValue(0, 0) { + @Override + public String get(final ComputedCssStyleDeclaration style) { + final String value = style.getStyleAttribute(Definition.HEIGHT, true); + if (StringUtils.isEmpty(value)) { + final String content = domElem.getVisibleText(); + // do this only for small content + // at least for empty div's this is more correct + if (null == content) { + return getDefaultValue() + "px"; + } + return getEmptyHeight(domElem) + "px"; + } + return value; + } + }); + } + /** * {@inheritDoc} */ @@ -724,11 +771,7 @@ public String getFontFamily() { */ @Override public String getFontSize() { - String value = getStyleAttribute(Definition.FONT_SIZE, true); - if (!value.isEmpty()) { - value = CssPixelValueConverter.pixelValue(value) + "px"; - } - return value; + return getStyleAttribute(Definition.FONT_SIZE, true); } /** @@ -752,16 +795,20 @@ public String getHeight() { if (!elem.isAttachedToPage()) { return ""; } - final int windowHeight = elem.getPage().getEnclosingWindow().getInnerHeight(); - return CssPixelValueConverter - .pixelString(elem, new CssPixelValueConverter.CssValue(0, windowHeight) { - @Override - public String get(final ComputedCssStyleDeclaration style) { - // TODO don't reach out to the js peer - final String offsetHeight = ((HTMLElement) elem.getScriptableObject()).getOffsetHeight() + "px"; - return defaultIfEmpty(style.getStyleAttribute(Definition.HEIGHT, true), offsetHeight, AUTO); - } - }); + + final ComputedCssStyleDeclaration style = elem.getPage().getEnclosingWindow().getComputedStyle(elem, null); + final String styleValue = style.getStyleAttribute(Definition.HEIGHT, true); + + if (styleValue == null || styleValue.isEmpty() || AUTO.equals(styleValue) || styleValue.endsWith("%")) { + final String calculatedHeight = style.getCalculatedHeight(false, false) + "px"; + return calculatedHeight; + } + + if (styleValue.endsWith("px")) { + return styleValue; + } + + return CssPixelValueConverter.pixelValue(styleValue) + "px"; } /** @@ -769,16 +816,24 @@ public String get(final ComputedCssStyleDeclaration style) { */ @Override public String getLeft() { + if (NONE.equals(getDisplay())) { + return AUTO; + } + + final DomElement elem = getDomElement(); + if (!elem.isAttachedToPage()) { + return ""; + } + final String superLeft = super.getLeft(); if (!superLeft.endsWith("%")) { return defaultIfEmpty(superLeft, AUTO, null); } - final DomElement element = getDomElement(); - return CssPixelValueConverter.pixelString(element, new CssPixelValueConverter.CssValue(0, 0) { + return CssPixelValueConverter.pixelString(elem, new CssPixelValueConverter.CssValue(0, 0) { @Override public String get(final ComputedCssStyleDeclaration style) { - if (style.getDomElement() == element) { + if (style.getDomElement() == elem) { return style.getStyleAttribute(Definition.LEFT, true); } return style.getStyleAttribute(Definition.WIDTH, true); @@ -973,19 +1028,24 @@ public String getTextIndent() { */ @Override public String getTop() { - final DomElement element = getDomElement(); - if (!element.isAttachedToPage()) { + if (NONE.equals(getDisplay())) { + return AUTO; + } + + final DomElement elem = getDomElement(); + if (!elem.isAttachedToPage()) { return ""; } + final String superTop = super.getTop(); if (!superTop.endsWith("%")) { return defaultIfEmpty(superTop, Definition.TOP); } - return CssPixelValueConverter.pixelString(element, new CssPixelValueConverter.CssValue(0, 0) { + return CssPixelValueConverter.pixelString(elem, new CssPixelValueConverter.CssValue(0, 0) { @Override public String get(final ComputedCssStyleDeclaration style) { - if (style.getDomElement() == element) { + if (style.getDomElement() == elem) { return style.getStyleAttribute(Definition.TOP, true); } return style.getStyleAttribute(Definition.HEIGHT, true); @@ -1156,6 +1216,10 @@ public String getWordSpacing() { */ @Override public String getZIndex() { + if (!getDomElement().isAttachedToPage()) { + return EMPTY_FINAL; + } + final String response = super.getZIndex(); if (response.isEmpty()) { return AUTO; @@ -1220,7 +1284,7 @@ else if ((ABSOLUTE.equals(p) || FIXED.equals(p)) && !AUTO.equals(r)) { parentWidth = getDomElement().getPage().getEnclosingWindow().getInnerWidth(); } else if (parent instanceof Page) { - parentWidth = (((Page) parent).getEnclosingWindow()).getInnerWidth(); + parentWidth = ((Page) parent).getEnclosingWindow().getInnerWidth(); } else { final ComputedCssStyleDeclaration parentStyle = @@ -1415,12 +1479,12 @@ public int getCalculatedHeight(final boolean includeBorder, final boolean includ if (!element.isAttachedToPage()) { return 0; } - int height = getCalculatedHeight(); + int height = getCalculatedHeight(element); if (!"border-box".equals(getStyleAttribute(Definition.BOX_SIZING, true))) { if (includeBorder) { height += getBorderVertical(); } - else if (isScrollable(true, true) && !(element instanceof HtmlBody)) { + else if (isScrollable(element, true, true) && !(element instanceof HtmlBody)) { height -= 17; } @@ -1435,14 +1499,12 @@ else if (isScrollable(true, true) && !(element instanceof HtmlBody)) { * Returns the element's calculated height, taking both relevant CSS and the element's children into account. * @return the element's calculated height, taking both relevant CSS and the element's children into account */ - private int getCalculatedHeight() { + private int getCalculatedHeight(final DomElement element) { final Integer cachedHeight = getCachedHeight(); if (cachedHeight != null) { return cachedHeight.intValue(); } - final DomElement element = getDomElement(); - if (element instanceof HtmlImage) { return updateCachedHeight(((HtmlImage) element).getHeightOrDefault()); } @@ -1456,7 +1518,7 @@ private int getCalculatedHeight() { } } - return updateCachedHeight(getEmptyHeight()); + return updateCachedHeight(getEmptyHeight(element)); } /** @@ -1476,7 +1538,7 @@ public int getCalculatedWidth(final boolean includeBorder, final boolean include if (includeBorder) { width += getBorderHorizontal(); } - else if (isScrollable(false, true) && !(element instanceof HtmlBody)) { + else if (isScrollable(element, false, true) && !(element instanceof HtmlBody)) { width -= 17; } @@ -1555,7 +1617,10 @@ else if (element instanceof HtmlTextInput || element instanceof HtmlPasswordInpu if (browserVersion.hasFeature(JS_CLIENTWIDTH_INPUT_TEXT_173)) { return 173; } - width = 154; // FF + if (browserVersion.hasFeature(JS_CLIENTWIDTH_INPUT_TEXT_154)) { + return 154; + } + width = 161; // FF } else if (element instanceof HtmlRadioButtonInput || element instanceof HtmlCheckBoxInput) { final BrowserVersion browserVersion = getDomElement().getPage().getWebClient().getBrowserVersion(); @@ -1624,7 +1689,8 @@ else if (child instanceof DomText) { final DomNode parent = child.getParentNode(); if (parent instanceof HtmlElement) { final ComputedCssStyleDeclaration style = webWindow.getComputedStyle((DomElement) parent, null); - final int height = browserVersion.getFontHeight(style.getFontSize()); + final int height = browserVersion.getFontHeight( + style.getStyleAttribute(Definition.FONT_SIZE, true)); width += child.getVisibleText().length() * (int) (height / 1.8f); } else { @@ -1636,33 +1702,34 @@ else if (child instanceof DomText) { } /** - * Returns the element's calculated height taking relevant CSS into account, but not the element's child - * elements. - * * @return the element's calculated height taking relevant CSS into account, but not the element's child * elements */ - private int getEmptyHeight() { - final Integer cachedHeight2 = getCachedHeight2(); - if (cachedHeight2 != null) { - return cachedHeight2.intValue(); + private int getEmptyHeight(final DomElement element) { + final Integer cachedEmptyHeight = getCachedEmptyHeight(); + if (cachedEmptyHeight != null) { + return cachedEmptyHeight.intValue(); } - final DomElement element = getDomElement(); if (!element.mayBeDisplayed()) { - return updateCachedHeight2(0); + return updateCachedEmptyHeight(0); } final String display = getDisplay(); if (NONE.equals(display)) { - return updateCachedHeight2(0); + return updateCachedEmptyHeight(0); } - final WebWindow webWindow = element.getPage().getEnclosingWindow(); + final SgmlPage page = element.getPage(); + final WebWindow webWindow = page.getEnclosingWindow(); final int windowHeight = webWindow.getInnerHeight(); if (element instanceof HtmlBody) { - return updateCachedHeight2(windowHeight); + if (page instanceof HtmlPage && ((HtmlPage) page).isQuirksMode()) { + return updateCachedEmptyHeight(windowHeight); + } + + return updateCachedEmptyHeight(0); } final boolean isInline = INLINE.equals(display) && !(element instanceof HtmlInlineFrame); @@ -1702,10 +1769,7 @@ private int getEmptyHeight() { || element instanceof HtmlNoLayer || element instanceof HtmlNoScript || element instanceof HtmlPlainText - || element instanceof HtmlRuby - || element instanceof HtmlRb || element instanceof HtmlRp - || element instanceof HtmlRt || element instanceof HtmlRtc || element instanceof HtmlS || element instanceof HtmlSample @@ -1773,11 +1837,105 @@ else if (element instanceof HtmlInlineFrame) { defaultHeight = 0; } } + else if (element instanceof HtmlRb) { + final BrowserVersion browser = webWindow.getWebClient().getBrowserVersion(); + if (browser.hasFeature(JS_CLIENTHEIGHT_RB_17)) { + defaultHeight = 17; + } + else { + defaultHeight = 0; + } + } + else if (element instanceof HtmlRt) { + final BrowserVersion browser = webWindow.getWebClient().getBrowserVersion(); + if (browser.hasFeature(JS_CLIENTHEIGHT_RT_9)) { + defaultHeight = 9; + } + else { + defaultHeight = 0; + } + } + else if (element instanceof HtmlRuby) { + final BrowserVersion browser = webWindow.getWebClient().getBrowserVersion(); + if (browser.hasFeature(JS_CLIENTHEIGHT_RUBY_17)) { + defaultHeight = 17; + } + else { + defaultHeight = 0; + } + } else { - final String fontSize = getFontSize(); + final String fontSize; + + boolean isHeading = false; + if (element instanceof HtmlHeading1) { + isHeading = true; + final String value = getStyleAttribute(Definition.FONT_SIZE, false); + if (value.isEmpty()) { + fontSize = "32px"; + } + else { + fontSize = getStyleAttribute(Definition.FONT_SIZE, true); + } + } + else if (element instanceof HtmlHeading2) { + isHeading = true; + final String value = getStyleAttribute(Definition.FONT_SIZE, false); + if (value.isEmpty()) { + fontSize = "24px"; + } + else { + fontSize = getStyleAttribute(Definition.FONT_SIZE, true); + } + } + else if (element instanceof HtmlHeading3) { + isHeading = true; + final String value = getStyleAttribute(Definition.FONT_SIZE, false); + if (value.isEmpty()) { + fontSize = "19px"; + } + else { + fontSize = getStyleAttribute(Definition.FONT_SIZE, true); + } + } + else if (element instanceof HtmlHeading4) { + isHeading = true; + final String value = getStyleAttribute(Definition.FONT_SIZE, false); + if (value.isEmpty()) { + fontSize = "16px"; + } + else { + fontSize = getStyleAttribute(Definition.FONT_SIZE, true); + } + } + else if (element instanceof HtmlHeading5) { + isHeading = true; + final String value = getStyleAttribute(Definition.FONT_SIZE, false); + if (value.isEmpty()) { + fontSize = "13px"; + } + else { + fontSize = getStyleAttribute(Definition.FONT_SIZE, true); + } + } + else if (element instanceof HtmlHeading6) { + isHeading = true; + final String value = getStyleAttribute(Definition.FONT_SIZE, false); + if (value.isEmpty()) { + fontSize = "11px"; + } + else { + fontSize = getStyleAttribute(Definition.FONT_SIZE, true); + } + } + else { + fontSize = getStyleAttribute(Definition.FONT_SIZE, true); + } + defaultHeight = webWindow.getWebClient().getBrowserVersion().getFontHeight(fontSize); - if (element instanceof HtmlDivision + if (isHeading + || element instanceof HtmlDivision || element instanceof HtmlSpan) { String width = getStyleAttribute(Definition.WIDTH, false); @@ -1811,6 +1969,13 @@ else if (element instanceof HtmlInlineFrame) { defaultHeight *= StringUtils.countMatches(content, '\n') + 1; } } + + final String styleHeight = getStyleAttribute(Definition.HEIGHT, true); + if (styleHeight.endsWith("%")) { + if (page instanceof HtmlPage && !((HtmlPage) page).isQuirksMode()) { + return defaultHeight; + } + } } } @@ -1835,7 +2000,7 @@ else if (element instanceof HtmlInlineFrame) { height = defaultHeight; } - return updateCachedHeight2(height); + return updateCachedEmptyHeight(height); } /** @@ -1905,15 +2070,14 @@ else if (ABSOLUTE.equals(position) || FIXED.equals(position)) { * @return {@code true} if the element is scrollable along the specified axis */ public boolean isScrollable(final boolean horizontal) { - return isScrollable(horizontal, false); + return isScrollable(getDomElement(), horizontal, false); } /** * @param ignoreSize whether to consider the content/calculated width/height */ - private boolean isScrollable(final boolean horizontal, final boolean ignoreSize) { + private boolean isScrollable(final DomElement element, final boolean horizontal, final boolean ignoreSize) { final boolean scrollable; - final DomElement element = getDomElement(); String overflow; if (horizontal) { @@ -1939,7 +2103,7 @@ private boolean isScrollable(final boolean horizontal, final boolean ignoreSize) } scrollable = (element instanceof HtmlBody || SCROLL.equals(overflow) || AUTO.equals(overflow)) - && (ignoreSize || getContentHeight() > getEmptyHeight()); + && (ignoreSize || getContentHeight() > getEmptyHeight(element)); } return scrollable; } @@ -2086,20 +2250,20 @@ public int updateCachedHeight(final int height) { /** * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK. - * @return the cached height2 + * @return the cached emptyHeight */ - public Integer getCachedHeight2() { - return height2_; + public Integer getCachedEmptyHeight() { + return emptyHeight_; } /** * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK. - * @param height the new value - * @return the param height2 + * @param emptyHeight the new value + * @return the param emptyHeight */ - public int updateCachedHeight2(final int height) { - height2_ = Integer.valueOf(height); - return height; + public int updateCachedEmptyHeight(final int emptyHeight) { + emptyHeight_ = Integer.valueOf(emptyHeight); + return emptyHeight; } /** diff --git a/src/main/java/org/htmlunit/css/CssColors.java b/src/main/java/org/htmlunit/css/CssColors.java index e24c57652a5..1e5ae5094c6 100644 --- a/src/main/java/org/htmlunit/css/CssColors.java +++ b/src/main/java/org/htmlunit/css/CssColors.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,9 +14,9 @@ */ package org.htmlunit.css; -import java.util.HashMap; import java.util.Locale; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; /** * Helper to work with colors. @@ -25,7 +25,7 @@ */ public final class CssColors { - private static final Map CSS_COLORS = new HashMap<>(); + private static final Map CSS_COLORS = new ConcurrentHashMap<>(); static { CSS_COLORS.put("aqua", "rgb(0, 255, 255)"); @@ -63,7 +63,7 @@ public static boolean isColorKeyword(final String token) { * Gets the RGB equivalent of a CSS color if the provided color is recognized. * @param color the color * @return the provided color if this is not a recognized color keyword, the RGB value - * in the form "rgb(x, y, z)" otherwise + * in the form "rgb(x, y, z)" otherwise */ public static String toRGBColor(final String color) { final String rgbValue = CSS_COLORS.get(color.toLowerCase(Locale.ROOT)); diff --git a/src/main/java/org/htmlunit/css/CssMediaList.java b/src/main/java/org/htmlunit/css/CssMediaList.java index 8a8e1bdbde3..88ff7a8d6e9 100644 --- a/src/main/java/org/htmlunit/css/CssMediaList.java +++ b/src/main/java/org/htmlunit/css/CssMediaList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/css/CssPixelValueConverter.java b/src/main/java/org/htmlunit/css/CssPixelValueConverter.java index 1d101ac8b72..688ad4d23ff 100644 --- a/src/main/java/org/htmlunit/css/CssPixelValueConverter.java +++ b/src/main/java/org/htmlunit/css/CssPixelValueConverter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/css/CssStyleSheet.java b/src/main/java/org/htmlunit/css/CssStyleSheet.java index 93a0924455b..1bf974a747f 100644 --- a/src/main/java/org/htmlunit/css/CssStyleSheet.java +++ b/src/main/java/org/htmlunit/css/CssStyleSheet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -312,8 +312,8 @@ public static CssStyleSheet loadStylesheet(final HtmlElement element, final Html // Use link. request = link.getWebRequest(); + final String type = link.getTypeAttribute(); if (client.getBrowserVersion().hasFeature(HTMLLINK_CHECK_TYPE_FOR_STYLESHEET)) { - final String type = link.getTypeAttribute(); if (StringUtils.isNotBlank(type) && !MimeType.TEXT_CSS.equals(type)) { return new CssStyleSheet(element, "", uri); } @@ -330,7 +330,10 @@ public static CssStyleSheet loadStylesheet(final HtmlElement element, final Html // our cache is a bit strange; // loadWebResponse check the cache for the web response // AND also fixes the request url for the following cache lookups - response = link.getWebResponse(true, request); + response = link.getWebResponse(true, request, true, type); + if (response == null) { + return new CssStyleSheet(element, "", uri); + } } // now we can look into the cache with the fixed request for @@ -1044,25 +1047,6 @@ private static String toString(final InputSource source) { } } - /** - * Validates the list of selectors. - * @param selectorList the selectors - * @param documentMode see {@link Document#getDocumentMode()} - * @param domNode the dom node the query should work on - * @throws CSSException if a selector is invalid - * - * @deprecated as of version 4.5.0; use {@link #validateSelectors(SelectorList, DomNode)} instead - */ - @Deprecated - public static void validateSelectors(final SelectorList selectorList, final int documentMode, - final DomNode domNode) throws CSSException { - for (final Selector selector : selectorList) { - if (!isValidSelector(selector, domNode)) { - throw new CSSException("Invalid selector: " + selector, null); - } - } - } - /** * Validates the list of selectors. * @param selectorList the selectors @@ -1224,7 +1208,8 @@ public static boolean isActive(final MediaListImpl mediaList, final WebWindow we return true; } - for (int i = 0; i < mediaList.getLength(); i++) { + final int length = mediaList.getLength(); + for (int i = 0; i < length; i++) { final MediaQuery mediaQuery = mediaList.mediaQuery(i); boolean isActive = isActive(mediaQuery, webWindow); if (mediaQuery.isNot()) { diff --git a/src/main/java/org/htmlunit/css/ElementCssStyleDeclaration.java b/src/main/java/org/htmlunit/css/ElementCssStyleDeclaration.java index 609fa4857eb..f98bab0d4b1 100644 --- a/src/main/java/org/htmlunit/css/ElementCssStyleDeclaration.java +++ b/src/main/java/org/htmlunit/css/ElementCssStyleDeclaration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -188,6 +188,9 @@ public Map getStyleMap() { return domElement_.getStyleMap(); } + /** + * @return the {@link DomElement} associated with this + */ public DomElement getDomElement() { return domElement_; } diff --git a/src/main/java/org/htmlunit/css/StyleAttributes.java b/src/main/java/org/htmlunit/css/StyleAttributes.java index 17f4c11e482..9d6f20247fd 100644 --- a/src/main/java/org/htmlunit/css/StyleAttributes.java +++ b/src/main/java/org/htmlunit/css/StyleAttributes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,9 +32,9 @@ import java.io.Serializable; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import org.htmlunit.BrowserVersion; @@ -48,7 +48,7 @@ */ @SuppressWarnings("PMD.AvoidDuplicateLiterals") public final class StyleAttributes implements Serializable { - private static final Map STYLES = new HashMap<>(); + private static final Map STYLES = new ConcurrentHashMap<>(); static { for (final Definition definition : Definition.values()) { @@ -338,10 +338,10 @@ public enum Definition { BASELINE_SOURCE_("baseline-source", "baseline-source", ff("auto")), /** The style property {@code blockSize}. */ - BLOCK_SIZE("blockSize", "block-size", chromeAndEdge("324px"), ff("328px")), + BLOCK_SIZE("blockSize", "block-size", chromeAndEdgeAndFirefox("auto")), /** The style property {@code block-size}. */ - BLOCK_SIZE_("block-size", "block-size", ff("328px")), + BLOCK_SIZE_("block-size", "block-size", ff("auto")), /** The style property {@code border}. */ BORDER("border", "border", chromeAndEdge("0px none rgb(0, 0, 0)"), ff("0px rgb(0, 0, 0)")), @@ -695,10 +695,10 @@ public enum Definition { BORDER_RIGHT_WIDTH_("border-right-width", "border-right-width", ff("0px")), /** The style property {@code borderSpacing}. */ - BORDER_SPACING("borderSpacing", "border-spacing", chromeAndEdge("0px 0px"), ff("0px 0px")), + BORDER_SPACING("borderSpacing", "border-spacing", chromeAndEdge("0px"), ffEsr("0px 0px"), ffLatest("0px")), /** The style property {@code border-spacing}. */ - BORDER_SPACING_("border-spacing", "border-spacing", ff("0px 0px")), + BORDER_SPACING_("border-spacing", "border-spacing", ffEsr("0px 0px"), ffLatest("0px")), /** The style property {@code borderStartEndRadius}. */ BORDER_START_END_RADIUS("borderStartEndRadius", "border-start-end-radius", chromeAndEdge("0px"), ff("0px")), @@ -888,7 +888,7 @@ public enum Definition { COLUMN_GAP_("column-gap", "column-gap", ffNormal()), /** The style property {@code columnRule}. */ - COLUMN_RULE("columnRule", "column-rule", chromeAndEdge("0px none rgb(0, 0, 0)"), + COLUMN_RULE("columnRule", "column-rule", chromeAndEdge("0px rgb(0, 0, 0)"), ff("0px none rgb(0, 0, 0)")), /** The style property {@code column-rule}. */ @@ -1049,6 +1049,9 @@ public enum Definition { /** The style property {@code dominant-baseline}. */ DOMINANT_BASELINE_("dominant-baseline", "dominant-baseline", ff("auto")), + /** The style property {@code dynamicRangeLimit}. */ + DYNAMIC_RANGE_LIMIT("dynamicRangeLimit", "dynamic-range-limit", chromeAndEdge("no-limit")), + /** The style property {@code emptyCells}. */ EMPTY_CELLS("emptyCells", "empty-cells", ff("show"), chromeAndEdge("show")), @@ -1426,7 +1429,10 @@ public enum Definition { HYPHENATE_CHARACTER_("hyphenate-character", "hyphenate-character", ff("auto")), /** The style property {@code hyphenateLimitChars}. */ - HYPHENATE_LIMIT_CHAR("hyphenateLimitChars", "hyphenate-limit-char", chromeAndEdgeAuto()), + HYPHENATE_LIMIT_CHAR("hyphenateLimitChars", "hyphenate-limit-chars", chromeAndEdgeAuto(), ffLatest("auto")), + + /** The style property {@code hyphenate-limit-chars}. */ + HYPHENATE_LIMIT_CHAR_("hyphenate-limit-chars", "hyphenate-limit-chars", ffLatest("auto")), /** The style property {@code hyphens}. */ HYPHENS("hyphens", "hyphens", ff("manual"), chromeAndEdge("manual")), @@ -1461,10 +1467,10 @@ public enum Definition { INITIAL_VALUE("initialValue", "initial-value", chromeAndEdgeEmpty()), /** The style property {@code inlineSize}. */ - INLINE_SIZE("inlineSize", "inline-size", ff("1244px"), chrome("1240px"), edge("1232px")), + INLINE_SIZE("inlineSize", "inline-size", ffEsr("1244px"), ffLatest("1240px"), chrome("1240px"), edge("1232px")), /** The style property {@code inline-size}. */ - INLINE_SIZE_("inline-size", "inline-size", ff("1244px")), + INLINE_SIZE_("inline-size", "inline-size", ffEsr("1244px"), ffLatest("1240px")), /** The style property {@code inset}. */ INSET("inset", "inset", chromeAndEdgeAuto(), ff("auto")), @@ -1505,6 +1511,9 @@ public enum Definition { /** The style property {@code inset-inline-start}. */ INSET_INLINE_START_("inset-inline-start", "inset-inline-start", ff("auto")), + /** The style property {@code interactivity}. */ + INTERACTIVITY("interactivity", "interpolate-size", chromeAndEdge("auto")), + /** The style property {@code interpolateSize}. */ INTERPOLATE_SIZE("interpolateSize", "interpolate-size", chromeAndEdge("numeric-only")), @@ -2084,10 +2093,10 @@ public enum Definition { MOZ_PERSPECTIVE__("-moz-perspective", "-moz-perspective", ffLatest("none")), /** The style property {@code MozPerspectiveOrigin}. */ - MOZ_PERSPECTIVE_ORIGIN("MozPerspectiveOrigin", "-moz-perspective-origin", ffLatest("622px 164px")), + MOZ_PERSPECTIVE_ORIGIN("MozPerspectiveOrigin", "-moz-perspective-origin", ffLatest("620px 9px")), /** The style property {@code -moz-perspective-origin}. */ - MOZ_PERSPECTIVE_ORIGIN__("-moz-perspective-origin", "-moz-perspective-origin", ffLatest("622px 164px")), + MOZ_PERSPECTIVE_ORIGIN__("-moz-perspective-origin", "-moz-perspective-origin", ffLatest("620px 9px")), /** The style property {@code MozTabSize}. */ MOZ_TAB_SIZE("MozTabSize", "-moz-tab-size", ff("8")), @@ -2118,10 +2127,12 @@ public enum Definition { MOZ_TRANSFORM__("-moz-transform", "-moz-transform", ffNone()), /** The style property {@code MozTransformOrigin}. */ - MOZ_TRANSFORM_ORIGIN("MozTransformOrigin", "-moz-transform-origin", ff("622px 164px")), + MOZ_TRANSFORM_ORIGIN("MozTransformOrigin", "-moz-transform-origin", + ffEsr("622px 9px"), ffLatest("620px 9px")), /** The style property {@code -moz-transform-origin}. */ - MOZ_TRANSFORM_ORIGIN__("-moz-transform-origin", "-moz-transform-origin", ff("622px 164px")), + MOZ_TRANSFORM_ORIGIN__("-moz-transform-origin", "-moz-transform-origin", + ffEsr("622px 9px"), ffLatest("620px 9px")), /** The style property {@code MozTransformStyle}. */ MOZ_TRANSFORM_STYLE("MozTransformStyle", "-moz-transform-style", ffLatest("flat")), @@ -2129,11 +2140,43 @@ public enum Definition { /** The style property {@code -moz-transform-style}. */ MOZ_TRANSFORM_STYLE__("-moz-transform-style", "-moz-transform-style", ffLatest("flat")), + /** The style property {@code MozTransition}. */ + MOZ_TRANSITION("MozTransition", "-moz-transition", ffLatest("all")), + + /** The style property {@code -moz-transition}. */ + MOZ_TRANSITION__("-moz-transition", "-moz-transition", ffLatest("all")), + + /** The style property {@code MozTransitionDelay}. */ + MOZ_TRANSITION_DELAY("MozTransitionDelay", "-moz-transition-delay", ffLatest("0s")), + + /** The style property {@code -moz-transition-delay}. */ + MOZ_TRANSITION_DELAY__("-moz-transition-delay", "-moz-transition-delay", ffLatest("0s")), + + /** The style property {@code MozTransitionDuration}. */ + MOZ_TRANSITION_DURATION("MozTransitionDuration", "-moz-transition-duration", ffLatest("0s")), + + /** The style property {@code -moz-transition-duration}. */ + MOZ_TRANSITION_DURATION__("-moz-transition-duration", "-moz-transition-duration", ffLatest("0s")), + + /** The style property {@code MozTransitionProperty}. */ + MOZ_TRANSITION_PROPERTY("MozTransitionProperty", "-moz-transition-property", ffLatest("all")), + + /** The style property {@code -moz-transition-property}. */ + MOZ_TRANSITION_PROPERTY__("-moz-transition-property", "-moz-transition-property", ffLatest("all")), + + /** The style property {@code MozTransitionTimingFunction}. */ + MOZ_TRANSITION_TIMING_FUNCTION("MozTransitionTimingFunction", "-moz-transition-timing-function", + ffLatest("ease")), + + /** The style property {@code -moz-transition-timing-function}. */ + MOZ_TRANSITION_TIMING_FUNCTION__("-moz-transition-timing-function", "-moz-transition-timing-function", + ffLatest("ease")), + /** The style property {@code MozUserInput}. */ - MOZ_USER_INPUT("MozUserInput", "-moz-user-input", ff("auto")), + MOZ_USER_INPUT("MozUserInput", "-moz-user-input", ffEsr("auto")), /** The style property {@code -moz-user-input}. */ - MOZ_USER_INPUT__("-moz-user-input", "-moz-user-input", ff("auto")), + MOZ_USER_INPUT__("-moz-user-input", "-moz-user-input", ffEsr("auto")), /** The style property {@code MozUserModify}. */ MOZ_USER_MODIFY("MozUserModify", "-moz-user-modify", ffEsr("read-only")), @@ -2255,7 +2298,7 @@ public enum Definition { OVERFLOW_ANCHOR_("overflow-anchor", "overflow-anchor", ff("auto")), /** The style property {@code overflowBlock}. */ - OVERFLOW_BLOCK("overflowBlock", "overflow-block", ff("visible")), + OVERFLOW_BLOCK("overflowBlock", "overflow-block", chromeAndEdgeAndFirefox("visible")), /** The style property {@code overflow-block}. */ OVERFLOW_BLOCK_("overflow-block", "overflow-block", ff("visible")), @@ -2267,7 +2310,7 @@ public enum Definition { OVERFLOW_CLIP_MARGIN_("overflow-clip-margin", "overflow-clip-margin", ff("0px")), /** The style property {@code overflowInline}. */ - OVERFLOW_INLINE("overflowInline", "overflow-inline", ff("visible")), + OVERFLOW_INLINE("overflowInline", "overflow-inline", chromeAndEdgeAndFirefox("visible")), /** The style property {@code overflow-inline}. */ OVERFLOW_INLINE_("overflow-inline", "overflow-inline", ff("visible")), @@ -2431,10 +2474,11 @@ public enum Definition { /** The style property {@code perspectiveOrigin}. */ PERSPECTIVE_ORIGIN("perspectiveOrigin", "perspective-origin", - ff("622px 164px"), chrome("620px 162px"), edge("616px 162px")), + ffEsr("622px 9px"), ffLatest("620px 9px"), chrome("620px 9px"), edge("616px 9px")), /** The style property {@code perspective-origin}. */ - PERSPECTIVE_ORIGIN_("perspective-origin", "perspective-origin", ff("622px 164px")), + PERSPECTIVE_ORIGIN_("perspective-origin", "perspective-origin", + ffEsr("622px 9px"), ffLatest("620px 9px")), /** The style property {@code placeContent}. */ PLACE_CONTENT("placeContent", "place-content", chromeAndEdgeNormal(), ffNormal()), @@ -2485,7 +2529,8 @@ public enum Definition { PREFIX("prefix", "prefix", chromeAndEdgeEmpty()), /** The style property {@code printColorAdjust}. */ - PRINT_COLOR_ADJUST("printColorAdjust", "print-color-adjust", ff("economy")), + PRINT_COLOR_ADJUST("printColorAdjust", "print-color-adjust", ff("economy"), + chromeAndEdge("economy")), /** The style property {@code print-color-adjust}. */ PRINT_COLOR_ADJUST_("print-color-adjust", "print-color-adjust", ff("economy")), @@ -2499,6 +2544,12 @@ public enum Definition { /** The style property {@code range}. */ RANGE("range", "range", chromeAndEdgeEmpty()), + /** The style property {@code readingFlow}. */ + READING_FLOW("readingFlow", "readingFlow", chromeAndEdgeNormal()), + + /** The style property {@code readingOrder}. */ + READING_ORDER("readingOrder", "readingOrder", chromeAndEdge("0")), + /** The style property {@code resize}. */ RESIZE("resize", "resize", ffNone(), chromeAndEdgeNone()), @@ -2542,6 +2593,9 @@ public enum Definition { /** The style property {@code scroll-behavior}. */ SCROLL_BEHAVIOR_("scroll-behavior", "scroll-behavior", ff("auto")), + /** The style property {@code scrollInitialTarget}. */ + SCROLL_INITIAL_TARGET("scrollInitialTarget", "scroll-initial-target", chromeAndEdgeNone()), + /** The style property {@code scrollMargin}. */ SCROLL_MARGIN("scrollMargin", "scroll-margin", chromeAndEdge("0px"), ff("0px")), @@ -2614,6 +2668,9 @@ public enum Definition { /** The style property {@code scroll-margin-top}. */ SCROLL_MARGIN_TOP_("scroll-margin-top", "scroll-margin-top", ff("0px")), + /** The style property {@code scrollMarkerGroup}. */ + SCROLL_MARKER_GROUP("scrollMarkerGroup", "scroll-marker-group", chromeAndEdgeNone()), + /** The style property {@code scrollPadding}. */ SCROLL_PADDING("scrollPadding", "scroll-padding", chromeAndEdgeAuto(), ff("auto")), @@ -2869,6 +2926,15 @@ public enum Definition { /** The style property {@code text-anchor}. */ TEXT_ANCHOR_("text-anchor", "text-anchor", ff("start")), + /** The style property {@code textBox}. */ + TEXT_BOX("textBox", "text-box", chromeAndEdgeNormal()), + + /** The style property {@code textBoxEdge}. */ + TEXT_BOX_EDGE("textBoxEdge", "text-box-edge", chromeAndEdgeAuto()), + + /** The style property {@code textBoxTrim}. */ + TEXT_BOX_TRIM("textBoxTrim", "text-box-trim", chromeAndEdgeNone()), + /** The style property {@code textCombineUpright}. */ TEXT_COMBINE_UPRIGHT("textCombineUpright", "text-combine-upright", chromeAndEdgeNone(), ffNone()), @@ -3048,10 +3114,10 @@ public enum Definition { /** The style property {@code transformOrigin}. */ TRANSFORM_ORIGIN("transformOrigin", "transform-origin", - ff("622px 164px"), chrome("620px 162px"), edge("616px 162px")), + ffEsr("622px 9px"), ffLatest("620px 9px"), chrome("620px 9px"), edge("616px 9px")), /** The style property {@code transform-origin}. */ - TRANSFORM_ORIGIN_("transform-origin", "transform-origin", ff("622px 164px")), + TRANSFORM_ORIGIN_("transform-origin", "transform-origin", ffEsr("622px 9px"), ffLatest("620px 9px")), /** The style property {@code transformStyle}. */ TRANSFORM_STYLE("transformStyle", "transform-style", ff("flat"), chromeAndEdge("flat")), @@ -3556,7 +3622,7 @@ public enum Definition { WEBKIT_COLUMN_GAP("webkitColumnGap", "webkit-column-gap", chromeAndEdgeNormal()), /** The style property {@code webkitColumnRule}. */ - WEBKIT_COLUMN_RULE("webkitColumnRule", "webkit-column-rule", chromeAndEdge("0px none rgb(0, 0, 0)")), + WEBKIT_COLUMN_RULE("webkitColumnRule", "webkit-column-rule", chromeAndEdge("0px rgb(0, 0, 0)")), /** The style property {@code webkitColumnRuleColor}. */ WEBKIT_COLUMN_RULE_COLOR("webkitColumnRuleColor", "webkit-column-rule-color", chromeAndEdge("rgb(0, 0, 0)")), @@ -3692,7 +3758,7 @@ public enum Definition { WEBKIT_LOCALE("webkitLocale", "webkit-locale", chromeAndEdgeAuto()), /** The style property {@code webkitLogicalHeight}. */ - WEBKIT_LOGICAL_HEIGHT("webkitLogicalHeight", "webkit-logical-height", chromeAndEdge("324px")), + WEBKIT_LOGICAL_HEIGHT("webkitLogicalHeight", "webkit-logical-height", chromeAndEdge("18px")), /** The style property {@code webkitLogicalWidth}. */ WEBKIT_LOGICAL_WIDTH("webkitLogicalWidth", "webkit-logical-width", chrome("1240px"), edge("1232px")), @@ -3865,15 +3931,15 @@ public enum Definition { /** The style property {@code webkitPerspectiveOrigin}. */ WEBKIT_PERSPECTIVE_ORIGIN("webkitPerspectiveOrigin", "webkit-perspective-origin", - ff("622px 164px"), chrome("620px 162px"), edge("616px 162px")), + ffEsr("622px 9px"), ffLatest("620px 9px"), chrome("620px 9px"), edge("616px 9px")), /** The style property {@code WebkitPerspectiveOrigin}. */ WEBKIT_PERSPECTIVE_ORIGIN_("WebkitPerspectiveOrigin", "webkit-perspective-origin", - ff("622px 164px")), + ffEsr("622px 9px"), ffLatest("620px 9px")), /** The style property {@code -webkit-perspective-origin}. */ WEBKIT_PERSPECTIVE_ORIGIN__("-webkit-perspective-origin", "webkit-perspective-origin", - ff("622px 164px")), + ffEsr("622px 9px"), ffLatest("620px 9px")), /** The style property {@code webkitPerspectiveOriginX}. */ WEBKIT_PERSPECTIVE_ORIGIN_X("webkitPerspectiveOriginX", "webkit-perspective-origin-x", chromeAndEdgeEmpty()), @@ -3999,15 +4065,15 @@ public enum Definition { /** The style property {@code webkitTransformOrigin}. */ WEBKIT_TRANSFORM_ORIGIN("webkitTransformOrigin", "webkit-transform-origin", - ff("622px 164px"), chrome("620px 162px"), edge("616px 162px")), + ffEsr("622px 9px"), ffLatest("620px 9px"), chrome("620px 9px"), edge("616px 9px")), /** The style property {@code WebkitTransformOrigin}. */ WEBKIT_TRANSFORM_ORIGIN_("WebkitTransformOrigin", "webkit-transform-origin", - ff("622px 164px")), + ffEsr("622px 9px"), ffLatest("620px 9px")), /** The style property {@code -webkit-transform-origin}. */ WEBKIT_TRANSFORM_ORIGIN__("-webkit-transform-origin", "webkit-transform-origin", - ff("622px 164px")), + ffEsr("622px 9px"), ffLatest("620px 9px")), /** The style property {@code webkitTransformOriginX}. */ WEBKIT_TRANSFORM_ORIGIN_X("webkitTransformOriginX", "webkit-transform-origin-x", chromeAndEdgeEmpty()), diff --git a/src/main/java/org/htmlunit/css/StyleElement.java b/src/main/java/org/htmlunit/css/StyleElement.java index 954b9810a82..2e4f2a2714e 100644 --- a/src/main/java/org/htmlunit/css/StyleElement.java +++ b/src/main/java/org/htmlunit/css/StyleElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ * @author Ronald Brill * @author Frank Danek */ -public class StyleElement implements Comparable, Serializable { +public class StyleElement implements Serializable { /** CSS important property constant. */ public static final String PRIORITY_IMPORTANT = "important"; @@ -133,28 +133,41 @@ public String toString() { } /** - * {@inheritDoc} + * This takes only the importance, the specificity and the index into account. + * The name and value properties are ignored. + * + * @param first the {@link StyleElement} to compare + * @param second the {@link StyleElement} to compare with + * @return a negative integer, zero, or a positive integer as this object + * is less than, equal to, or greater than the specified object. */ - @Override - public int compareTo(final StyleElement e) { - if (e == null) { + public static int compareToByImportanceAndSpecificity(final StyleElement first, final StyleElement second) { + if (first == null) { + return second == null ? 0 : -1; + } + + if (second == null) { return 1; } - if (isImportant()) { - if (!e.isImportant()) { + if (first == second) { + return 0; + } + + if (first.isImportant()) { + if (!second.isImportant()) { return 1; } } else { - if (e.isImportant()) { + if (second.isImportant()) { return -1; } } - final int comp = getSpecificity().compareTo(e.getSpecificity()); + final int comp = first.getSpecificity().compareTo(second.getSpecificity()); if (comp == 0) { - return Long.compare(getIndex(), e.getIndex()); + return Long.compare(first.getIndex(), second.getIndex()); } return comp; } diff --git a/src/main/java/org/htmlunit/css/WrappedCssStyleDeclaration.java b/src/main/java/org/htmlunit/css/WrappedCssStyleDeclaration.java index 8fd8eacdc74..6654f6acab9 100644 --- a/src/main/java/org/htmlunit/css/WrappedCssStyleDeclaration.java +++ b/src/main/java/org/htmlunit/css/WrappedCssStyleDeclaration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/css/package-info.java b/src/main/java/org/htmlunit/css/package-info.java index 4b6c583bfd1..0d5400bc9e4 100644 --- a/src/main/java/org/htmlunit/css/package-info.java +++ b/src/main/java/org/htmlunit/css/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/AbstractDomNodeList.java b/src/main/java/org/htmlunit/html/AbstractDomNodeList.java index 72c354e9a12..c5a1434f11b 100644 --- a/src/main/java/org/htmlunit/html/AbstractDomNodeList.java +++ b/src/main/java/org/htmlunit/html/AbstractDomNodeList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/BaseFrameElement.java b/src/main/java/org/htmlunit/html/BaseFrameElement.java index b1ed2a0f326..7d1ffd0aa31 100644 --- a/src/main/java/org/htmlunit/html/BaseFrameElement.java +++ b/src/main/java/org/htmlunit/html/BaseFrameElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/CharacterDataChangeEvent.java b/src/main/java/org/htmlunit/html/CharacterDataChangeEvent.java index b87d090fab6..ad975321c44 100644 --- a/src/main/java/org/htmlunit/html/CharacterDataChangeEvent.java +++ b/src/main/java/org/htmlunit/html/CharacterDataChangeEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/CharacterDataChangeListener.java b/src/main/java/org/htmlunit/html/CharacterDataChangeListener.java index a81b44dc1dd..d37c4ce833f 100644 --- a/src/main/java/org/htmlunit/html/CharacterDataChangeListener.java +++ b/src/main/java/org/htmlunit/html/CharacterDataChangeListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +20,10 @@ * Implementations of this interface receive notifications of changes to the Character Data. * * @author Ahmed Ashour + * @author Ronald Brill * @see CharacterDataChangeEvent */ +@FunctionalInterface public interface CharacterDataChangeListener extends Serializable { /** diff --git a/src/main/java/org/htmlunit/html/DefaultElementFactory.java b/src/main/java/org/htmlunit/html/DefaultElementFactory.java index 236d0cb112a..7e76ed5eb57 100644 --- a/src/main/java/org/htmlunit/html/DefaultElementFactory.java +++ b/src/main/java/org/htmlunit/html/DefaultElementFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/DisabledElement.java b/src/main/java/org/htmlunit/html/DisabledElement.java index 1719d45eb93..abf6d54971d 100644 --- a/src/main/java/org/htmlunit/html/DisabledElement.java +++ b/src/main/java/org/htmlunit/html/DisabledElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/DoTypeProcessor.java b/src/main/java/org/htmlunit/html/DoTypeProcessor.java index 41bc133a75c..c32c36b3222 100644 --- a/src/main/java/org/htmlunit/html/DoTypeProcessor.java +++ b/src/main/java/org/htmlunit/html/DoTypeProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,7 +68,7 @@ class DoTypeProcessor implements Serializable { SPECIAL_KEYS_MAP_.put(DOM_VK_SUBTRACT, '-'); for (int i = DOM_VK_NUMPAD0; i <= DOM_VK_NUMPAD9; i++) { - SPECIAL_KEYS_MAP_.put(i, (char) ('0' + (i - DOM_VK_NUMPAD0))); + SPECIAL_KEYS_MAP_.put(i, (char) ('0' + i - DOM_VK_NUMPAD0)); } } diff --git a/src/main/java/org/htmlunit/html/DomAttr.java b/src/main/java/org/htmlunit/html/DomAttr.java index b4a3d6c78f4..19affc2d36d 100644 --- a/src/main/java/org/htmlunit/html/DomAttr.java +++ b/src/main/java/org/htmlunit/html/DomAttr.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -108,7 +108,13 @@ public void setNodeValue(final String value) { */ @Override public void setValue(final String value) { - value_ = value; + if (value != null + && value.isEmpty()) { + value_ = DomElement.ATTRIBUTE_VALUE_EMPTY; + } + else { + value_ = value; + } specified_ = true; } diff --git a/src/main/java/org/htmlunit/html/DomCDataSection.java b/src/main/java/org/htmlunit/html/DomCDataSection.java index eac1f7f6875..2a1f0d7bf2d 100644 --- a/src/main/java/org/htmlunit/html/DomCDataSection.java +++ b/src/main/java/org/htmlunit/html/DomCDataSection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ * * @author Marc Guillemot * @author David K. Taylor + * @author Ronald Brill */ public class DomCDataSection extends DomText implements CDATASection { @@ -57,10 +58,11 @@ public String getNodeName() { * {@inheritDoc} */ @Override - protected void printXml(final String indent, final PrintWriter printWriter) { + protected boolean printXml(final String indent, final boolean tagBefore, final PrintWriter printWriter) { printWriter.print(""); + return true; } /** diff --git a/src/main/java/org/htmlunit/html/DomChangeEvent.java b/src/main/java/org/htmlunit/html/DomChangeEvent.java index 25a12b2e99b..b595ea3d4ae 100644 --- a/src/main/java/org/htmlunit/html/DomChangeEvent.java +++ b/src/main/java/org/htmlunit/html/DomChangeEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/DomChangeListener.java b/src/main/java/org/htmlunit/html/DomChangeListener.java index 352a075e8e8..56522bed5d9 100644 --- a/src/main/java/org/htmlunit/html/DomChangeListener.java +++ b/src/main/java/org/htmlunit/html/DomChangeListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/DomCharacterData.java b/src/main/java/org/htmlunit/html/DomCharacterData.java index 635af0a0e8a..79e316a31fd 100644 --- a/src/main/java/org/htmlunit/html/DomCharacterData.java +++ b/src/main/java/org/htmlunit/html/DomCharacterData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -105,9 +105,9 @@ public void appendData(final String newData) { /** * Deletes characters from character data. * @param offset the position of the first character to be deleted (can't be - * less than zero) + * less than zero) * @param count the number of characters to be deleted, if less than zero - * leaves the first offset chars + * leaves the first offset chars */ @Override public void deleteData(final int offset, final int count) { diff --git a/src/main/java/org/htmlunit/html/DomComment.java b/src/main/java/org/htmlunit/html/DomComment.java index a77e117abaa..4bdaa338a6d 100644 --- a/src/main/java/org/htmlunit/html/DomComment.java +++ b/src/main/java/org/htmlunit/html/DomComment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ * * @author Karel Kolman * @author Ahmed Ashour + * @author Ronald Brill */ public class DomComment extends DomCharacterData implements Comment { @@ -58,18 +59,15 @@ public String getNodeName() { } /** - * Recursively write the XML data for the node tree starting at node. - * - * @param indent white space to indent child nodes - * @param printWriter writer where child nodes are written + * {@inheritDoc} */ @Override - protected void printXml(final String indent, final PrintWriter printWriter) { + protected boolean printXml(final String indent, final boolean tagBefore, final PrintWriter printWriter) { printWriter.print(indent); printWriter.print(""); - printChildrenAsXml(indent, printWriter); + return printChildrenAsXml(indent, true, printWriter); } /** diff --git a/src/main/java/org/htmlunit/html/DomDocumentFragment.java b/src/main/java/org/htmlunit/html/DomDocumentFragment.java index 382f82f019c..0a52964b75f 100644 --- a/src/main/java/org/htmlunit/html/DomDocumentFragment.java +++ b/src/main/java/org/htmlunit/html/DomDocumentFragment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/DomDocumentType.java b/src/main/java/org/htmlunit/html/DomDocumentType.java index 18d34769d70..638ac0c4c89 100644 --- a/src/main/java/org/htmlunit/html/DomDocumentType.java +++ b/src/main/java/org/htmlunit/html/DomDocumentType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/DomElement.java b/src/main/java/org/htmlunit/html/DomElement.java index 16cedb8ebca..e2356510d30 100644 --- a/src/main/java/org/htmlunit/html/DomElement.java +++ b/src/main/java/org/htmlunit/html/DomElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.Comparator; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; @@ -110,6 +111,13 @@ public class DomElement extends DomNamespaceNode implements Element { private String styleString_; private LinkedHashMap styleMap_; + private static final Comparator STYLE_ELEMENT_COMPARATOR = new Comparator() { + @Override + public int compare(final StyleElement first, final StyleElement second) { + return StyleElement.compareToByImportanceAndSpecificity(first, second); + } + }; + /** * Whether the Mouse is currently over this element or not. */ @@ -122,7 +130,7 @@ public class DomElement extends DomNamespaceNode implements Element { * @param qualifiedName the qualified name of the element type to instantiate * @param page the page that contains this element * @param attributes a map ready initialized with the attributes for this element, or - * {@code null}. The map will be stored as is, not copied. + * {@code null}. The map will be stored as is, not copied. */ public DomElement(final String namespaceURI, final String qualifiedName, final SgmlPage page, final Map attributes) { @@ -187,7 +195,7 @@ public final boolean hasAttributes() { * * @param attributeName the name of the attribute * @return true if an attribute with the given name is specified on this element or has a - * default value, false otherwise. + * default value, false otherwise. */ @Override public boolean hasAttribute(final String attributeName) { @@ -342,28 +350,41 @@ protected void printOpeningTagContentAsXml(final PrintWriter printWriter) { } /** - * Recursively write the XML data for the node tree starting at node. - * - * @param indent white space to indent child nodes - * @param printWriter writer where child nodes are written + * {@inheritDoc} */ @Override - protected void printXml(final String indent, final PrintWriter printWriter) { + protected boolean printXml(final String indent, final boolean tagBefore, final PrintWriter printWriter) { final boolean hasChildren = getFirstChild() != null; - printWriter.print(indent + "<"); - printOpeningTagContentAsXml(printWriter); - if (hasChildren || isEmptyXmlTagExpanded()) { - printWriter.print(">\r\n"); - printChildrenAsXml(indent, printWriter); + if (tagBefore) { + printWriter.print("\r\n"); printWriter.print(indent); + } + + printWriter.print('<'); + printOpeningTagContentAsXml(printWriter); + + if (hasChildren) { + printWriter.print(">"); + final boolean tag = printChildrenAsXml(indent, true, printWriter); + if (tag) { + printWriter.print("\r\n"); + printWriter.print(indent); + } printWriter.print("\r\n"); + printWriter.print(">"); + } + else if (isEmptyXmlTagExpanded()) { + printWriter.print(">"); } else { - printWriter.print("/>\r\n"); + printWriter.print("/>"); } + + return true; } /** @@ -469,7 +490,7 @@ public final Attr removeAttributeNode(final Attr attribute) { * @param namespaceURI the URI that identifies an XML namespace * @param localName the name within the namespace * @return true if an attribute with the given name is specified on this element or has a - * default value, false otherwise. + * default value, false otherwise. */ @Override public final boolean hasAttributeNS(final String namespaceURI, final String localName) { @@ -604,7 +625,7 @@ public void writeStyleToElement(final Map styleMap) { final StringBuilder builder = new StringBuilder(); final List styleElements = new ArrayList<>(styleMap.values()); - Collections.sort(styleElements); + Collections.sort(styleElements, STYLE_ELEMENT_COMPARATOR); for (final StyleElement e : styleElements) { if (builder.length() != 0) { builder.append(' '); @@ -663,7 +684,10 @@ public List getStaticElementsByTagName(final String t for (final Iterator iterator = this.new DescendantHtmlElementsIterator(); iterator.hasNext();) { final HtmlElement elem = iterator.next(); if (elem.getLocalName().equalsIgnoreCase(tagName)) { - res.add((E) elem); + final String prefix = elem.getPrefix(); + if (prefix == null || prefix.isEmpty()) { + res.add((E) elem); + } } } return res; @@ -787,10 +811,12 @@ public DomElement getLastElementChild() { * Returns the current number of element nodes that are children of this element. * @return the current number of element nodes that are children of this element. */ - @SuppressWarnings("PMD.UnusedLocalVariable") public int getChildElementCount() { int counter = 0; - for (final DomElement elem : getChildElements()) { + + final Iterator iterator = getChildElements().iterator(); + while (iterator.hasNext()) { + iterator.next(); counter++; } return counter; @@ -809,7 +835,8 @@ public final Iterable getChildElements() { private static class ChildElementsIterable implements Iterable { private final Iterator iterator_; - /** Constructor. + /** + * Constructor. * @param domNode the parent */ protected ChildElementsIterable(final DomNode domNode) { @@ -829,7 +856,8 @@ protected static class ChildElementsIterator implements Iterator { private DomElement nextElement_; - /** Constructor. + /** + * Constructor. * @param domNode the parent */ protected ChildElementsIterator(final DomNode domNode) { @@ -844,13 +872,17 @@ protected ChildElementsIterator(final DomNode domNode) { } } - /** @return is there a next one ? */ + /** + * @return is there a next one ? + */ @Override public boolean hasNext() { return nextElement_ != null; } - /** @return the next one */ + /** + * @return the next one + */ @Override public DomElement next() { if (nextElement_ != null) { @@ -1166,7 +1198,7 @@ public

P click(final Event event, * @param ctrlKey {@code true} if CTRL is pressed * * @return true if doClickFireEvent method has to be called later on (to signal, - * that the value was changed) + * that the value was changed) * @throws IOException if an IO error occurs */ protected boolean doClickStateUpdate(final boolean shiftKey, final boolean ctrlKey) throws IOException { @@ -1184,11 +1216,9 @@ protected boolean doClickStateUpdate(final boolean shiftKey, final boolean ctrlK } /** - * @see #doClickStateUpdate(boolean, boolean) - * Usually the click is propagated to the parent. Overwrite if you - * like to disable this. - * + * Usually the click is propagated to the parent. Overwrite if you like to disable this. * @return true or false + * @see #doClickStateUpdate(boolean, boolean) */ protected boolean propagateClickStateUpdateToParent() { return true; diff --git a/src/main/java/org/htmlunit/html/DomNamespaceNode.java b/src/main/java/org/htmlunit/html/DomNamespaceNode.java index ebc04fb2fdc..5370245b195 100644 --- a/src/main/java/org/htmlunit/html/DomNamespaceNode.java +++ b/src/main/java/org/htmlunit/html/DomNamespaceNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/DomNode.java b/src/main/java/org/htmlunit/html/DomNode.java index 7cd051f2081..21db7e8fd08 100644 --- a/src/main/java/org/htmlunit/html/DomNode.java +++ b/src/main/java/org/htmlunit/html/DomNode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,6 @@ import org.htmlunit.html.serializer.HtmlSerializerVisibleText; import org.htmlunit.html.xpath.XPathHelper; import org.htmlunit.javascript.HtmlUnitScriptable; -import org.htmlunit.javascript.JavaScriptEngine; import org.htmlunit.javascript.host.event.Event; import org.htmlunit.xpath.xml.utils.PrefixResolver; import org.w3c.dom.DOMException; @@ -208,7 +207,7 @@ public int getStartColumnNumber() { /** * Returns the line number in the source page where the DOM node ends. * @return 0 if no information on the line number is available (for instance for nodes dynamically added), - * -1 if the end tag has not yet been parsed (during page loading) + * -1 if the end tag has not yet been parsed (during page loading) */ public int getEndLineNumber() { return endLineNumber_; @@ -217,7 +216,7 @@ public int getEndLineNumber() { /** * Returns the column number in the source page where the DOM node ends. * @return 0 if no information on the line number is available (for instance for nodes dynamically added), - * -1 if the end tag has not yet been parsed (during page loading) + * -1 if the end tag has not yet been parsed (during page loading) */ public int getEndColumnNumber() { return endColumnNumber_; @@ -790,12 +789,14 @@ public String asXml() { final StringWriter stringWriter = new StringWriter(); try (PrintWriter printWriter = new PrintWriter(stringWriter)) { + boolean tag = false; if (charsetName != null && this instanceof HtmlHtml) { printWriter.print("\r\n"); + printWriter.print("\"?>"); + tag = true; } - printXml("", printWriter); + printXml("", tag, printWriter); return stringWriter.toString(); } } @@ -804,27 +805,35 @@ public String asXml() { * Recursively writes the XML data for the node tree starting at node. * * @param indent white space to indent child nodes + * @param tagBefore true if the last thing printed was a tag * @param printWriter writer where child nodes are written + * @return true if the last thing printed was a tag */ - protected void printXml(final String indent, final PrintWriter printWriter) { - printWriter.print(indent); + protected boolean printXml(final String indent, final boolean tagBefore, final PrintWriter printWriter) { + if (tagBefore) { + printWriter.print("\r\n"); + printWriter.print(indent); + } printWriter.print(this); - printWriter.print("\r\n"); - printChildrenAsXml(indent, printWriter); + return printChildrenAsXml(indent, false, printWriter); } /** * Recursively writes the XML data for the node tree starting at node. * * @param indent white space to indent child nodes + * @param tagBefore true if the last thing printed was a tag * @param printWriter writer where child nodes are written + * @return true if the last thing printed was a tag */ - protected void printChildrenAsXml(final String indent, final PrintWriter printWriter) { + protected boolean printChildrenAsXml(final String indent, final boolean tagBefore, final PrintWriter printWriter) { DomNode child = getFirstChild(); + boolean tag = tagBefore; while (child != null) { - child.printXml(indent + " ", printWriter); + tag = child.printXml(indent + " ", tag, printWriter); child = child.getNextSibling(); } + return tag; } /** @@ -908,11 +917,11 @@ public T getScriptableObject() { @Override public DomNode appendChild(final Node node) { if (node == this) { - throw JavaScriptEngine.throwAsScriptRuntimeEx(new Exception("Can not add not to itself " + this)); + throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, "Can not add not to itself " + this); } final DomNode domNode = (DomNode) node; if (domNode.isAncestorOf(this)) { - throw JavaScriptEngine.throwAsScriptRuntimeEx(new Exception("Can not add (grand)parent to itself " + this)); + throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR, "Can not add (grand)parent to itself " + this); } if (domNode instanceof DomDocumentFragment) { @@ -1121,7 +1130,8 @@ public void removeAllChildren() { * @throws SAXException in case of error */ public void parseHtmlSnippet(final String source) throws SAXException, IOException { - getPage().getWebClient().getPageCreator().getHtmlParser().parseFragment(this, source); + final WebClient webClient = getPage().getWebClient(); + webClient.getPageCreator().getHtmlParser().parseFragment(webClient, this, this, source, false); } /** @@ -1174,7 +1184,7 @@ else if (previousSibling_ != null && previousSibling_.nextSibling_ == this) { private void fireRemoval(final DomNode exParent) { final SgmlPage page = getPage(); - if (page != null && page instanceof HtmlPage) { + if (page instanceof HtmlPage) { // some actions executed on removal need an intact parent relationship (e.g. for the // DocumentPositionComparator) so we have to restore it temporarily parent_ = exParent; @@ -1245,11 +1255,11 @@ public void quietlyRemoveAndMoveChildrenTo(final DomNode destination) { * * @param newChild the new child node that is being inserted below this node * @throws DOMException HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does - * not allow children of the type of the newChild node, or if the node to insert is one of - * this node's ancestors or this node itself, or if this node is of type Document and the - * DOM application attempts to insert a second DocumentType or Element node. - * WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the - * one that created this node. + * not allow children of the type of the newChild node, or if the node to insert is one of + * this node's ancestors or this node itself, or if this node is of type Document and the + * DOM application attempts to insert a second DocumentType or Element node. + * WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the + * one that created this node. */ protected void checkChildHierarchy(final Node newChild) throws DOMException { Node parentNode = this; @@ -1392,7 +1402,7 @@ public final Iterable getDomElementDescendants() { * @param the type of nodes over which to iterate * * @deprecated as of version 4.7.0; use {@link DescendantDomNodesIterator}, - * {@link DescendantDomElementsIterator}, or {@link DescendantHtmlElementsIterator} instead. + * {@link DescendantDomElementsIterator}, or {@link DescendantHtmlElementsIterator} instead. */ @Deprecated protected class DescendantElementsIterator implements Iterator { @@ -1435,7 +1445,9 @@ public void remove() { current.remove(); } - /** @return the next node, if there is one */ + /** + * @return the next node, if there is one + */ @SuppressWarnings("unchecked") public T nextNode() { currentNode_ = nextNode_; @@ -1538,7 +1550,9 @@ public void remove() { current.remove(); } - /** @return the next node, if there is one */ + /** + * @return the next node, if there is one + */ @SuppressWarnings("unchecked") public DomNode nextNode() { currentNode_ = nextNode_; @@ -1639,7 +1653,9 @@ public void remove() { current.remove(); } - /** @return the next node, if there is one */ + /** + * @return the next node, if there is one + */ @SuppressWarnings("unchecked") public DomElement nextNode() { currentNode_ = nextNode_; @@ -1740,7 +1756,9 @@ public void remove() { current.remove(); } - /** @return the next node, if there is one */ + /** + * @return the next node, if there is one + */ @SuppressWarnings("unchecked") public HtmlElement nextNode() { currentNode_ = nextNode_; @@ -2228,7 +2246,7 @@ public boolean handles(final Event event) { * Returns the previous sibling element node of this element. * null if this element has no element sibling nodes that come before this one in the document tree. * @return the previous sibling element node of this element. - * null if this element has no element sibling nodes that come before this one in the document tree + * null if this element has no element sibling nodes that come before this one in the document tree */ public DomElement getPreviousElementSibling() { DomNode node = getPreviousSibling(); @@ -2242,7 +2260,7 @@ public DomElement getPreviousElementSibling() { * Returns the next sibling element node of this element. * null if this element has no element sibling nodes that come after this one in the document tree. * @return the next sibling element node of this element. - * null if this element has no element sibling nodes that come after this one in the document tree + * null if this element has no element sibling nodes that come after this one in the document tree */ public DomElement getNextElementSibling() { DomNode node = getNextSibling(); @@ -2289,9 +2307,6 @@ public DomElement closest(final String selectorString) { * An unmodifiable empty {@link NamedNodeMap} implementation. */ private static final class ReadOnlyEmptyNamedNodeMapImpl implements NamedNodeMap, Serializable { - private ReadOnlyEmptyNamedNodeMapImpl() { - super(); - } /** * {@inheritDoc} diff --git a/src/main/java/org/htmlunit/html/DomNodeIterator.java b/src/main/java/org/htmlunit/html/DomNodeIterator.java index 1f8169719c5..7ee396527d3 100644 --- a/src/main/java/org/htmlunit/html/DomNodeIterator.java +++ b/src/main/java/org/htmlunit/html/DomNodeIterator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ */ package org.htmlunit.html; +import java.io.Serializable; + import org.w3c.dom.Node; import org.w3c.dom.traversal.NodeFilter; import org.w3c.dom.traversal.NodeIterator; @@ -24,7 +26,7 @@ * @author Ahmed Ashour * @author Ronald Brill */ -public class DomNodeIterator implements NodeIterator { +public class DomNodeIterator implements NodeIterator, Serializable { private final DomNode root_; private final int whatToShow_; @@ -38,7 +40,7 @@ public class DomNodeIterator implements NodeIterator { * * @param root The root node at which to begin the {@link NodeIterator}'s traversal * @param whatToShow an optional int representing a bitmask created by combining - * the constant properties of {@link NodeFilter} + * the constant properties of {@link NodeFilter} * @param expandEntityReferences If false, the contents of * EntityReference nodes are not present in the logical view. * @param filter an object implementing the {@link NodeFilter} interface @@ -143,15 +145,7 @@ private DomNode traverse(final boolean next) { } else { if (beforeNode) { - final DomNode left = getSibling(node, true); - if (left == null) { - final Node parent = node.getParentNode(); - if (parent == null) { - node = null; - } - } - - DomNode follow = left; + DomNode follow = getSibling(node, true); if (follow != null) { while (follow.hasChildNodes()) { final DomNode toFollow = getChild(follow, false); diff --git a/src/main/java/org/htmlunit/html/DomNodeList.java b/src/main/java/org/htmlunit/html/DomNodeList.java index 2c00592413c..3080c25e5ec 100644 --- a/src/main/java/org/htmlunit/html/DomNodeList.java +++ b/src/main/java/org/htmlunit/html/DomNodeList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/DomProcessingInstruction.java b/src/main/java/org/htmlunit/html/DomProcessingInstruction.java index 26d3c01f574..801576b36d7 100644 --- a/src/main/java/org/htmlunit/html/DomProcessingInstruction.java +++ b/src/main/java/org/htmlunit/html/DomProcessingInstruction.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ * Wrapper for the DOM node ProcessingInstruction. * * @author Ahmed Ashour + * @author Ronald Brill */ public class DomProcessingInstruction extends DomNode implements ProcessingInstruction { @@ -112,12 +113,13 @@ public void setTextContent(final String textContent) { * {@inheritDoc} */ @Override - protected void printXml(final String indent, final PrintWriter printWriter) { + protected boolean printXml(final String indent, final boolean tagBefore, final PrintWriter printWriter) { printWriter.print(""); + return true; } /** diff --git a/src/main/java/org/htmlunit/html/DomText.java b/src/main/java/org/htmlunit/html/DomText.java index 9db0277f5dc..a8f9982c4dc 100644 --- a/src/main/java/org/htmlunit/html/DomText.java +++ b/src/main/java/org/htmlunit/html/DomText.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -128,23 +128,20 @@ public String getNodeName() { } /** - * Recursively writes the XML data for the node tree starting at node. - * - * @param indent white space to indent child nodes - * @param printWriter writer where child nodes are written + * {@inheritDoc} */ @Override - protected void printXml(final String indent, final PrintWriter printWriter) { + protected boolean printXml(final String indent, final boolean tagBefore, final PrintWriter printWriter) { String data = getData(); + boolean tag = tagBefore; if (org.apache.commons.lang3.StringUtils.isNotBlank(data)) { - printWriter.print(indent); if (!(getParentNode() instanceof HtmlStyle) || !data.startsWith("")) { data = StringUtils.escapeXmlChars(data); } printWriter.print(data); - printWriter.print("\r\n"); + tag = false; } - printChildrenAsXml(indent, printWriter); + return printChildrenAsXml(indent, tag, printWriter); } /** diff --git a/src/main/java/org/htmlunit/html/ElementFactory.java b/src/main/java/org/htmlunit/html/ElementFactory.java index 303bdd3f79c..e6ba4ce68ff 100644 --- a/src/main/java/org/htmlunit/html/ElementFactory.java +++ b/src/main/java/org/htmlunit/html/ElementFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/ElementFromPointHandler.java b/src/main/java/org/htmlunit/html/ElementFromPointHandler.java index 154db0a2099..02e055c4d09 100644 --- a/src/main/java/org/htmlunit/html/ElementFromPointHandler.java +++ b/src/main/java/org/htmlunit/html/ElementFromPointHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/FormFieldWithNameHistory.java b/src/main/java/org/htmlunit/html/FormFieldWithNameHistory.java index 2bb60e27daf..fccd64a38e3 100644 --- a/src/main/java/org/htmlunit/html/FormFieldWithNameHistory.java +++ b/src/main/java/org/htmlunit/html/FormFieldWithNameHistory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/FrameWindow.java b/src/main/java/org/htmlunit/html/FrameWindow.java index e67f96fdcc7..2427f9aee7e 100644 --- a/src/main/java/org/htmlunit/html/FrameWindow.java +++ b/src/main/java/org/htmlunit/html/FrameWindow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/Html.java b/src/main/java/org/htmlunit/html/Html.java index 1cd5264a182..d12ed2e2454 100644 --- a/src/main/java/org/htmlunit/html/Html.java +++ b/src/main/java/org/htmlunit/html/Html.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,9 @@ */ public final class Html { + /** The html5 doctype. */ + public static final String DOCTYPE_HTML = ""; + /** XHTML namespace. */ public static final String XHTML_NAMESPACE = "http://www.w3.org/1999/xhtml"; diff --git a/src/main/java/org/htmlunit/html/HtmlAbbreviated.java b/src/main/java/org/htmlunit/html/HtmlAbbreviated.java index cd39db4e339..da78125251e 100644 --- a/src/main/java/org/htmlunit/html/HtmlAbbreviated.java +++ b/src/main/java/org/htmlunit/html/HtmlAbbreviated.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlAcronym.java b/src/main/java/org/htmlunit/html/HtmlAcronym.java index 7f2d21b377e..52ee3ad1554 100644 --- a/src/main/java/org/htmlunit/html/HtmlAcronym.java +++ b/src/main/java/org/htmlunit/html/HtmlAcronym.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlAddress.java b/src/main/java/org/htmlunit/html/HtmlAddress.java index 4c5fba1f928..f8c760e46d4 100644 --- a/src/main/java/org/htmlunit/html/HtmlAddress.java +++ b/src/main/java/org/htmlunit/html/HtmlAddress.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlAnchor.java b/src/main/java/org/htmlunit/html/HtmlAnchor.java index 056887de0cd..ba42f1b9857 100644 --- a/src/main/java/org/htmlunit/html/HtmlAnchor.java +++ b/src/main/java/org/htmlunit/html/HtmlAnchor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -195,7 +195,7 @@ protected void doClickStateUpdate(final boolean shiftKey, final boolean ctrlKey, target = page.getResolvedTarget(getTargetAttribute()); } page.getWebClient().download(page.getEnclosingWindow(), target, webRequest, - true, false, (ATTRIBUTE_NOT_DEFINED != downloadAttribute) ? downloadAttribute : null, "Link click"); + true, (ATTRIBUTE_NOT_DEFINED != downloadAttribute) ? downloadAttribute : null, "Link click"); } private boolean relContainsNoreferrer() { diff --git a/src/main/java/org/htmlunit/html/HtmlArea.java b/src/main/java/org/htmlunit/html/HtmlArea.java index 103f523d069..129b22d02d2 100644 --- a/src/main/java/org/htmlunit/html/HtmlArea.java +++ b/src/main/java/org/htmlunit/html/HtmlArea.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlArticle.java b/src/main/java/org/htmlunit/html/HtmlArticle.java index 4cf20fbb923..41634809154 100644 --- a/src/main/java/org/htmlunit/html/HtmlArticle.java +++ b/src/main/java/org/htmlunit/html/HtmlArticle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlAside.java b/src/main/java/org/htmlunit/html/HtmlAside.java index caa7a641cd6..6940cd01dd6 100644 --- a/src/main/java/org/htmlunit/html/HtmlAside.java +++ b/src/main/java/org/htmlunit/html/HtmlAside.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlAttributeChangeEvent.java b/src/main/java/org/htmlunit/html/HtmlAttributeChangeEvent.java index 32ae7b62c56..ccbcb896d53 100644 --- a/src/main/java/org/htmlunit/html/HtmlAttributeChangeEvent.java +++ b/src/main/java/org/htmlunit/html/HtmlAttributeChangeEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlAttributeChangeListener.java b/src/main/java/org/htmlunit/html/HtmlAttributeChangeListener.java index 23c9603de49..fd5adf4b638 100644 --- a/src/main/java/org/htmlunit/html/HtmlAttributeChangeListener.java +++ b/src/main/java/org/htmlunit/html/HtmlAttributeChangeListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlAudio.java b/src/main/java/org/htmlunit/html/HtmlAudio.java index 18cb378beca..289e66b4434 100644 --- a/src/main/java/org/htmlunit/html/HtmlAudio.java +++ b/src/main/java/org/htmlunit/html/HtmlAudio.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlBackgroundSound.java b/src/main/java/org/htmlunit/html/HtmlBackgroundSound.java index c39b14e9983..460633e86bf 100644 --- a/src/main/java/org/htmlunit/html/HtmlBackgroundSound.java +++ b/src/main/java/org/htmlunit/html/HtmlBackgroundSound.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlBase.java b/src/main/java/org/htmlunit/html/HtmlBase.java index d5d61df1409..3056fae6771 100644 --- a/src/main/java/org/htmlunit/html/HtmlBase.java +++ b/src/main/java/org/htmlunit/html/HtmlBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlBaseFont.java b/src/main/java/org/htmlunit/html/HtmlBaseFont.java index b0e66fd9158..77224e41f08 100644 --- a/src/main/java/org/htmlunit/html/HtmlBaseFont.java +++ b/src/main/java/org/htmlunit/html/HtmlBaseFont.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlBidirectionalIsolation.java b/src/main/java/org/htmlunit/html/HtmlBidirectionalIsolation.java index c9b8ca11716..9b5c4d68eea 100644 --- a/src/main/java/org/htmlunit/html/HtmlBidirectionalIsolation.java +++ b/src/main/java/org/htmlunit/html/HtmlBidirectionalIsolation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlBidirectionalOverride.java b/src/main/java/org/htmlunit/html/HtmlBidirectionalOverride.java index d10392fc5f7..7442adc95eb 100644 --- a/src/main/java/org/htmlunit/html/HtmlBidirectionalOverride.java +++ b/src/main/java/org/htmlunit/html/HtmlBidirectionalOverride.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlBig.java b/src/main/java/org/htmlunit/html/HtmlBig.java index 14275f70c17..0775020322b 100644 --- a/src/main/java/org/htmlunit/html/HtmlBig.java +++ b/src/main/java/org/htmlunit/html/HtmlBig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlBlockQuote.java b/src/main/java/org/htmlunit/html/HtmlBlockQuote.java index cc46acedc6b..a68b95825c1 100644 --- a/src/main/java/org/htmlunit/html/HtmlBlockQuote.java +++ b/src/main/java/org/htmlunit/html/HtmlBlockQuote.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlBody.java b/src/main/java/org/htmlunit/html/HtmlBody.java index 7599394a57e..762e03530ee 100644 --- a/src/main/java/org/htmlunit/html/HtmlBody.java +++ b/src/main/java/org/htmlunit/html/HtmlBody.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlBold.java b/src/main/java/org/htmlunit/html/HtmlBold.java index 1fc36341217..2aceb9a1471 100644 --- a/src/main/java/org/htmlunit/html/HtmlBold.java +++ b/src/main/java/org/htmlunit/html/HtmlBold.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlBreak.java b/src/main/java/org/htmlunit/html/HtmlBreak.java index 890c3bc2591..95faabb88c1 100644 --- a/src/main/java/org/htmlunit/html/HtmlBreak.java +++ b/src/main/java/org/htmlunit/html/HtmlBreak.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlButton.java b/src/main/java/org/htmlunit/html/HtmlButton.java index 8acce57fe2f..0b060974104 100644 --- a/src/main/java/org/htmlunit/html/HtmlButton.java +++ b/src/main/java/org/htmlunit/html/HtmlButton.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlButtonInput.java b/src/main/java/org/htmlunit/html/HtmlButtonInput.java index daf6e7dc54c..401aaed4964 100644 --- a/src/main/java/org/htmlunit/html/HtmlButtonInput.java +++ b/src/main/java/org/htmlunit/html/HtmlButtonInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlCanvas.java b/src/main/java/org/htmlunit/html/HtmlCanvas.java index 7c7b53a7b31..7ec012d4702 100644 --- a/src/main/java/org/htmlunit/html/HtmlCanvas.java +++ b/src/main/java/org/htmlunit/html/HtmlCanvas.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlCaption.java b/src/main/java/org/htmlunit/html/HtmlCaption.java index 2d1e5a4f391..5d24f5eb7c7 100644 --- a/src/main/java/org/htmlunit/html/HtmlCaption.java +++ b/src/main/java/org/htmlunit/html/HtmlCaption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlCenter.java b/src/main/java/org/htmlunit/html/HtmlCenter.java index 7dc3ee22ae9..e7493cb46ee 100644 --- a/src/main/java/org/htmlunit/html/HtmlCenter.java +++ b/src/main/java/org/htmlunit/html/HtmlCenter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlCheckBoxInput.java b/src/main/java/org/htmlunit/html/HtmlCheckBoxInput.java index a0ad891fe45..2309c933e94 100644 --- a/src/main/java/org/htmlunit/html/HtmlCheckBoxInput.java +++ b/src/main/java/org/htmlunit/html/HtmlCheckBoxInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlCitation.java b/src/main/java/org/htmlunit/html/HtmlCitation.java index f4017caba11..ed8bc0b5710 100644 --- a/src/main/java/org/htmlunit/html/HtmlCitation.java +++ b/src/main/java/org/htmlunit/html/HtmlCitation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlCode.java b/src/main/java/org/htmlunit/html/HtmlCode.java index 69b45eeb58e..762245c0698 100644 --- a/src/main/java/org/htmlunit/html/HtmlCode.java +++ b/src/main/java/org/htmlunit/html/HtmlCode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlColorInput.java b/src/main/java/org/htmlunit/html/HtmlColorInput.java index 4f45c319a8c..1184303ea32 100644 --- a/src/main/java/org/htmlunit/html/HtmlColorInput.java +++ b/src/main/java/org/htmlunit/html/HtmlColorInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlData.java b/src/main/java/org/htmlunit/html/HtmlData.java index e00312a03e0..c6dd99fff5f 100644 --- a/src/main/java/org/htmlunit/html/HtmlData.java +++ b/src/main/java/org/htmlunit/html/HtmlData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlDataList.java b/src/main/java/org/htmlunit/html/HtmlDataList.java index cbed89585d2..b6b40bc49ac 100644 --- a/src/main/java/org/htmlunit/html/HtmlDataList.java +++ b/src/main/java/org/htmlunit/html/HtmlDataList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlDateInput.java b/src/main/java/org/htmlunit/html/HtmlDateInput.java index 8e4acc1a0c9..e7bac09c29b 100644 --- a/src/main/java/org/htmlunit/html/HtmlDateInput.java +++ b/src/main/java/org/htmlunit/html/HtmlDateInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlDateTimeLocalInput.java b/src/main/java/org/htmlunit/html/HtmlDateTimeLocalInput.java index 4855ce8ce8a..6924a61c506 100644 --- a/src/main/java/org/htmlunit/html/HtmlDateTimeLocalInput.java +++ b/src/main/java/org/htmlunit/html/HtmlDateTimeLocalInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlDefinition.java b/src/main/java/org/htmlunit/html/HtmlDefinition.java index e76775d0ede..025922ec14f 100644 --- a/src/main/java/org/htmlunit/html/HtmlDefinition.java +++ b/src/main/java/org/htmlunit/html/HtmlDefinition.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlDefinitionDescription.java b/src/main/java/org/htmlunit/html/HtmlDefinitionDescription.java index 9d3c9342a57..12fbd63545d 100644 --- a/src/main/java/org/htmlunit/html/HtmlDefinitionDescription.java +++ b/src/main/java/org/htmlunit/html/HtmlDefinitionDescription.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlDefinitionList.java b/src/main/java/org/htmlunit/html/HtmlDefinitionList.java index 10266abde0a..2d24cfa6039 100644 --- a/src/main/java/org/htmlunit/html/HtmlDefinitionList.java +++ b/src/main/java/org/htmlunit/html/HtmlDefinitionList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlDefinitionTerm.java b/src/main/java/org/htmlunit/html/HtmlDefinitionTerm.java index 206284e1146..64511c1c4d7 100644 --- a/src/main/java/org/htmlunit/html/HtmlDefinitionTerm.java +++ b/src/main/java/org/htmlunit/html/HtmlDefinitionTerm.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlDeletedText.java b/src/main/java/org/htmlunit/html/HtmlDeletedText.java index e58e8feb394..9cc465b4c15 100644 --- a/src/main/java/org/htmlunit/html/HtmlDeletedText.java +++ b/src/main/java/org/htmlunit/html/HtmlDeletedText.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlDetails.java b/src/main/java/org/htmlunit/html/HtmlDetails.java index 2da7d55735e..d624a4282d3 100644 --- a/src/main/java/org/htmlunit/html/HtmlDetails.java +++ b/src/main/java/org/htmlunit/html/HtmlDetails.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlDialog.java b/src/main/java/org/htmlunit/html/HtmlDialog.java index 22fce114683..3f9ef9a63b1 100644 --- a/src/main/java/org/htmlunit/html/HtmlDialog.java +++ b/src/main/java/org/htmlunit/html/HtmlDialog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlDirectory.java b/src/main/java/org/htmlunit/html/HtmlDirectory.java index 63a65c8cdb2..f65d92fc925 100644 --- a/src/main/java/org/htmlunit/html/HtmlDirectory.java +++ b/src/main/java/org/htmlunit/html/HtmlDirectory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlDivision.java b/src/main/java/org/htmlunit/html/HtmlDivision.java index ff4390a3838..716fbe2fb8a 100644 --- a/src/main/java/org/htmlunit/html/HtmlDivision.java +++ b/src/main/java/org/htmlunit/html/HtmlDivision.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlDomTreeWalker.java b/src/main/java/org/htmlunit/html/HtmlDomTreeWalker.java index 766c98a9ec8..0f6a9a7625e 100644 --- a/src/main/java/org/htmlunit/html/HtmlDomTreeWalker.java +++ b/src/main/java/org/htmlunit/html/HtmlDomTreeWalker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ */ package org.htmlunit.html; +import java.io.Serializable; + import org.w3c.dom.DOMException; import org.w3c.dom.Node; import org.w3c.dom.traversal.NodeFilter; @@ -24,13 +26,13 @@ * therefore we have this impl as backend. * * @see - * DOM-Level-2-Traversal-Range + * DOM-Level-2-Traversal-Range * @author Mike Dirolf * @author Frank Danek * @author Ahmed Ashour * @author Ronald Brill */ -public class HtmlDomTreeWalker { +public class HtmlDomTreeWalker implements Serializable { private final DomNode root_; private DomNode currentNode_; diff --git a/src/main/java/org/htmlunit/html/HtmlElement.java b/src/main/java/org/htmlunit/html/HtmlElement.java index db4f3011fe6..8038fc5efd2 100644 --- a/src/main/java/org/htmlunit/html/HtmlElement.java +++ b/src/main/java/org/htmlunit/html/HtmlElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,9 @@ import static org.htmlunit.BrowserVersionFeatures.HTMLELEMENT_REMOVE_ACTIVE_TRIGGERS_BLUR_EVENT; import static org.htmlunit.BrowserVersionFeatures.KEYBOARD_EVENT_SPECIAL_KEYPRESS; +import static org.htmlunit.css.CssStyleSheet.ABSOLUTE; +import static org.htmlunit.css.CssStyleSheet.FIXED; +import static org.htmlunit.css.CssStyleSheet.STATIC; import java.io.IOException; import java.util.ArrayList; @@ -31,6 +34,8 @@ import org.htmlunit.SgmlPage; import org.htmlunit.WebAssert; import org.htmlunit.WebClient; +import org.htmlunit.WebWindow; +import org.htmlunit.css.ComputedCssStyleDeclaration; import org.htmlunit.html.impl.SelectableTextInput; import org.htmlunit.javascript.HtmlUnitScriptable; import org.htmlunit.javascript.host.dom.Document; @@ -162,7 +167,7 @@ public String value() { * @param qualifiedName the qualified name of the element type to instantiate * @param page the page that contains this element * @param attributes a map ready initialized with the attributes for this element, or - * {@code null}. The map will be stored as is, not copied. + * {@code null}. The map will be stored as is, not copied. */ protected HtmlElement(final String qualifiedName, final SgmlPage page, final Map attributes) { @@ -176,7 +181,7 @@ protected HtmlElement(final String qualifiedName, final SgmlPage page, * @param qualifiedName the qualified name of the element type to instantiate * @param page the page that contains this element * @param attributes a map ready initialized with the attributes for this element, or - * {@code null}. The map will be stored as is, not copied. + * {@code null}. The map will be stored as is, not copied. */ protected HtmlElement(final String namespaceURI, final String qualifiedName, final SgmlPage page, final Map attributes) { @@ -191,17 +196,17 @@ protected void setAttributeNS(final String namespaceURI, final String qualifiedN final String attributeValue, final boolean notifyAttributeChangeListeners, final boolean notifyMutationObservers) { + final HtmlPage htmlPage = getHtmlPageOrNull(); + // TODO: Clean up; this is a hack for HtmlElement living within an XmlPage. - if (null == getHtmlPageOrNull()) { + if (null == htmlPage) { super.setAttributeNS(namespaceURI, qualifiedName, attributeValue, notifyAttributeChangeListeners, notifyMutationObservers); return; } final String oldAttributeValue = getAttribute(qualifiedName); - final HtmlPage htmlPage = (HtmlPage) getPage(); final boolean mappedElement = isAttachedToPage() - && htmlPage != null && (DomElement.NAME_ATTRIBUTE.equals(qualifiedName) || DomElement.ID_ATTRIBUTE.equals(qualifiedName)); if (mappedElement) { // cast is save here because isMappedElement checks for HtmlPage @@ -287,12 +292,19 @@ private void fireAttributeChangeImpl(final HtmlAttributeChangeEvent event, */ @Override public Attr setAttributeNode(final Attr attribute) { + final HtmlPage htmlPage = getHtmlPageOrNull(); + + // TODO: Clean up; this is a hack for HtmlElement living within an XmlPage. + if (null == htmlPage) { + return super.setAttributeNode(attribute); + } + final String qualifiedName = attribute.getName(); final String oldAttributeValue = getAttribute(qualifiedName); - final HtmlPage htmlPage = (HtmlPage) getPage(); + final boolean mappedElement = isAttachedToPage() - && htmlPage != null - && (DomElement.NAME_ATTRIBUTE.equals(qualifiedName) || DomElement.ID_ATTRIBUTE.equals(qualifiedName)); + && (DomElement.NAME_ATTRIBUTE.equals(qualifiedName) + || DomElement.ID_ATTRIBUTE.equals(qualifiedName)); if (mappedElement) { htmlPage.removeMappedElement(this, false, false); } @@ -325,23 +337,28 @@ public void removeAttribute(final String attributeName) { } final HtmlPage htmlPage = getHtmlPageOrNull(); - final boolean mapped = htmlPage != null - && (DomElement.NAME_ATTRIBUTE.equals(attributeName) || DomElement.ID_ATTRIBUTE.equals(attributeName)); + + // TODO: Clean up; this is a hack for HtmlElement living within an XmlPage. + if (null == htmlPage) { + super.removeAttribute(attributeName); + return; + } + + final boolean mapped = DomElement.NAME_ATTRIBUTE.equals(attributeName) + || DomElement.ID_ATTRIBUTE.equals(attributeName); if (mapped) { htmlPage.removeMappedElement(this, false, false); } super.removeAttribute(attributeName); - if (htmlPage != null) { - if (mapped) { - htmlPage.addMappedElement(this, false); - } - - final HtmlAttributeChangeEvent event = new HtmlAttributeChangeEvent(this, attributeName, value); - fireHtmlAttributeRemoved(event); - htmlPage.fireHtmlAttributeRemoved(event); + if (mapped) { + htmlPage.addMappedElement(this, false); } + + final HtmlAttributeChangeEvent event = new HtmlAttributeChangeEvent(this, attributeName, value); + fireHtmlAttributeRemoved(event); + htmlPage.fireHtmlAttributeRemoved(event); } /** @@ -605,10 +622,12 @@ private Page type(final char c, final boolean lastType) final HtmlForm form = getEnclosingForm(); if (form != null && c == '\n' && isSubmittableByEnter()) { - final HtmlSubmitInput submit = form.getFirstByXPath(".//input[@type='submit']"); - if (submit != null) { - return submit.click(); + for (final DomElement descendant : form.getDomElementDescendants()) { + if (descendant instanceof HtmlSubmitInput) { + return descendant.click(); + } } + form.submit((SubmittableElement) this); webClient.getJavaScriptEngine().processPostponedActions(); } @@ -660,7 +679,8 @@ public Page type(final Keyboard keyboard) throws IOException { } } - for (int i = 0; i < keys.size(); i++) { + final int size = keys.size(); + for (int i = 0; i < size; i++) { final Object[] entry = keys.get(i); if (entry.length == 1) { type((char) entry[0], i == keys.size() - 1); @@ -1214,6 +1234,13 @@ private String getXPathToken() { return getNodeName() + '[' + nodeIndex + ']'; } + /** + * @return the value of the 'hidden' attribute or an empty string if not set. + */ + public String getHidden() { + return getAttributeDirect(ATTRIBUTE_HIDDEN); + } + /** * @return true if the hidden attribute is set. */ @@ -1223,16 +1250,24 @@ public boolean isHidden() { /** * Sets the {@code hidden} property. + * If the provided string is empty, the 'hidden' attribute will be removed. + * If the provided string is 'until-found' then the attribute value will be 'until-found'. + * For all other provided strings the attribute will be set to ''. + * @see #setHidden(boolean) * @param hidden the {@code hidden} property */ public void setHidden(final String hidden) { - if ("false".equalsIgnoreCase(hidden)) { - removeAttribute(ATTRIBUTE_HIDDEN); + if ("until-found".equalsIgnoreCase(hidden)) { + setAttribute(ATTRIBUTE_HIDDEN, "until-found"); + return; } - if (StringUtils.isNotEmpty(hidden)) { - setAttribute(ATTRIBUTE_HIDDEN, ""); + if (org.htmlunit.util.StringUtils.isEmptyString(hidden)) { + removeAttribute(ATTRIBUTE_HIDDEN); + return; } + + setAttribute(ATTRIBUTE_HIDDEN, ""); } /** @@ -1241,11 +1276,11 @@ public void setHidden(final String hidden) { */ public void setHidden(final boolean hidden) { if (hidden) { - setAttribute("hidden", ""); + setAttribute(ATTRIBUTE_HIDDEN, ""); return; } - removeAttribute("hidden"); + removeAttribute(ATTRIBUTE_HIDDEN); } /** @@ -1275,7 +1310,7 @@ public DisplayStyle getDefaultStyleDisplay() { * Helper for src retrieval and normalization. * * @return the value of the attribute {@code src} with all line breaks removed - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ protected final String getSrcAttributeNormalized() { // at the moment StringUtils.replaceChars returns the org string @@ -1421,6 +1456,186 @@ public void setRequired(final boolean required) { } } + /** + * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
+ * + * @param returnNullIfFixed if position is 'fixed' return null + * @return the offset parent {@link HtmlElement} + */ + public HtmlElement getOffsetParentInternal(final boolean returnNullIfFixed) { + if (getParentNode() == null) { + return null; + } + + final WebWindow webWindow = getPage().getEnclosingWindow(); + final ComputedCssStyleDeclaration style = webWindow.getComputedStyle(this, null); + final String position = style.getPositionWithInheritance(); + + if (returnNullIfFixed && FIXED.equals(position)) { + return null; + } + + final boolean staticPos = STATIC.equals(position); + + DomNode currentElement = this; + while (currentElement != null) { + + final DomNode parentNode = currentElement.getParentNode(); + if (parentNode instanceof HtmlBody + || (staticPos && parentNode instanceof HtmlTableDataCell) + || (staticPos && parentNode instanceof HtmlTable)) { + return (HtmlElement) parentNode; + } + + if (parentNode instanceof HtmlElement) { + final ComputedCssStyleDeclaration parentStyle = + webWindow.getComputedStyle((HtmlElement) parentNode, null); + final String parentPosition = parentStyle.getPositionWithInheritance(); + if (!STATIC.equals(parentPosition)) { + return (HtmlElement) parentNode; + } + } + + currentElement = currentElement.getParentNode(); + } + + return null; + } + + /** + * @return this element's top offset, which is the calculated left position of this + * element relative to the offsetParent. + */ + public int getOffsetTop() { + if (this instanceof HtmlBody) { + return 0; + } + + int top = 0; + + // Add the offset for this node. + final WebWindow webWindow = getPage().getEnclosingWindow(); + ComputedCssStyleDeclaration style = webWindow.getComputedStyle(this, null); + top += style.getTop(true, false, false); + + // If this node is absolutely positioned, we're done. + final String position = style.getPositionWithInheritance(); + if (ABSOLUTE.equals(position) || FIXED.equals(position)) { + return top; + } + + final HtmlElement offsetParent = getOffsetParentInternal(false); + + // Add the offset for the ancestor nodes. + DomNode parentNode = getParentNode(); + while (parentNode != null && parentNode != offsetParent) { + if (parentNode instanceof HtmlElement) { + style = webWindow.getComputedStyle((HtmlElement) parentNode, null); + top += style.getTop(false, true, true); + } + parentNode = parentNode.getParentNode(); + } + + if (offsetParent != null) { + style = webWindow.getComputedStyle(this, null); + final boolean thisElementHasTopMargin = style.getMarginTopValue() != 0; + + style = webWindow.getComputedStyle(offsetParent, null); + if (!thisElementHasTopMargin) { + top += style.getMarginTopValue(); + } + top += style.getPaddingTopValue(); + } + + return top; + } + + /** + * @return this element's left offset, which is the calculated left position of this + * element relative to the offsetParent. + */ + public int getOffsetLeft() { + if (this instanceof HtmlBody) { + return 0; + } + + int left = 0; + + // Add the offset for this node. + final WebWindow webWindow = getPage().getEnclosingWindow(); + ComputedCssStyleDeclaration style = webWindow.getComputedStyle(this, null); + left += style.getLeft(true, false, false); + + // If this node is absolutely positioned, we're done. + final String position = style.getPositionWithInheritance(); + if (ABSOLUTE.equals(position) || FIXED.equals(position)) { + return left; + } + + final HtmlElement offsetParent = getOffsetParentInternal(false); + + DomNode parentNode = getParentNode(); + while (parentNode != null && parentNode != offsetParent) { + if (parentNode instanceof HtmlElement) { + style = webWindow.getComputedStyle((HtmlElement) parentNode, null); + left += style.getLeft(true, true, true); + } + parentNode = parentNode.getParentNode(); + } + + if (offsetParent != null) { + style = webWindow.getComputedStyle(offsetParent, null); + left += style.getMarginLeftValue(); + left += style.getPaddingLeftValue(); + } + + return left; + } + + /** + * Returns this element's X position. + * @return this element's X position + */ + public int getPosX() { + int cumulativeOffset = 0; + final WebWindow webWindow = getPage().getEnclosingWindow(); + + HtmlElement element = this; + while (element != null) { + cumulativeOffset += element.getOffsetLeft(); + if (element != this) { + final ComputedCssStyleDeclaration style = + webWindow.getComputedStyle(element, null); + cumulativeOffset += style.getBorderLeftValue(); + } + element = element.getOffsetParentInternal(false); + } + + return cumulativeOffset; + } + + /** + * Returns this element's Y position. + * @return this element's Y position + */ + public int getPosY() { + int cumulativeOffset = 0; + final WebWindow webWindow = getPage().getEnclosingWindow(); + + HtmlElement element = this; + while (element != null) { + cumulativeOffset += element.getOffsetTop(); + if (element != this) { + final ComputedCssStyleDeclaration style = + webWindow.getComputedStyle(element, null); + cumulativeOffset += style.getBorderTopValue(); + } + element = element.getOffsetParentInternal(false); + } + + return cumulativeOffset; + } + /** * {@inheritDoc} */ diff --git a/src/main/java/org/htmlunit/html/HtmlEmailInput.java b/src/main/java/org/htmlunit/html/HtmlEmailInput.java index 8b923b7b920..fb391a50ad0 100644 --- a/src/main/java/org/htmlunit/html/HtmlEmailInput.java +++ b/src/main/java/org/htmlunit/html/HtmlEmailInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlEmbed.java b/src/main/java/org/htmlunit/html/HtmlEmbed.java index 8f169a736f6..266f942cd50 100644 --- a/src/main/java/org/htmlunit/html/HtmlEmbed.java +++ b/src/main/java/org/htmlunit/html/HtmlEmbed.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlEmphasis.java b/src/main/java/org/htmlunit/html/HtmlEmphasis.java index a3d3f495daa..a0ebfd2175b 100644 --- a/src/main/java/org/htmlunit/html/HtmlEmphasis.java +++ b/src/main/java/org/htmlunit/html/HtmlEmphasis.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlExample.java b/src/main/java/org/htmlunit/html/HtmlExample.java index 553a3edf2dd..40207710fed 100644 --- a/src/main/java/org/htmlunit/html/HtmlExample.java +++ b/src/main/java/org/htmlunit/html/HtmlExample.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlFieldSet.java b/src/main/java/org/htmlunit/html/HtmlFieldSet.java index 25fb285fd16..bfe0cc3fdee 100644 --- a/src/main/java/org/htmlunit/html/HtmlFieldSet.java +++ b/src/main/java/org/htmlunit/html/HtmlFieldSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlFigure.java b/src/main/java/org/htmlunit/html/HtmlFigure.java index a45ee383e79..e2aa3446d08 100644 --- a/src/main/java/org/htmlunit/html/HtmlFigure.java +++ b/src/main/java/org/htmlunit/html/HtmlFigure.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlFigureCaption.java b/src/main/java/org/htmlunit/html/HtmlFigureCaption.java index 9577c7868a7..8e0485fb7bc 100644 --- a/src/main/java/org/htmlunit/html/HtmlFigureCaption.java +++ b/src/main/java/org/htmlunit/html/HtmlFigureCaption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlFileInput.java b/src/main/java/org/htmlunit/html/HtmlFileInput.java index cb53def554a..5f95299fd61 100644 --- a/src/main/java/org/htmlunit/html/HtmlFileInput.java +++ b/src/main/java/org/htmlunit/html/HtmlFileInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -137,7 +137,7 @@ public void setContentType(final String contentType) { /** * Gets the content type that should be sent together with the uploaded file. * @return the content type, or {@code null} if this has not been explicitly set - * and should be guessed from file content + * and should be guessed from file content */ public String getContentType() { return contentType_; diff --git a/src/main/java/org/htmlunit/html/HtmlFont.java b/src/main/java/org/htmlunit/html/HtmlFont.java index 4b2852afcda..cd9df518051 100644 --- a/src/main/java/org/htmlunit/html/HtmlFont.java +++ b/src/main/java/org/htmlunit/html/HtmlFont.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlFooter.java b/src/main/java/org/htmlunit/html/HtmlFooter.java index dc9382b9469..f9236d3b898 100644 --- a/src/main/java/org/htmlunit/html/HtmlFooter.java +++ b/src/main/java/org/htmlunit/html/HtmlFooter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlForm.java b/src/main/java/org/htmlunit/html/HtmlForm.java index 9ad6cafa176..dd7797388f3 100644 --- a/src/main/java/org/htmlunit/html/HtmlForm.java +++ b/src/main/java/org/htmlunit/html/HtmlForm.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -191,7 +191,7 @@ && getAttributeDirect(ATTRIBUTE_NOVALIDATE) != ATTRIBUTE_NOT_DEFINED) { final WebWindow webWindow = htmlPage.getEnclosingWindow(); // Calling form.submit() twice forces double download. - webClient.download(webWindow, target, request, false, false, null, "JS form.submit()"); + webClient.download(webWindow, target, request, false, null, "JS form.submit()"); } /** @@ -541,36 +541,18 @@ private List getFormElementsByAttribute( final String attributeName, final String attributeValue) { - final List list = new ArrayList<>(); - final String lowerCaseTagName = elementName.toLowerCase(Locale.ROOT); - - for (final HtmlElement element : getElements()) { - if (element.getTagName().equals(lowerCaseTagName)) { - final String attValue = element.getAttribute(attributeName); - if (attValue.equals(attributeValue)) { - list.add((E) element); - } - } - } - return list; - } - - /** - * @return returns a list of all form controls contained in the <form> element or referenced by formId - * but ignoring elements that are contained in a nested form - * @deprecated as of version 4.4.0; use {@link #getFormElements()}, {@link #getElementsJS()} instead - */ - @Deprecated - public List getElements() { - return getElements(htmlElement -> SUBMITTABLE_TAG_NAMES.contains(htmlElement.getTagName())); + return (List) getElements(htmlElement -> + htmlElement.getTagName().equals(elementName) + && htmlElement.getAttribute(attributeName).equals(attributeValue)); } /** * @return A List containing all form controls in the form. - * The form controls in the returned collection are in the same order - * in which they appear in the form by following a preorder, - * depth-first traversal of the tree. This is called tree order. Only the following elements are returned: - * button, fieldset, input, object, output, select, textarea. + * The form controls in the returned collection are in the same order + * in which they appear in the form by following a preorder, + * depth-first traversal of the tree. This is called tree order. + * Only the following elements are returned: + * button, fieldset, input, object, output, select, textarea. */ public List getFormElements() { return getElements(htmlElement -> { @@ -590,12 +572,13 @@ public List getFormElements() { * see https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/elements * * @return A List containing all non-image controls in the form. - * The form controls in the returned collection are in the same order - * in which they appear in the form by following a preorder, - * depth-first traversal of the tree. This is called tree order. Only the following elements are returned: - * button, fieldset, - * input (with the exception that any whose type is "image" are omitted for historical reasons), - * object, output, select, textarea. + * The form controls in the returned collection are in the same order + * in which they appear in the form by following a preorder, + * depth-first traversal of the tree. This is called tree order. + * Only the following elements are returned: + * button, fieldset, + * input (with the exception that any whose type is "image" are omitted for historical reasons), + * object, output, select, textarea. */ public List getElementsJS() { return getElements(htmlElement -> { diff --git a/src/main/java/org/htmlunit/html/HtmlFrame.java b/src/main/java/org/htmlunit/html/HtmlFrame.java index a5701f5f7e0..1759bc89df9 100644 --- a/src/main/java/org/htmlunit/html/HtmlFrame.java +++ b/src/main/java/org/htmlunit/html/HtmlFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlFrameSet.java b/src/main/java/org/htmlunit/html/HtmlFrameSet.java index dc6cc5c868a..72373a95208 100644 --- a/src/main/java/org/htmlunit/html/HtmlFrameSet.java +++ b/src/main/java/org/htmlunit/html/HtmlFrameSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlHead.java b/src/main/java/org/htmlunit/html/HtmlHead.java index 5f47a1d0d8a..1644ec3a378 100644 --- a/src/main/java/org/htmlunit/html/HtmlHead.java +++ b/src/main/java/org/htmlunit/html/HtmlHead.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlHeader.java b/src/main/java/org/htmlunit/html/HtmlHeader.java index f172f2dd246..f28bddfa71d 100644 --- a/src/main/java/org/htmlunit/html/HtmlHeader.java +++ b/src/main/java/org/htmlunit/html/HtmlHeader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlHeading1.java b/src/main/java/org/htmlunit/html/HtmlHeading1.java index 15ca56c501c..e5eeefb519a 100644 --- a/src/main/java/org/htmlunit/html/HtmlHeading1.java +++ b/src/main/java/org/htmlunit/html/HtmlHeading1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlHeading2.java b/src/main/java/org/htmlunit/html/HtmlHeading2.java index 657bf0c6f2f..e3524b607f6 100644 --- a/src/main/java/org/htmlunit/html/HtmlHeading2.java +++ b/src/main/java/org/htmlunit/html/HtmlHeading2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlHeading3.java b/src/main/java/org/htmlunit/html/HtmlHeading3.java index 20d41808dbf..fdcf4f0ab16 100644 --- a/src/main/java/org/htmlunit/html/HtmlHeading3.java +++ b/src/main/java/org/htmlunit/html/HtmlHeading3.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlHeading4.java b/src/main/java/org/htmlunit/html/HtmlHeading4.java index e28c9f7ad38..9755347b3fb 100644 --- a/src/main/java/org/htmlunit/html/HtmlHeading4.java +++ b/src/main/java/org/htmlunit/html/HtmlHeading4.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlHeading5.java b/src/main/java/org/htmlunit/html/HtmlHeading5.java index bb931137d00..14d26988ca8 100644 --- a/src/main/java/org/htmlunit/html/HtmlHeading5.java +++ b/src/main/java/org/htmlunit/html/HtmlHeading5.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlHeading6.java b/src/main/java/org/htmlunit/html/HtmlHeading6.java index fe87a181fc8..bf585172957 100644 --- a/src/main/java/org/htmlunit/html/HtmlHeading6.java +++ b/src/main/java/org/htmlunit/html/HtmlHeading6.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlHiddenInput.java b/src/main/java/org/htmlunit/html/HtmlHiddenInput.java index 823545fea96..ed3cc0e36c7 100644 --- a/src/main/java/org/htmlunit/html/HtmlHiddenInput.java +++ b/src/main/java/org/htmlunit/html/HtmlHiddenInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlHorizontalRule.java b/src/main/java/org/htmlunit/html/HtmlHorizontalRule.java index 53955050627..2495a7cd555 100644 --- a/src/main/java/org/htmlunit/html/HtmlHorizontalRule.java +++ b/src/main/java/org/htmlunit/html/HtmlHorizontalRule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlHtml.java b/src/main/java/org/htmlunit/html/HtmlHtml.java index f07f67f6b0a..56a9f6cb416 100644 --- a/src/main/java/org/htmlunit/html/HtmlHtml.java +++ b/src/main/java/org/htmlunit/html/HtmlHtml.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlImage.java b/src/main/java/org/htmlunit/html/HtmlImage.java index d7443adedb9..ec90e4aa4f4 100644 --- a/src/main/java/org/htmlunit/html/HtmlImage.java +++ b/src/main/java/org/htmlunit/html/HtmlImage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,12 +41,12 @@ import org.htmlunit.WebClient; import org.htmlunit.WebRequest; import org.htmlunit.WebResponse; +import org.htmlunit.http.HttpStatus; import org.htmlunit.javascript.AbstractJavaScriptEngine; import org.htmlunit.javascript.PostponedAction; import org.htmlunit.javascript.host.dom.Document; import org.htmlunit.javascript.host.event.Event; import org.htmlunit.javascript.host.event.MouseEvent; -import org.htmlunit.javascript.host.html.HTMLElement; import org.htmlunit.platform.Platform; import org.htmlunit.platform.geom.IntDimension2D; import org.htmlunit.platform.image.ImageData; @@ -278,7 +278,9 @@ public void doOnLoad() { downloadImageIfNeeded(); // if the download was a success if (imageWebResponse_.isSuccess()) { - loadSuccessful = true; // Trigger the onload handler + if (imageWebResponse_.getStatusCode() != HttpStatus.NO_CONTENT_204) { + loadSuccessful = true; // Trigger the onload handler + } } } catch (final IOException e) { @@ -873,12 +875,11 @@ public String getLocalName() { public ScriptResult fireEvent(final Event event) { if (event instanceof MouseEvent) { final MouseEvent mouseEvent = (MouseEvent) event; - final HTMLElement scriptableObject = getScriptableObject(); if (lastClickX_ >= 0) { - mouseEvent.setClientX(scriptableObject.getPosX() + lastClickX_); + mouseEvent.setClientX(getPosX() + lastClickX_); } if (lastClickY_ >= 0) { - mouseEvent.setClientY(scriptableObject.getPosX() + lastClickY_); + mouseEvent.setClientY(getPosX() + lastClickY_); } } diff --git a/src/main/java/org/htmlunit/html/HtmlImageInput.java b/src/main/java/org/htmlunit/html/HtmlImageInput.java index e834e04fe1c..e9c7b0f9139 100644 --- a/src/main/java/org/htmlunit/html/HtmlImageInput.java +++ b/src/main/java/org/htmlunit/html/HtmlImageInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,6 @@ */ package org.htmlunit.html; -import static org.htmlunit.BrowserVersionFeatures.HTMLIMAGE_NAME_VALUE_PARAMS; - import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -87,10 +85,6 @@ public NameValuePair[] getSubmitNameValuePairs() { if (wasPositionSpecified_) { final NameValuePair valueX = new NameValuePair(prefix + 'x', Integer.toString(xPosition_)); final NameValuePair valueY = new NameValuePair(prefix + 'y', Integer.toString(yPosition_)); - if (!prefix.isEmpty() && hasFeature(HTMLIMAGE_NAME_VALUE_PARAMS) && !getRawValue().isEmpty()) { - return new NameValuePair[] {valueX, valueY, - new NameValuePair(getNameAttribute(), getRawValue()) }; - } return new NameValuePair[] {valueX, valueY}; } return new NameValuePair[]{new NameValuePair(getNameAttribute(), getRawValue())}; diff --git a/src/main/java/org/htmlunit/html/HtmlInlineFrame.java b/src/main/java/org/htmlunit/html/HtmlInlineFrame.java index f51fd949fe1..d700d07815f 100644 --- a/src/main/java/org/htmlunit/html/HtmlInlineFrame.java +++ b/src/main/java/org/htmlunit/html/HtmlInlineFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlInlineQuotation.java b/src/main/java/org/htmlunit/html/HtmlInlineQuotation.java index a36ccc92715..3197d7a7df9 100644 --- a/src/main/java/org/htmlunit/html/HtmlInlineQuotation.java +++ b/src/main/java/org/htmlunit/html/HtmlInlineQuotation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,7 @@ public class HtmlInlineQuotation extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code cite} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCiteAttribute() { return getAttributeDirect("cite"); diff --git a/src/main/java/org/htmlunit/html/HtmlInput.java b/src/main/java/org/htmlunit/html/HtmlInput.java index eb992273e2f..5cabcfdb7fc 100644 --- a/src/main/java/org/htmlunit/html/HtmlInput.java +++ b/src/main/java/org/htmlunit/html/HtmlInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,6 @@ import java.util.HashSet; import java.util.Locale; import java.util.Map; -import java.util.regex.Pattern; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; @@ -36,11 +35,13 @@ import org.htmlunit.ScriptResult; import org.htmlunit.SgmlPage; import org.htmlunit.WebClient; +import org.htmlunit.corejs.javascript.Context; +import org.htmlunit.corejs.javascript.regexp.RegExpEngineAccess; import org.htmlunit.javascript.AbstractJavaScriptEngine; +import org.htmlunit.javascript.HtmlUnitContextFactory; import org.htmlunit.javascript.host.event.Event; import org.htmlunit.javascript.host.event.MouseEvent; import org.htmlunit.javascript.host.html.HTMLInputElement; -import org.htmlunit.javascript.regexp.RegExpJsToJavaConverter; import org.htmlunit.util.NameValuePair; import org.xml.sax.helpers.AttributesImpl; @@ -222,7 +223,7 @@ public final boolean isDisabled() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code readonly} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getReadOnlyAttribute() { return getAttributeDirect("readonly"); @@ -234,7 +235,7 @@ public final String getReadOnlyAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code size} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getSizeAttribute() { return getAttributeDirect("size"); @@ -246,7 +247,7 @@ public final String getSizeAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code maxlength} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getMaxLengthAttribute() { return getAttribute("maxLength"); @@ -276,7 +277,7 @@ protected int getMaxLength() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code minlength} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getMinLengthAttribute() { return getAttribute("minLength"); @@ -306,7 +307,7 @@ protected int getMinLength() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code src} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public String getSrcAttribute() { return getSrcAttributeNormalized(); @@ -352,7 +353,7 @@ public void setSrcAttribute(final String src) { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code alt} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAltAttribute() { return getAttributeDirect("alt"); @@ -364,7 +365,7 @@ public final String getAltAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code usemap} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getUseMapAttribute() { return getAttributeDirect("usemap"); @@ -376,7 +377,7 @@ public final String getUseMapAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code tabindex} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getTabIndexAttribute() { return getAttributeDirect("tabindex"); @@ -388,7 +389,7 @@ public final String getTabIndexAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code accesskey} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAccessKeyAttribute() { return getAttributeDirect("accesskey"); @@ -400,7 +401,7 @@ public final String getAccessKeyAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code onfocus} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getOnFocusAttribute() { return getAttributeDirect("onfocus"); @@ -412,7 +413,7 @@ public final String getOnFocusAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code onblur} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getOnBlurAttribute() { return getAttributeDirect("onblur"); @@ -424,7 +425,7 @@ public final String getOnBlurAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code onselect} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getOnSelectAttribute() { return getAttributeDirect("onselect"); @@ -436,7 +437,7 @@ public final String getOnSelectAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code onchange} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getOnChangeAttribute() { return getAttributeDirect("onchange"); @@ -448,7 +449,7 @@ public final String getOnChangeAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code accept} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAcceptAttribute() { return getAttribute(HttpHeader.ACCEPT_LC); @@ -460,7 +461,7 @@ public final String getAcceptAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code align} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAlignAttribute() { return getAttributeDirect("align"); @@ -1011,10 +1012,12 @@ private boolean isPatternValid() { return true; } - final RegExpJsToJavaConverter converter = new RegExpJsToJavaConverter(); - final String javaPattern = converter.convert(pattern); - try { - return Pattern.matches(javaPattern, value); + try (Context cx = HtmlUnitContextFactory.getGlobal().enterContext()) { + RegExpEngineAccess.compile(cx, pattern, ""); + final RegExpEngineAccess.CompiledRegExp compiled + = RegExpEngineAccess.compile(cx, "^(?:" + pattern + ")$", ""); + + return RegExpEngineAccess.matches(cx, value, compiled); } catch (final Exception ignored) { // ignore if regex invalid diff --git a/src/main/java/org/htmlunit/html/HtmlInsertedText.java b/src/main/java/org/htmlunit/html/HtmlInsertedText.java index 6b92860479f..3f65a4d2e3e 100644 --- a/src/main/java/org/htmlunit/html/HtmlInsertedText.java +++ b/src/main/java/org/htmlunit/html/HtmlInsertedText.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,7 @@ public class HtmlInsertedText extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code cite} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCiteAttribute() { return getAttributeDirect("cite"); @@ -63,7 +63,7 @@ public final String getCiteAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code datetime} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getDateTimeAttribute() { return getAttributeDirect("datetime"); diff --git a/src/main/java/org/htmlunit/html/HtmlItalic.java b/src/main/java/org/htmlunit/html/HtmlItalic.java index e1be355e17f..f26eda91658 100644 --- a/src/main/java/org/htmlunit/html/HtmlItalic.java +++ b/src/main/java/org/htmlunit/html/HtmlItalic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlKeyboard.java b/src/main/java/org/htmlunit/html/HtmlKeyboard.java index 9d5cd89d9fc..f8cc10c8fa7 100644 --- a/src/main/java/org/htmlunit/html/HtmlKeyboard.java +++ b/src/main/java/org/htmlunit/html/HtmlKeyboard.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlLabel.java b/src/main/java/org/htmlunit/html/HtmlLabel.java index 407ab8c38d7..7ab63990ef7 100644 --- a/src/main/java/org/htmlunit/html/HtmlLabel.java +++ b/src/main/java/org/htmlunit/html/HtmlLabel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,7 +56,7 @@ public class HtmlLabel extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code for} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getForAttribute() { return getAttributeDirect("for"); @@ -68,7 +68,7 @@ public final String getForAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code accesskey} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAccessKeyAttribute() { return getAttributeDirect("accesskey"); @@ -80,7 +80,7 @@ public final String getAccessKeyAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code onfocus} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getOnFocusAttribute() { return getAttributeDirect("onfocus"); @@ -92,7 +92,7 @@ public final String getOnFocusAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code onblur} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getOnBlurAttribute() { return getAttributeDirect("onblur"); diff --git a/src/main/java/org/htmlunit/html/HtmlLayer.java b/src/main/java/org/htmlunit/html/HtmlLayer.java index 41686da7229..4dc10388c39 100644 --- a/src/main/java/org/htmlunit/html/HtmlLayer.java +++ b/src/main/java/org/htmlunit/html/HtmlLayer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlLegend.java b/src/main/java/org/htmlunit/html/HtmlLegend.java index ba70d7340d1..4eaa2c826ff 100644 --- a/src/main/java/org/htmlunit/html/HtmlLegend.java +++ b/src/main/java/org/htmlunit/html/HtmlLegend.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,7 @@ public class HtmlLegend extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code accesskey} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAccessKeyAttribute() { return getAttributeDirect("accesskey"); @@ -63,7 +63,7 @@ public final String getAccessKeyAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code align} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAlignAttribute() { return getAttributeDirect("align"); diff --git a/src/main/java/org/htmlunit/html/HtmlLink.java b/src/main/java/org/htmlunit/html/HtmlLink.java index 745e1eea767..481afdc3e38 100644 --- a/src/main/java/org/htmlunit/html/HtmlLink.java +++ b/src/main/java/org/htmlunit/html/HtmlLink.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ */ package org.htmlunit.html; +import static org.htmlunit.BrowserVersionFeatures.HTMLLINK_CHECK_RESPONSE_TYPE_FOR_STYLESHEET; + import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; @@ -33,6 +35,7 @@ import org.htmlunit.javascript.host.event.Event; import org.htmlunit.javascript.host.html.HTMLLinkElement; import org.htmlunit.util.ArrayUtils; +import org.htmlunit.util.MimeType; import org.htmlunit.util.StringUtils; import org.htmlunit.xml.XmlPage; @@ -78,7 +81,7 @@ public class HtmlLink extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code charset} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharsetAttribute() { return getAttributeDirect("charset"); @@ -90,7 +93,7 @@ public final String getCharsetAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code href} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getHrefAttribute() { return getAttributeDirect("href"); @@ -102,7 +105,7 @@ public final String getHrefAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code hreflang} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getHrefLangAttribute() { return getAttributeDirect("hreflang"); @@ -114,7 +117,7 @@ public final String getHrefLangAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code type} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getTypeAttribute() { return getAttributeDirect(TYPE_ATTRIBUTE); @@ -126,7 +129,7 @@ public final String getTypeAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code rel} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getRelAttribute() { return getAttributeDirect("rel"); @@ -138,7 +141,7 @@ public final String getRelAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code rev} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getRevAttribute() { return getAttributeDirect("rev"); @@ -150,7 +153,7 @@ public final String getRevAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code media} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getMediaAttribute() { return getAttributeDirect("media"); @@ -162,7 +165,7 @@ public final String getMediaAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code target} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getTargetAttribute() { return getAttributeDirect("target"); @@ -175,11 +178,11 @@ public final String getTargetAttribute() { * * @param downloadIfNeeded indicates if a request should be performed this hasn't been done previously * @return {@code null} if no download should be performed and when this wasn't already done; the response - * received when performing a request for the content referenced by this tag otherwise + * received when performing a request for the content referenced by this tag otherwise * @throws IOException if an error occurs while downloading the content */ public WebResponse getWebResponse(final boolean downloadIfNeeded) throws IOException { - return getWebResponse(downloadIfNeeded, null); + return getWebResponse(downloadIfNeeded, null, false, null); } /** @@ -190,11 +193,14 @@ public WebResponse getWebResponse(final boolean downloadIfNeeded) throws IOExcep * * @param downloadIfNeeded indicates if a request should be performed this hasn't been done previously * @param request the request; if null getWebRequest() is called to create one + * @param isStylesheetRequest true if this should return a stylesheet + * @param type the type definined for the stylesheet link * @return {@code null} if no download should be performed and when this wasn't already done; the response - * received when performing a request for the content referenced by this tag otherwise + * received when performing a request for the content referenced by this tag otherwise * @throws IOException if an error occurs while downloading the content */ - public WebResponse getWebResponse(final boolean downloadIfNeeded, WebRequest request) throws IOException { + public WebResponse getWebResponse(final boolean downloadIfNeeded, WebRequest request, + final boolean isStylesheetRequest, final String type) throws IOException { final WebClient webclient = getPage().getWebClient(); if (null == request) { request = getWebRequest(); @@ -204,11 +210,26 @@ public WebResponse getWebResponse(final boolean downloadIfNeeded, WebRequest req try { final WebResponse response = webclient.loadWebResponse(request); if (response.isSuccess()) { + if (isStylesheetRequest + && webclient.getBrowserVersion() + .hasFeature(HTMLLINK_CHECK_RESPONSE_TYPE_FOR_STYLESHEET)) { + + if (org.apache.commons.lang3.StringUtils.isNotBlank(type) + && !MimeType.TEXT_CSS.equals(type)) { + return null; + } + + final String respType = response.getContentType(); + if (org.apache.commons.lang3.StringUtils.isNotBlank(respType) + && !MimeType.TEXT_CSS.equals(respType)) { + executeEvent(Event.TYPE_ERROR); + return response; + } + } executeEvent(Event.TYPE_LOAD); + return response; } - else { - executeEvent(Event.TYPE_ERROR); - } + executeEvent(Event.TYPE_ERROR); return response; } catch (final IOException e) { diff --git a/src/main/java/org/htmlunit/html/HtmlListItem.java b/src/main/java/org/htmlunit/html/HtmlListItem.java index bb643fff7e1..05ce4b5f967 100644 --- a/src/main/java/org/htmlunit/html/HtmlListItem.java +++ b/src/main/java/org/htmlunit/html/HtmlListItem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ public class HtmlListItem extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code type} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getTypeAttribute() { return getAttributeDirect(TYPE_ATTRIBUTE); @@ -62,7 +62,7 @@ public final String getTypeAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code value} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getValueAttribute() { return getAttributeDirect(VALUE_ATTRIBUTE); diff --git a/src/main/java/org/htmlunit/html/HtmlListing.java b/src/main/java/org/htmlunit/html/HtmlListing.java index 309d376ac2a..e8f6e4b093f 100644 --- a/src/main/java/org/htmlunit/html/HtmlListing.java +++ b/src/main/java/org/htmlunit/html/HtmlListing.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlMain.java b/src/main/java/org/htmlunit/html/HtmlMain.java index de756f3ddca..3e9c53cf715 100644 --- a/src/main/java/org/htmlunit/html/HtmlMain.java +++ b/src/main/java/org/htmlunit/html/HtmlMain.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlMap.java b/src/main/java/org/htmlunit/html/HtmlMap.java index 2ea525afe4f..bb248b3b4ef 100644 --- a/src/main/java/org/htmlunit/html/HtmlMap.java +++ b/src/main/java/org/htmlunit/html/HtmlMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,7 +52,7 @@ public class HtmlMap extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code name} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getNameAttribute() { return getAttributeDirect(NAME_ATTRIBUTE); diff --git a/src/main/java/org/htmlunit/html/HtmlMark.java b/src/main/java/org/htmlunit/html/HtmlMark.java index 4d76d35840b..6a4d86c25e9 100644 --- a/src/main/java/org/htmlunit/html/HtmlMark.java +++ b/src/main/java/org/htmlunit/html/HtmlMark.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlMarquee.java b/src/main/java/org/htmlunit/html/HtmlMarquee.java index 0ec18376bed..8a4204f0043 100644 --- a/src/main/java/org/htmlunit/html/HtmlMarquee.java +++ b/src/main/java/org/htmlunit/html/HtmlMarquee.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlMedia.java b/src/main/java/org/htmlunit/html/HtmlMedia.java index 030e83ece17..3adf013ca07 100644 --- a/src/main/java/org/htmlunit/html/HtmlMedia.java +++ b/src/main/java/org/htmlunit/html/HtmlMedia.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlMenu.java b/src/main/java/org/htmlunit/html/HtmlMenu.java index 1775ddfb677..4a920511bb6 100644 --- a/src/main/java/org/htmlunit/html/HtmlMenu.java +++ b/src/main/java/org/htmlunit/html/HtmlMenu.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ public class HtmlMenu extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code compact} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCompactAttribute() { return getAttributeDirect("compact"); diff --git a/src/main/java/org/htmlunit/html/HtmlMeta.java b/src/main/java/org/htmlunit/html/HtmlMeta.java index b03c7401dfb..cb73a6ce15b 100644 --- a/src/main/java/org/htmlunit/html/HtmlMeta.java +++ b/src/main/java/org/htmlunit/html/HtmlMeta.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,7 +68,7 @@ public boolean mayBeDisplayed() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code http-equiv} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getHttpEquivAttribute() { return getAttribute("http-equiv"); @@ -80,7 +80,7 @@ public final String getHttpEquivAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code name} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getNameAttribute() { return getAttributeDirect(NAME_ATTRIBUTE); @@ -92,7 +92,7 @@ public final String getNameAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code content} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getContentAttribute() { return getAttributeDirect("content"); @@ -104,7 +104,7 @@ public final String getContentAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code scheme} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getSchemeAttribute() { return getAttributeDirect("scheme"); diff --git a/src/main/java/org/htmlunit/html/HtmlMeter.java b/src/main/java/org/htmlunit/html/HtmlMeter.java index 6cbd436cd2c..7976e61b480 100644 --- a/src/main/java/org/htmlunit/html/HtmlMeter.java +++ b/src/main/java/org/htmlunit/html/HtmlMeter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlMonthInput.java b/src/main/java/org/htmlunit/html/HtmlMonthInput.java index 5959a2c914e..ba5c9c11809 100644 --- a/src/main/java/org/htmlunit/html/HtmlMonthInput.java +++ b/src/main/java/org/htmlunit/html/HtmlMonthInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlNav.java b/src/main/java/org/htmlunit/html/HtmlNav.java index fb9800bc90f..063ec78ab88 100644 --- a/src/main/java/org/htmlunit/html/HtmlNav.java +++ b/src/main/java/org/htmlunit/html/HtmlNav.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlNoBreak.java b/src/main/java/org/htmlunit/html/HtmlNoBreak.java index cef7209e71c..041de331a48 100644 --- a/src/main/java/org/htmlunit/html/HtmlNoBreak.java +++ b/src/main/java/org/htmlunit/html/HtmlNoBreak.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlNoEmbed.java b/src/main/java/org/htmlunit/html/HtmlNoEmbed.java index 829e30a4b22..180ae26c769 100644 --- a/src/main/java/org/htmlunit/html/HtmlNoEmbed.java +++ b/src/main/java/org/htmlunit/html/HtmlNoEmbed.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlNoFrames.java b/src/main/java/org/htmlunit/html/HtmlNoFrames.java index 29107d7d51e..928fe6b59f2 100644 --- a/src/main/java/org/htmlunit/html/HtmlNoFrames.java +++ b/src/main/java/org/htmlunit/html/HtmlNoFrames.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlNoLayer.java b/src/main/java/org/htmlunit/html/HtmlNoLayer.java index 6fde254a22c..a59c4223b2f 100644 --- a/src/main/java/org/htmlunit/html/HtmlNoLayer.java +++ b/src/main/java/org/htmlunit/html/HtmlNoLayer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlNoScript.java b/src/main/java/org/htmlunit/html/HtmlNoScript.java index 84e44880254..87cc03590e7 100644 --- a/src/main/java/org/htmlunit/html/HtmlNoScript.java +++ b/src/main/java/org/htmlunit/html/HtmlNoScript.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlNumberInput.java b/src/main/java/org/htmlunit/html/HtmlNumberInput.java index 40a65c08724..4292478ac0d 100644 --- a/src/main/java/org/htmlunit/html/HtmlNumberInput.java +++ b/src/main/java/org/htmlunit/html/HtmlNumberInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlObject.java b/src/main/java/org/htmlunit/html/HtmlObject.java index db6654b4786..e1464ff9003 100644 --- a/src/main/java/org/htmlunit/html/HtmlObject.java +++ b/src/main/java/org/htmlunit/html/HtmlObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,6 @@ */ package org.htmlunit.html; -import static org.htmlunit.BrowserVersionFeatures.JS_HTML_OBJECT_VALIDITYSTATE_ISVALID_IGNORES_CUSTOM_ERROR; - import java.util.Map; import org.apache.commons.lang3.StringUtils; @@ -62,7 +60,7 @@ public class HtmlObject extends HtmlElement implements ValidatableElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code declare} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getDeclareAttribute() { return getAttributeDirect("declare"); @@ -74,7 +72,7 @@ public final String getDeclareAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code classid} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getClassIdAttribute() { return getAttributeDirect("classid"); @@ -86,7 +84,7 @@ public final String getClassIdAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute "codebase" - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCodebaseAttribute() { return getAttributeDirect("codebase"); @@ -98,7 +96,7 @@ public final String getCodebaseAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code data} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getDataAttribute() { return getAttributeDirect("data"); @@ -110,7 +108,7 @@ public final String getDataAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code type} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getTypeAttribute() { return getAttributeDirect(TYPE_ATTRIBUTE); @@ -122,7 +120,7 @@ public final String getTypeAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute "codetype" - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCodeTypeAttribute() { return getAttributeDirect("codetype"); @@ -134,7 +132,7 @@ public final String getCodeTypeAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code archive} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getArchiveAttribute() { return getAttributeDirect("archive"); @@ -146,7 +144,7 @@ public final String getArchiveAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code standby} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getStandbyAttribute() { return getAttributeDirect("standby"); @@ -158,7 +156,7 @@ public final String getStandbyAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code height} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getHeightAttribute() { return getAttributeDirect("height"); @@ -170,7 +168,7 @@ public final String getHeightAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code width} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getWidthAttribute() { return getAttributeDirect("width"); @@ -182,7 +180,7 @@ public final String getWidthAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code usemap} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getUseMapAttribute() { return getAttributeDirect("usemap"); @@ -194,7 +192,7 @@ public final String getUseMapAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code name} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getNameAttribute() { return getAttributeDirect(NAME_ATTRIBUTE); @@ -206,7 +204,7 @@ public final String getNameAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code tabindex} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getTabIndexAttribute() { return getAttributeDirect("tabindex"); @@ -218,7 +216,7 @@ public final String getTabIndexAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code align} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAlignAttribute() { return getAttributeDirect("align"); @@ -230,7 +228,7 @@ public final String getAlignAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code border} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getBorderAttribute() { return getAttributeDirect("border"); @@ -242,7 +240,7 @@ public final String getBorderAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code hspace} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getHspaceAttribute() { return getAttributeDirect("hspace"); @@ -254,7 +252,7 @@ public final String getHspaceAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code vspace} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getVspaceAttribute() { return getAttributeDirect("vspace"); @@ -314,10 +312,6 @@ public void setCustomValidity(final String message) { @Override public boolean isCustomErrorValidityState() { - if (hasFeature(JS_HTML_OBJECT_VALIDITYSTATE_ISVALID_IGNORES_CUSTOM_ERROR)) { - return false; - } - return !StringUtils.isEmpty(customValidity_); } diff --git a/src/main/java/org/htmlunit/html/HtmlOption.java b/src/main/java/org/htmlunit/html/HtmlOption.java index ac406c0838f..c0dda178ab6 100644 --- a/src/main/java/org/htmlunit/html/HtmlOption.java +++ b/src/main/java/org/htmlunit/html/HtmlOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -151,7 +151,7 @@ public void reset() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code selected} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getSelectedAttribute() { return getAttributeDirect("selected"); @@ -224,7 +224,7 @@ public final void setLabelAttribute(final String newLabel) { * HTML 4.01 * documentation for details on the use of this attribute. * @see - * initial value if value attribute is not set + * initial value if value attribute is not set * @return the value of the attribute {@code value} */ public final String getValueAttribute() { diff --git a/src/main/java/org/htmlunit/html/HtmlOptionGroup.java b/src/main/java/org/htmlunit/html/HtmlOptionGroup.java index 8a7a9e841f4..a37dd3ba01c 100644 --- a/src/main/java/org/htmlunit/html/HtmlOptionGroup.java +++ b/src/main/java/org/htmlunit/html/HtmlOptionGroup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlOrderedList.java b/src/main/java/org/htmlunit/html/HtmlOrderedList.java index 13525fc357f..25e20d1c087 100644 --- a/src/main/java/org/htmlunit/html/HtmlOrderedList.java +++ b/src/main/java/org/htmlunit/html/HtmlOrderedList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ public class HtmlOrderedList extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code type} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getTypeAttribute() { return getAttributeDirect(TYPE_ATTRIBUTE); @@ -62,7 +62,7 @@ public final String getTypeAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code compact} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCompactAttribute() { return getAttributeDirect("compact"); @@ -74,7 +74,7 @@ public final String getCompactAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code start} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getStartAttribute() { return getAttributeDirect("start"); diff --git a/src/main/java/org/htmlunit/html/HtmlOutput.java b/src/main/java/org/htmlunit/html/HtmlOutput.java index 5b9e37e4f09..b2d12b10e70 100644 --- a/src/main/java/org/htmlunit/html/HtmlOutput.java +++ b/src/main/java/org/htmlunit/html/HtmlOutput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlPage.java b/src/main/java/org/htmlunit/html/HtmlPage.java index 0fad9a9cf1e..f1e3c78da81 100644 --- a/src/main/java/org/htmlunit/html/HtmlPage.java +++ b/src/main/java/org/htmlunit/html/HtmlPage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package org.htmlunit.html; import static org.htmlunit.BrowserVersionFeatures.EVENT_FOCUS_ON_LOAD; -import static org.htmlunit.BrowserVersionFeatures.JS_EVENT_LOAD_SUPPRESSED_BY_CONTENT_SECURIRY_POLICY; import static org.htmlunit.html.DomElement.ATTRIBUTE_NOT_DEFINED; import java.io.File; @@ -67,7 +66,6 @@ import org.htmlunit.corejs.javascript.Scriptable; import org.htmlunit.css.ComputedCssStyleDeclaration; import org.htmlunit.css.CssStyleSheet; -import org.htmlunit.html.FrameWindow.PageDenied; import org.htmlunit.html.impl.SimpleRange; import org.htmlunit.html.parser.HTMLParserDOMBuilder; import org.htmlunit.http.HttpStatus; @@ -141,6 +139,7 @@ * @author Lai Quang Duong * @author Sven Strickroth */ +@SuppressWarnings("PMD.TooManyFields") public class HtmlPage extends SgmlPage { private static final Log LOG = LogFactory.getLog(HtmlPage.class); @@ -232,8 +231,8 @@ public boolean hasCaseSensitiveTagNames() { * Initialize this page. * @throws IOException if an IO problem occurs * @throws FailingHttpStatusCodeException if the server returns a failing status code AND the property - * {@link org.htmlunit.WebClientOptions#setThrowExceptionOnFailingStatusCode(boolean)} is set - * to true. + * {@link org.htmlunit.WebClientOptions#setThrowExceptionOnFailingStatusCode(boolean)} is set + * to true. */ @Override public void initialize() throws IOException, FailingHttpStatusCodeException { @@ -295,7 +294,7 @@ public void initialize() throws IOException, FailingHttpStatusCodeException { executeEventHandlersIfNeeded(Event.TYPE_LOAD); } - for (final BaseFrameElement frameElement : frameElements_) { + for (final BaseFrameElement frameElement : new ArrayList<>(frameElements_)) { if (frameElement instanceof HtmlFrame) { final Page page = frameElement.getEnclosedWindow().getEnclosedPage(); if (page != null && page.isHtmlPage()) { @@ -785,8 +784,8 @@ public List getTabbableElementIds() { * Additionally, the value of tabindex must be within 0 and 32767. Any * values outside this range will be ignored.

* - * The following elements support the tabindex attribute: A, AREA, BUTTON, - * INPUT, OBJECT, SELECT, and TEXTAREA.

+ * The following elements support the tabindex attribute: + * A, AREA, BUTTON, INPUT, OBJECT, SELECT, and TEXTAREA. * * @return all the tabbable elements in proper tab order */ @@ -908,7 +907,7 @@ public List getHtmlElementsByAccessKey(final char accessKey) { * (see {@link org.htmlunit.WebClient#isJavaScriptEnabled()}.

* @param sourceCode the JavaScript code to execute * @return a ScriptResult which will contain both the current page (which may be different than - * the previous page) and a JavaScript result object + * the previous page) and a JavaScript result object */ public ScriptResult executeJavaScript(final String sourceCode) { return executeJavaScript(sourceCode, "injected script", 1); @@ -925,14 +924,14 @@ public ScriptResult executeJavaScript(final String sourceCode) { *

Please note: Although this method is public, it is not intended for * general execution of JavaScript. Users of HtmlUnit should interact with the pages * as a user would by clicking on buttons or links and having the JavaScript event - * handlers execute as needed.. + * handlers execute as needed. *

* * @param sourceCode the JavaScript code to execute * @param sourceName the name for this chunk of code (will be displayed in error messages) * @param startLine the line at which the script source starts * @return a ScriptResult which will contain both the current page (which may be different than - * the previous page and a JavaScript result object. + * the previous page and a JavaScript result object. */ public ScriptResult executeJavaScript(String sourceCode, final String sourceName, final int startLine) { if (!getWebClient().isJavaScriptEnabled()) { @@ -1288,12 +1287,6 @@ else if (Event.TYPE_READY_STATE_CHANGE.equals(eventType)) { event = new BeforeUnloadEvent(frame, eventType); } else { - // ff does not trigger the onload event in this case - if (PageDenied.BY_CONTENT_SECURIRY_POLICY == fw.getPageDenied() - && hasFeature(JS_EVENT_LOAD_SUPPRESSED_BY_CONTENT_SECURIRY_POLICY)) { - return true; - } - event = new Event(frame, eventType); } // This fires the "load" event for the element which, like all non-window @@ -1480,7 +1473,8 @@ private void executeDeferredScriptsIfNeeded() { * Deregister frames that are no longer in use. */ public void deregisterFramesIfNeeded() { - for (final BaseFrameElement frameElement : frameElements_) { + final List frameElementsCopy = new ArrayList<>(frameElements_); + for (final BaseFrameElement frameElement : frameElementsCopy) { final WebWindow window = frameElement.getEnclosedWindow(); getWebClient().deregisterWebWindow(window); final Page page = window.getEnclosedPage(); @@ -1531,7 +1525,7 @@ public FrameWindow getFrameByName(final String name) throws ElementNotFoundExcep * * @param accessKey the key that will be pressed * @return the element that has the focus after pressing this access key or null if no element - * has the focus. + * has the focus. * @throws IOException if an IO error occurs during the processing of this access key (this * would only happen if the access key triggered a button which in turn caused a page load) */ @@ -1896,7 +1890,7 @@ private void calculateBase() { * {@link WebClientOptions#setThrowExceptionOnFailingStatusCode(boolean)} is set to {@code true} */ void loadFrames() throws FailingHttpStatusCodeException { - for (final BaseFrameElement frameElement : frameElements_) { + for (final BaseFrameElement frameElement : new ArrayList<>(frameElements_)) { // test if the frame should really be loaded: // if a script has already changed its content, it should be skipped // use == and not equals(...) to identify initial content (versus URL set to "about:blank") @@ -2649,7 +2643,7 @@ public void putStyleIntoCache(final DomElement element, final String normalizedP * INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
* * @return a list of all styles from this page (<style> and <link rel=stylesheet>). - * This returns an empty list if css support is disabled in the web client options. + * This returns an empty list if css support is disabled in the web client options. */ public List getStyleSheets() { final List styles = new ArrayList<>(); @@ -2783,7 +2777,8 @@ private void nodeChanged(final DomNode changedNode, final String attribName) { } // Apparently it wasn't a stylesheet that changed; be semi-smart about what we evict and when. - final boolean clearParents = ATTRIBUTES_AFFECTING_PARENT.contains(attribName); + // null means that a node was added/removed; we always have to take care of this for the parents + final boolean clearParents = attribName == null || ATTRIBUTES_AFFECTING_PARENT.contains(attribName); if (computedStylesCache_ != null) { computedStylesCache_.nodeChanged(changedNode, clearParents); } @@ -2881,7 +2876,7 @@ private void readObject(final ObjectInputStream in) throws IOException, ClassNot } private static final class MappedElementIndexEntry implements Serializable { - private ArrayList elements_; + private final ArrayList elements_; private boolean sorted_; MappedElementIndexEntry() { @@ -2896,7 +2891,7 @@ void add(final DomElement element) { } DomElement first() { - if (elements_.size() == 0) { + if (elements_.isEmpty()) { return null; } @@ -2911,7 +2906,7 @@ DomElement first() { } List elements() { - if (sorted_ || elements_.size() == 0) { + if (sorted_ || elements_.isEmpty()) { return elements_; } @@ -2922,10 +2917,6 @@ List elements() { } boolean remove(final DomElement element) { - if (elements_.size() == 0) { - return false; - } - return elements_.remove(element); } } diff --git a/src/main/java/org/htmlunit/html/HtmlParagraph.java b/src/main/java/org/htmlunit/html/HtmlParagraph.java index f013ec46e68..c8e4cd21f4b 100644 --- a/src/main/java/org/htmlunit/html/HtmlParagraph.java +++ b/src/main/java/org/htmlunit/html/HtmlParagraph.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,7 @@ public class HtmlParagraph extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code align} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAlignAttribute() { return getAttributeDirect("align"); diff --git a/src/main/java/org/htmlunit/html/HtmlParameter.java b/src/main/java/org/htmlunit/html/HtmlParameter.java index ba4a07cd453..c44aedaa1c3 100644 --- a/src/main/java/org/htmlunit/html/HtmlParameter.java +++ b/src/main/java/org/htmlunit/html/HtmlParameter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ public class HtmlParameter extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code id} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getIdAttribute() { return getAttributeDirect(ID_ATTRIBUTE); @@ -62,7 +62,7 @@ public final String getIdAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code name} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getNameAttribute() { return getAttributeDirect(NAME_ATTRIBUTE); @@ -74,7 +74,7 @@ public final String getNameAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code value} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getValueAttribute() { return getAttributeDirect(VALUE_ATTRIBUTE); @@ -86,7 +86,7 @@ public final String getValueAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code valuetype} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getValueTypeAttribute() { return getAttributeDirect("valuetype"); @@ -98,7 +98,7 @@ public final String getValueTypeAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code type} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getTypeAttribute() { return getAttributeDirect(TYPE_ATTRIBUTE); diff --git a/src/main/java/org/htmlunit/html/HtmlPasswordInput.java b/src/main/java/org/htmlunit/html/HtmlPasswordInput.java index d395d8ed4db..4e07ac633b3 100644 --- a/src/main/java/org/htmlunit/html/HtmlPasswordInput.java +++ b/src/main/java/org/htmlunit/html/HtmlPasswordInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlPicture.java b/src/main/java/org/htmlunit/html/HtmlPicture.java index 8858222c183..46b0b81ad48 100644 --- a/src/main/java/org/htmlunit/html/HtmlPicture.java +++ b/src/main/java/org/htmlunit/html/HtmlPicture.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlPlainText.java b/src/main/java/org/htmlunit/html/HtmlPlainText.java index 52b7d84c5e8..00e53fe4b2d 100644 --- a/src/main/java/org/htmlunit/html/HtmlPlainText.java +++ b/src/main/java/org/htmlunit/html/HtmlPlainText.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlPreformattedText.java b/src/main/java/org/htmlunit/html/HtmlPreformattedText.java index 04727e5b3d0..265711cdbc2 100644 --- a/src/main/java/org/htmlunit/html/HtmlPreformattedText.java +++ b/src/main/java/org/htmlunit/html/HtmlPreformattedText.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ public class HtmlPreformattedText extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code width} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getWidthAttribute() { return getAttributeDirect("width"); diff --git a/src/main/java/org/htmlunit/html/HtmlProgress.java b/src/main/java/org/htmlunit/html/HtmlProgress.java index b88c8d7e0b3..3a8f288954a 100644 --- a/src/main/java/org/htmlunit/html/HtmlProgress.java +++ b/src/main/java/org/htmlunit/html/HtmlProgress.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlRadioButtonInput.java b/src/main/java/org/htmlunit/html/HtmlRadioButtonInput.java index 675f6d520af..d0eeb72b17d 100644 --- a/src/main/java/org/htmlunit/html/HtmlRadioButtonInput.java +++ b/src/main/java/org/htmlunit/html/HtmlRadioButtonInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -96,7 +96,7 @@ void setCheckedInternal(final boolean isChecked) { * * @param isChecked true if this element is to be selected * @return the page that occupies this window after setting checked status - * It may be the same window or it may be a freshly loaded one. + * It may be the same window or it may be a freshly loaded one. */ @Override public Page setChecked(final boolean isChecked) { diff --git a/src/main/java/org/htmlunit/html/HtmlRangeInput.java b/src/main/java/org/htmlunit/html/HtmlRangeInput.java index cf3ef870c39..015a41e9072 100644 --- a/src/main/java/org/htmlunit/html/HtmlRangeInput.java +++ b/src/main/java/org/htmlunit/html/HtmlRangeInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlRb.java b/src/main/java/org/htmlunit/html/HtmlRb.java index 0af0e72da41..beef3a1dc2d 100644 --- a/src/main/java/org/htmlunit/html/HtmlRb.java +++ b/src/main/java/org/htmlunit/html/HtmlRb.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlResetInput.java b/src/main/java/org/htmlunit/html/HtmlResetInput.java index 62efd60400f..d7623a39f0c 100644 --- a/src/main/java/org/htmlunit/html/HtmlResetInput.java +++ b/src/main/java/org/htmlunit/html/HtmlResetInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlRp.java b/src/main/java/org/htmlunit/html/HtmlRp.java index 84999fa3d67..1cca0de3803 100644 --- a/src/main/java/org/htmlunit/html/HtmlRp.java +++ b/src/main/java/org/htmlunit/html/HtmlRp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlRt.java b/src/main/java/org/htmlunit/html/HtmlRt.java index 0cca5bb1849..e0166bc3f97 100644 --- a/src/main/java/org/htmlunit/html/HtmlRt.java +++ b/src/main/java/org/htmlunit/html/HtmlRt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlRtc.java b/src/main/java/org/htmlunit/html/HtmlRtc.java index d6ea798cad7..d2db0cb48b7 100644 --- a/src/main/java/org/htmlunit/html/HtmlRtc.java +++ b/src/main/java/org/htmlunit/html/HtmlRtc.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlRuby.java b/src/main/java/org/htmlunit/html/HtmlRuby.java index fde8ec95a39..a04cf48ce6a 100644 --- a/src/main/java/org/htmlunit/html/HtmlRuby.java +++ b/src/main/java/org/htmlunit/html/HtmlRuby.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlS.java b/src/main/java/org/htmlunit/html/HtmlS.java index e10704f066f..cfab3e2963b 100644 --- a/src/main/java/org/htmlunit/html/HtmlS.java +++ b/src/main/java/org/htmlunit/html/HtmlS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlSample.java b/src/main/java/org/htmlunit/html/HtmlSample.java index c25bd0dc5e1..34b5df1747f 100644 --- a/src/main/java/org/htmlunit/html/HtmlSample.java +++ b/src/main/java/org/htmlunit/html/HtmlSample.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlScript.java b/src/main/java/org/htmlunit/html/HtmlScript.java index a96070ad3c8..3c9cdec7d1b 100644 --- a/src/main/java/org/htmlunit/html/HtmlScript.java +++ b/src/main/java/org/htmlunit/html/HtmlScript.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -72,7 +72,7 @@ public class HtmlScript extends HtmlElement implements ScriptElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code charset} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharsetAttribute() { return getAttributeDirect("charset"); @@ -92,7 +92,7 @@ public final String getScriptCharset() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code type} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getTypeAttribute() { return getAttributeDirect(TYPE_ATTRIBUTE); @@ -104,7 +104,7 @@ public final String getTypeAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code language} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getLanguageAttribute() { return getAttributeDirect("language"); @@ -116,7 +116,7 @@ public final String getLanguageAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code src} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getSrcAttribute() { return getSrcAttributeNormalized(); @@ -152,7 +152,7 @@ public final String getHtmlForAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code defer} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getDeferAttribute() { return getAttributeDirect("defer"); @@ -245,16 +245,16 @@ protected boolean isEmptyXmlTagExpanded() { * {@inheritDoc} */ @Override - protected void printChildrenAsXml(final String indent, final PrintWriter printWriter) { + protected boolean printChildrenAsXml(final String indent, final boolean tagBefore, final PrintWriter printWriter) { final DomCharacterData textNode = (DomCharacterData) getFirstChild(); if (textNode == null) { - return; + return tagBefore; } final String data = textNode.getData(); + printWriter.print("\r\n"); if (data.contains("//"); - printWriter.print("\r\n"); } + return true; } /** diff --git a/src/main/java/org/htmlunit/html/HtmlSearchInput.java b/src/main/java/org/htmlunit/html/HtmlSearchInput.java index fedb500378b..0d5d2bdc02a 100644 --- a/src/main/java/org/htmlunit/html/HtmlSearchInput.java +++ b/src/main/java/org/htmlunit/html/HtmlSearchInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlSection.java b/src/main/java/org/htmlunit/html/HtmlSection.java index 209bade2631..5f8b011b382 100644 --- a/src/main/java/org/htmlunit/html/HtmlSection.java +++ b/src/main/java/org/htmlunit/html/HtmlSection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlSelect.java b/src/main/java/org/htmlunit/html/HtmlSelect.java index 43106915cb4..5c3b99a774c 100644 --- a/src/main/java/org/htmlunit/html/HtmlSelect.java +++ b/src/main/java/org/htmlunit/html/HtmlSelect.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -201,7 +201,8 @@ public void setOptionSize(final int newLength) { */ public void removeOption(final int index) { final ChildElementsIterator iterator = new ChildElementsIterator(this); - for (int i = 0; iterator.hasNext();) { + int i = 0; + while (iterator.hasNext()) { final DomElement element = iterator.next(); if (element instanceof HtmlOption) { if (i == index) { @@ -221,7 +222,8 @@ public void removeOption(final int index) { */ public void replaceOption(final int index, final HtmlOption newOption) { final ChildElementsIterator iterator = new ChildElementsIterator(this); - for (int i = 0; iterator.hasNext();) { + int i = 0; + while (iterator.hasNext()) { final DomElement element = iterator.next(); if (element instanceof HtmlOption) { if (i == index) { @@ -273,7 +275,7 @@ public DomNode appendChild(final Node node) { * @param optionValue the value of the option that is to change * @param

the page type * @return the page contained in the current window as returned - * by {@link org.htmlunit.WebClient#getCurrentWindow()} + * by {@link org.htmlunit.WebClient#getCurrentWindow()} */ public

P setSelectedAttribute(final String optionValue, final boolean isSelected) { return setSelectedAttribute(optionValue, isSelected, true); @@ -292,7 +294,7 @@ public

P setSelectedAttribute(final String optionValue, final b * @param invokeOnFocus whether to set focus or not. * @param

the page type * @return the page contained in the current window as returned - * by {@link org.htmlunit.WebClient#getCurrentWindow()} + * by {@link org.htmlunit.WebClient#getCurrentWindow()} */ @SuppressWarnings("unchecked") public

P setSelectedAttribute(final String optionValue, @@ -319,7 +321,7 @@ public

P setSelectedAttribute(final String optionValue, * @param selectedOption the value of the option that is to change * @param

the page type * @return the page contained in the current window as returned - * by {@link org.htmlunit.WebClient#getCurrentWindow()} + * by {@link org.htmlunit.WebClient#getCurrentWindow()} */ public

P setSelectedAttribute(final HtmlOption selectedOption, final boolean isSelected) { return setSelectedAttribute(selectedOption, isSelected, true, true, false, true); @@ -341,7 +343,7 @@ public

P setSelectedAttribute(final HtmlOption selectedOption, * @param isClick is mouse clicked * @param

the page type * @return the page contained in the current window as returned - * by {@link org.htmlunit.WebClient#getCurrentWindow()} + * by {@link org.htmlunit.WebClient#getCurrentWindow()} */ @SuppressWarnings("unchecked") public

P setSelectedAttribute(final HtmlOption selectedOption, final boolean isSelected, diff --git a/src/main/java/org/htmlunit/html/HtmlSelectableTextInput.java b/src/main/java/org/htmlunit/html/HtmlSelectableTextInput.java index f6aeb79ac85..411df97eef4 100644 --- a/src/main/java/org/htmlunit/html/HtmlSelectableTextInput.java +++ b/src/main/java/org/htmlunit/html/HtmlSelectableTextInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlSlot.java b/src/main/java/org/htmlunit/html/HtmlSlot.java index f2e59524748..0ebc751d2fe 100644 --- a/src/main/java/org/htmlunit/html/HtmlSlot.java +++ b/src/main/java/org/htmlunit/html/HtmlSlot.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlSmall.java b/src/main/java/org/htmlunit/html/HtmlSmall.java index d7b8bb502e3..a8e2f616292 100644 --- a/src/main/java/org/htmlunit/html/HtmlSmall.java +++ b/src/main/java/org/htmlunit/html/HtmlSmall.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlSource.java b/src/main/java/org/htmlunit/html/HtmlSource.java index 00ca3280eee..e554dc406f6 100644 --- a/src/main/java/org/htmlunit/html/HtmlSource.java +++ b/src/main/java/org/htmlunit/html/HtmlSource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlSpan.java b/src/main/java/org/htmlunit/html/HtmlSpan.java index f31e6496839..abf2243c018 100644 --- a/src/main/java/org/htmlunit/html/HtmlSpan.java +++ b/src/main/java/org/htmlunit/html/HtmlSpan.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlStrike.java b/src/main/java/org/htmlunit/html/HtmlStrike.java index 3c71ce763d0..6e1156424a2 100644 --- a/src/main/java/org/htmlunit/html/HtmlStrike.java +++ b/src/main/java/org/htmlunit/html/HtmlStrike.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlStrong.java b/src/main/java/org/htmlunit/html/HtmlStrong.java index a4de4d07819..7266e15bb6d 100644 --- a/src/main/java/org/htmlunit/html/HtmlStrong.java +++ b/src/main/java/org/htmlunit/html/HtmlStrong.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlStyle.java b/src/main/java/org/htmlunit/html/HtmlStyle.java index 3bd74f6bf04..d450ea6babc 100644 --- a/src/main/java/org/htmlunit/html/HtmlStyle.java +++ b/src/main/java/org/htmlunit/html/HtmlStyle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlSubmitInput.java b/src/main/java/org/htmlunit/html/HtmlSubmitInput.java index 052fd7f0786..3c1067d3788 100644 --- a/src/main/java/org/htmlunit/html/HtmlSubmitInput.java +++ b/src/main/java/org/htmlunit/html/HtmlSubmitInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlSubscript.java b/src/main/java/org/htmlunit/html/HtmlSubscript.java index d88c3f4eee9..bbaf6601bc5 100644 --- a/src/main/java/org/htmlunit/html/HtmlSubscript.java +++ b/src/main/java/org/htmlunit/html/HtmlSubscript.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlSummary.java b/src/main/java/org/htmlunit/html/HtmlSummary.java index 82209589bf3..3bcda51ecf1 100644 --- a/src/main/java/org/htmlunit/html/HtmlSummary.java +++ b/src/main/java/org/htmlunit/html/HtmlSummary.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlSuperscript.java b/src/main/java/org/htmlunit/html/HtmlSuperscript.java index da860d55d68..99887803649 100644 --- a/src/main/java/org/htmlunit/html/HtmlSuperscript.java +++ b/src/main/java/org/htmlunit/html/HtmlSuperscript.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlSvg.java b/src/main/java/org/htmlunit/html/HtmlSvg.java index 75fa768d2d8..2d2708dff95 100644 --- a/src/main/java/org/htmlunit/html/HtmlSvg.java +++ b/src/main/java/org/htmlunit/html/HtmlSvg.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlTable.java b/src/main/java/org/htmlunit/html/HtmlTable.java index fef6feba237..9d62e33c804 100644 --- a/src/main/java/org/htmlunit/html/HtmlTable.java +++ b/src/main/java/org/htmlunit/html/HtmlTable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -91,9 +91,11 @@ public final HtmlTableCell getCellAt(final int rowIndex, final int columnIndex) return cell; } } - if (cell.getRowSpan() > 1 || cell.getColumnSpan() > 1) { - for (int i = 0; i < cell.getRowSpan(); i++) { - for (int j = 0; j < cell.getColumnSpan(); j++) { + final int rowSpan = cell.getRowSpan(); + final int columnSpan = cell.getColumnSpan(); + if (rowSpan > 1 || columnSpan > 1) { + for (int i = 0; i < rowSpan; i++) { + for (int j = 0; j < columnSpan; j++) { occupied.add(new Position(row + i, col + j)); } } @@ -235,7 +237,7 @@ public List getBodies() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code summary} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getSummaryAttribute() { return getAttributeDirect("summary"); @@ -247,7 +249,7 @@ public final String getSummaryAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code width} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getWidthAttribute() { return getAttributeDirect("width"); @@ -259,7 +261,7 @@ public final String getWidthAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code border} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getBorderAttribute() { return getAttributeDirect("border"); @@ -271,7 +273,7 @@ public final String getBorderAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code frame} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getFrameAttribute() { return getAttributeDirect("frame"); @@ -283,7 +285,7 @@ public final String getFrameAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code rules} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getRulesAttribute() { return getAttributeDirect("rules"); @@ -295,7 +297,7 @@ public final String getRulesAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code cellspacing} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCellSpacingAttribute() { return getAttributeDirect("cellspacing"); @@ -307,7 +309,7 @@ public final String getCellSpacingAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code cellpadding} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCellPaddingAttribute() { return getAttributeDirect("cellpadding"); @@ -319,7 +321,7 @@ public final String getCellPaddingAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code align} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAlignAttribute() { return getAttributeDirect("align"); @@ -331,7 +333,7 @@ public final String getAlignAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code bgcolor} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getBgcolorAttribute() { return getAttributeDirect("bgcolor"); diff --git a/src/main/java/org/htmlunit/html/HtmlTableBody.java b/src/main/java/org/htmlunit/html/HtmlTableBody.java index c7487ed2010..6febca3b576 100644 --- a/src/main/java/org/htmlunit/html/HtmlTableBody.java +++ b/src/main/java/org/htmlunit/html/HtmlTableBody.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlTableCell.java b/src/main/java/org/htmlunit/html/HtmlTableCell.java index 9dfc11abd39..591a495729e 100644 --- a/src/main/java/org/htmlunit/html/HtmlTableCell.java +++ b/src/main/java/org/htmlunit/html/HtmlTableCell.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,6 @@ */ package org.htmlunit.html; -import static org.htmlunit.BrowserVersionFeatures.JS_TABLE_SPAN_SET_ZERO_IF_INVALID; - import java.util.Map; import org.apache.commons.lang3.StringUtils; @@ -80,18 +78,11 @@ public int getRowSpan() { } try { final int span = (int) Double.parseDouble(spanString); - if (getPage().getWebClient().getBrowserVersion().hasFeature(JS_TABLE_SPAN_SET_ZERO_IF_INVALID)) { - if (span < 0) { - return 1; - } - if (span < 1) { - return 0; - } + if (span < 0) { + return 1; } - else { - if (span < 1) { - return 1; - } + if (span < 1) { + return 0; } if (span > 65_534) { diff --git a/src/main/java/org/htmlunit/html/HtmlTableColumn.java b/src/main/java/org/htmlunit/html/HtmlTableColumn.java index 2aa6d78f733..41b63761952 100644 --- a/src/main/java/org/htmlunit/html/HtmlTableColumn.java +++ b/src/main/java/org/htmlunit/html/HtmlTableColumn.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,7 @@ public class HtmlTableColumn extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code span} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getSpanAttribute() { return getAttributeDirect("span"); @@ -63,7 +63,7 @@ public final String getSpanAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code width} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getWidthAttribute() { return getAttributeDirect("width"); @@ -75,7 +75,7 @@ public final String getWidthAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code align} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAlignAttribute() { return getAttributeDirect("align"); @@ -87,7 +87,7 @@ public final String getAlignAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code char} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharAttribute() { return getAttributeDirect("char"); @@ -99,7 +99,7 @@ public final String getCharAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code charoff} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharoffAttribute() { return getAttributeDirect("charoff"); @@ -111,7 +111,7 @@ public final String getCharoffAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code valign} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getValignAttribute() { return getAttributeDirect("valign"); diff --git a/src/main/java/org/htmlunit/html/HtmlTableColumnGroup.java b/src/main/java/org/htmlunit/html/HtmlTableColumnGroup.java index 32f221f9800..ac92ea5e2f6 100644 --- a/src/main/java/org/htmlunit/html/HtmlTableColumnGroup.java +++ b/src/main/java/org/htmlunit/html/HtmlTableColumnGroup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,7 @@ public class HtmlTableColumnGroup extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code span} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getSpanAttribute() { return getAttributeDirect("span"); @@ -63,7 +63,7 @@ public final String getSpanAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code width} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getWidthAttribute() { return getAttributeDirect("width"); @@ -75,7 +75,7 @@ public final String getWidthAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code align} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAlignAttribute() { return getAttributeDirect("align"); @@ -87,7 +87,7 @@ public final String getAlignAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code char} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharAttribute() { return getAttributeDirect("char"); @@ -99,7 +99,7 @@ public final String getCharAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code charoff} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharoffAttribute() { return getAttributeDirect("charoff"); @@ -111,7 +111,7 @@ public final String getCharoffAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code valign} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getValignAttribute() { return getAttributeDirect("valign"); diff --git a/src/main/java/org/htmlunit/html/HtmlTableDataCell.java b/src/main/java/org/htmlunit/html/HtmlTableDataCell.java index e3eeb446c3f..65693e08c7f 100644 --- a/src/main/java/org/htmlunit/html/HtmlTableDataCell.java +++ b/src/main/java/org/htmlunit/html/HtmlTableDataCell.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ public class HtmlTableDataCell extends HtmlTableCell { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code abbr} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAbbrAttribute() { return getAttributeDirect("abbr"); @@ -62,7 +62,7 @@ public final String getAbbrAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code axis} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAxisAttribute() { return getAttributeDirect("axis"); @@ -74,7 +74,7 @@ public final String getAxisAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code headers} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getHeadersAttribute() { return getAttributeDirect("headers"); @@ -86,7 +86,7 @@ public final String getHeadersAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code scope} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getScopeAttribute() { return getAttributeDirect("scope"); @@ -98,7 +98,7 @@ public final String getScopeAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code rowspan} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getRowSpanAttribute() { return getAttributeDirect("rowspan"); @@ -110,7 +110,7 @@ public final String getRowSpanAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code colspan} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getColumnSpanAttribute() { return getAttributeDirect("colspan"); @@ -122,7 +122,7 @@ public final String getColumnSpanAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code align} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAlignAttribute() { return getAttributeDirect("align"); @@ -134,7 +134,7 @@ public final String getAlignAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code char} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharAttribute() { return getAttributeDirect("char"); @@ -146,7 +146,7 @@ public final String getCharAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code charoff} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharoffAttribute() { return getAttributeDirect("charoff"); @@ -158,7 +158,7 @@ public final String getCharoffAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code valign} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getValignAttribute() { return getAttributeDirect("valign"); @@ -170,7 +170,7 @@ public final String getValignAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code nowrap} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getNoWrapAttribute() { return getAttributeDirect("nowrap"); @@ -182,7 +182,7 @@ public final String getNoWrapAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code bgcolor} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getBgcolorAttribute() { return getAttributeDirect("bgcolor"); @@ -194,7 +194,7 @@ public final String getBgcolorAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code width} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getWidthAttribute() { return getAttributeDirect("width"); @@ -206,7 +206,7 @@ public final String getWidthAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code height} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getHeightAttribute() { return getAttributeDirect("height"); diff --git a/src/main/java/org/htmlunit/html/HtmlTableFooter.java b/src/main/java/org/htmlunit/html/HtmlTableFooter.java index 87a89d4916a..38141b21ab9 100644 --- a/src/main/java/org/htmlunit/html/HtmlTableFooter.java +++ b/src/main/java/org/htmlunit/html/HtmlTableFooter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlTableHeader.java b/src/main/java/org/htmlunit/html/HtmlTableHeader.java index 4fcc4929da6..f53cdad68b3 100644 --- a/src/main/java/org/htmlunit/html/HtmlTableHeader.java +++ b/src/main/java/org/htmlunit/html/HtmlTableHeader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlTableHeaderCell.java b/src/main/java/org/htmlunit/html/HtmlTableHeaderCell.java index 490d9aff7c5..40514eb6bc4 100644 --- a/src/main/java/org/htmlunit/html/HtmlTableHeaderCell.java +++ b/src/main/java/org/htmlunit/html/HtmlTableHeaderCell.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ public class HtmlTableHeaderCell extends HtmlTableCell { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code abbr} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAbbrAttribute() { return getAttributeDirect("abbr"); @@ -62,7 +62,7 @@ public final String getAbbrAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code axis} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAxisAttribute() { return getAttributeDirect("axis"); @@ -74,7 +74,7 @@ public final String getAxisAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code headers} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getHeadersAttribute() { return getAttributeDirect("headers"); @@ -86,7 +86,7 @@ public final String getHeadersAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code scope} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getScopeAttribute() { return getAttributeDirect("scope"); @@ -98,7 +98,7 @@ public final String getScopeAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code rowspan} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getRowSpanAttribute() { return getAttributeDirect("rowspan"); @@ -110,7 +110,7 @@ public final String getRowSpanAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code colspan} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getColumnSpanAttribute() { return getAttributeDirect("colspan"); @@ -122,7 +122,7 @@ public final String getColumnSpanAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code align} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAlignAttribute() { return getAttributeDirect("align"); @@ -134,7 +134,7 @@ public final String getAlignAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code char} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharAttribute() { return getAttributeDirect("char"); @@ -146,7 +146,7 @@ public final String getCharAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code charoff} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharoffAttribute() { return getAttributeDirect("charoff"); @@ -158,7 +158,7 @@ public final String getCharoffAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code valign} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getValignAttribute() { return getAttributeDirect("valign"); @@ -170,7 +170,7 @@ public final String getValignAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code nowrap} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getNoWrapAttribute() { return getAttributeDirect("nowrap"); @@ -182,7 +182,7 @@ public final String getNoWrapAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code bgcolor} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getBgcolorAttribute() { return getAttributeDirect("bgcolor"); @@ -194,7 +194,7 @@ public final String getBgcolorAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code width} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getWidthAttribute() { return getAttributeDirect("width"); @@ -206,7 +206,7 @@ public final String getWidthAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code height} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getHeightAttribute() { return getAttributeDirect("height"); diff --git a/src/main/java/org/htmlunit/html/HtmlTableRow.java b/src/main/java/org/htmlunit/html/HtmlTableRow.java index baaf17ec163..0afdd5f95a9 100644 --- a/src/main/java/org/htmlunit/html/HtmlTableRow.java +++ b/src/main/java/org/htmlunit/html/HtmlTableRow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -91,7 +91,7 @@ public HtmlTableCell getCell(final int index) throws IndexOutOfBoundsException { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code align} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAlignAttribute() { return getAttributeDirect("align"); @@ -103,7 +103,7 @@ public final String getAlignAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code char} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharAttribute() { return getAttributeDirect("char"); @@ -115,7 +115,7 @@ public final String getCharAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code charoff} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharoffAttribute() { return getAttributeDirect("charoff"); @@ -127,7 +127,7 @@ public final String getCharoffAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code valign} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getValignAttribute() { return getAttributeDirect("valign"); @@ -147,7 +147,7 @@ public HtmlTable getEnclosingTable() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code bgcolor} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getBgcolorAttribute() { return getAttributeDirect("bgcolor"); @@ -166,7 +166,9 @@ public CellIterator() { setNextCell(getFirstChild()); } - /** @return whether there is another cell available */ + /** + * @return whether there is another cell available + */ @Override public boolean hasNext() { return nextCell_ != null; diff --git a/src/main/java/org/htmlunit/html/HtmlTelInput.java b/src/main/java/org/htmlunit/html/HtmlTelInput.java index 6e593928e37..f8068a6c9df 100644 --- a/src/main/java/org/htmlunit/html/HtmlTelInput.java +++ b/src/main/java/org/htmlunit/html/HtmlTelInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlTeletype.java b/src/main/java/org/htmlunit/html/HtmlTeletype.java index 6898074a910..67520a8d239 100644 --- a/src/main/java/org/htmlunit/html/HtmlTeletype.java +++ b/src/main/java/org/htmlunit/html/HtmlTeletype.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlTemplate.java b/src/main/java/org/htmlunit/html/HtmlTemplate.java index 20258ab9783..46c039e0020 100644 --- a/src/main/java/org/htmlunit/html/HtmlTemplate.java +++ b/src/main/java/org/htmlunit/html/HtmlTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -69,8 +69,41 @@ protected boolean isEmptyXmlTagExpanded() { return true; } + /** + * {@inheritDoc} + */ @Override - protected void printChildrenAsXml(final String indent, final PrintWriter printWriter) { - domDocumentFragment_.printChildrenAsXml(indent, printWriter); + protected boolean printXml(final String indent, final boolean tagBefore, final PrintWriter printWriter) { + final boolean hasChildren = domDocumentFragment_.getFirstChild() != null; + + if (tagBefore) { + printWriter.print("\r\n"); + printWriter.print(indent); + } + + printWriter.print('<'); + printOpeningTagContentAsXml(printWriter); + + if (hasChildren) { + printWriter.print(">"); + final boolean tag = domDocumentFragment_.printChildrenAsXml(indent, tagBefore, printWriter); + if (tag) { + printWriter.print("\r\n"); + printWriter.print(indent); + } + printWriter.print(""); + } + else if (isEmptyXmlTagExpanded()) { + printWriter.print(">"); + } + else { + printWriter.print("/>"); + } + + return true; } } diff --git a/src/main/java/org/htmlunit/html/HtmlTextArea.java b/src/main/java/org/htmlunit/html/HtmlTextArea.java index 961b7b08e4d..8b32425c046 100644 --- a/src/main/java/org/htmlunit/html/HtmlTextArea.java +++ b/src/main/java/org/htmlunit/html/HtmlTextArea.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import java.util.Map; import org.apache.commons.lang3.StringUtils; -import org.apache.commons.text.StringEscapeUtils; import org.htmlunit.SgmlPage; import org.htmlunit.html.impl.SelectableTextInput; import org.htmlunit.html.impl.SelectableTextSelectionDelegate; @@ -425,19 +424,17 @@ public void setSelectionEnd(final int selectionEnd) { } /** - * Recursively write the XML data for the node tree starting at node. - * - * @param indent white space to indent child nodes - * @param printWriter writer where child nodes are written + * {@inheritDoc} */ @Override - protected void printXml(final String indent, final PrintWriter printWriter) { + protected boolean printXml(final String indent, final boolean tagBefore, final PrintWriter printWriter) { printWriter.print(indent + "<"); printOpeningTagContentAsXml(printWriter); printWriter.print(">"); - printWriter.print(StringEscapeUtils.escapeXml10(getText())); + printWriter.print(org.htmlunit.util.StringUtils.escapeXml(getText())); printWriter.print(""); + return true; } /** diff --git a/src/main/java/org/htmlunit/html/HtmlTextInput.java b/src/main/java/org/htmlunit/html/HtmlTextInput.java index 736ad273312..a50abdd9571 100644 --- a/src/main/java/org/htmlunit/html/HtmlTextInput.java +++ b/src/main/java/org/htmlunit/html/HtmlTextInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlTime.java b/src/main/java/org/htmlunit/html/HtmlTime.java index 9c814439dd8..65d0d378974 100644 --- a/src/main/java/org/htmlunit/html/HtmlTime.java +++ b/src/main/java/org/htmlunit/html/HtmlTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlTimeInput.java b/src/main/java/org/htmlunit/html/HtmlTimeInput.java index 2b2e33695b8..74f38e37021 100644 --- a/src/main/java/org/htmlunit/html/HtmlTimeInput.java +++ b/src/main/java/org/htmlunit/html/HtmlTimeInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlTitle.java b/src/main/java/org/htmlunit/html/HtmlTitle.java index c49e6fc0089..fc04a5c0b83 100644 --- a/src/main/java/org/htmlunit/html/HtmlTitle.java +++ b/src/main/java/org/htmlunit/html/HtmlTitle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlTrack.java b/src/main/java/org/htmlunit/html/HtmlTrack.java index be74d4e73bc..1cd0542f69b 100644 --- a/src/main/java/org/htmlunit/html/HtmlTrack.java +++ b/src/main/java/org/htmlunit/html/HtmlTrack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlUnderlined.java b/src/main/java/org/htmlunit/html/HtmlUnderlined.java index fccdc68f4de..7d480355c53 100644 --- a/src/main/java/org/htmlunit/html/HtmlUnderlined.java +++ b/src/main/java/org/htmlunit/html/HtmlUnderlined.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlUnknownElement.java b/src/main/java/org/htmlunit/html/HtmlUnknownElement.java index 57c628e6998..0cd1dd74ead 100644 --- a/src/main/java/org/htmlunit/html/HtmlUnknownElement.java +++ b/src/main/java/org/htmlunit/html/HtmlUnknownElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlUnorderedList.java b/src/main/java/org/htmlunit/html/HtmlUnorderedList.java index a1b4ac3344a..e12a0904b37 100644 --- a/src/main/java/org/htmlunit/html/HtmlUnorderedList.java +++ b/src/main/java/org/htmlunit/html/HtmlUnorderedList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ public class HtmlUnorderedList extends HtmlElement { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code type} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getTypeAttribute() { return getAttributeDirect(TYPE_ATTRIBUTE); @@ -62,7 +62,7 @@ public final String getTypeAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code compact} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCompactAttribute() { return getAttributeDirect("compact"); diff --git a/src/main/java/org/htmlunit/html/HtmlUrlInput.java b/src/main/java/org/htmlunit/html/HtmlUrlInput.java index c2c9ae192f5..a94157b7e26 100644 --- a/src/main/java/org/htmlunit/html/HtmlUrlInput.java +++ b/src/main/java/org/htmlunit/html/HtmlUrlInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,18 +38,8 @@ public class HtmlUrlInput extends HtmlSelectableTextInput implements LabelableEl */ HtmlUrlInput(final String qualifiedName, final SgmlPage page, final Map attributes) { - super(qualifiedName, page, trimValueAttribute(page, attributes)); - } - - private static Map trimValueAttribute(final SgmlPage page, final Map attributes) { - for (final Map.Entry entry : attributes.entrySet()) { - if (VALUE_ATTRIBUTE.equalsIgnoreCase(entry.getKey())) { - entry.getValue().setValue(entry.getValue().getValue().trim()); - break; - } - } - - return attributes; + super(qualifiedName, page, attributes); + setRawValue(getValue().trim()); } /** diff --git a/src/main/java/org/htmlunit/html/HtmlVariable.java b/src/main/java/org/htmlunit/html/HtmlVariable.java index 7e277086443..456f4c5daa1 100644 --- a/src/main/java/org/htmlunit/html/HtmlVariable.java +++ b/src/main/java/org/htmlunit/html/HtmlVariable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlVideo.java b/src/main/java/org/htmlunit/html/HtmlVideo.java index c64baad80c9..88dfdedd489 100644 --- a/src/main/java/org/htmlunit/html/HtmlVideo.java +++ b/src/main/java/org/htmlunit/html/HtmlVideo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlWeekInput.java b/src/main/java/org/htmlunit/html/HtmlWeekInput.java index afa4a4370eb..c94a7423dea 100644 --- a/src/main/java/org/htmlunit/html/HtmlWeekInput.java +++ b/src/main/java/org/htmlunit/html/HtmlWeekInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/HtmlWordBreak.java b/src/main/java/org/htmlunit/html/HtmlWordBreak.java index 7244bc185dc..90c2c7d071e 100644 --- a/src/main/java/org/htmlunit/html/HtmlWordBreak.java +++ b/src/main/java/org/htmlunit/html/HtmlWordBreak.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/Keyboard.java b/src/main/java/org/htmlunit/html/Keyboard.java index e16f6ba0578..fb935a3e7c6 100644 --- a/src/main/java/org/htmlunit/html/Keyboard.java +++ b/src/main/java/org/htmlunit/html/Keyboard.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/LabelableElement.java b/src/main/java/org/htmlunit/html/LabelableElement.java index d9f5ae80603..ab098808674 100644 --- a/src/main/java/org/htmlunit/html/LabelableElement.java +++ b/src/main/java/org/htmlunit/html/LabelableElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/ScriptElement.java b/src/main/java/org/htmlunit/html/ScriptElement.java index a955817a64c..1a96e2bea1d 100644 --- a/src/main/java/org/htmlunit/html/ScriptElement.java +++ b/src/main/java/org/htmlunit/html/ScriptElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/ScriptElementSupport.java b/src/main/java/org/htmlunit/html/ScriptElementSupport.java index b48f630f1b2..796c53d1a94 100644 --- a/src/main/java/org/htmlunit/html/ScriptElementSupport.java +++ b/src/main/java/org/htmlunit/html/ScriptElementSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ import org.apache.commons.logging.LogFactory; import org.htmlunit.FailingHttpStatusCodeException; import org.htmlunit.SgmlPage; +import org.htmlunit.WebClient; import org.htmlunit.WebWindow; import org.htmlunit.html.HtmlPage.JavaScriptLoadResult; import org.htmlunit.javascript.AbstractJavaScriptEngine; @@ -62,7 +63,7 @@ private ScriptElementSupport() { * Support method that is called from the (html or svg) script and the link tag. * * @param script the ScriptElement to work for - * @param postponed whether to use {@link org.htmlunit.javascript.PostponedAction} or no + * @param postponed whether to use {@link org.htmlunit.javascript.PostponedAction} or not */ public static void onAllChildrenAddedToPage(final ScriptElement script, final boolean postponed) { final DomElement element = (DomElement) script; @@ -73,7 +74,9 @@ public static void onAllChildrenAddedToPage(final ScriptElement script, final bo LOG.debug("Script node added: " + element.asXml()); } - if (!element.getPage().getWebClient().isJavaScriptEngineEnabled()) { + final SgmlPage page = element.getPage(); + final WebClient webClient = page.getWebClient(); + if (!webClient.isJavaScriptEngineEnabled()) { LOG.debug("Script found but not executed because javascript engine is disabled"); return; } @@ -84,7 +87,7 @@ public static void onAllChildrenAddedToPage(final ScriptElement script, final bo return; } - final WebWindow webWindow = element.getPage().getEnclosingWindow(); + final WebWindow webWindow = page.getEnclosingWindow(); if (webWindow != null) { final StringBuilder description = new StringBuilder() .append("Execution of ") @@ -94,7 +97,7 @@ public static void onAllChildrenAddedToPage(final ScriptElement script, final bo description.append(" (").append(srcAttrib).append(')'); } - final PostponedAction action = new PostponedAction(element.getPage(), description.toString()) { + final PostponedAction action = new PostponedAction(page, description.toString()) { @Override public void execute() { // see HTMLDocument.setExecutingDynamicExternalPosponed(boolean) @@ -103,7 +106,7 @@ public void execute() { if (window != null) { jsDoc = (HTMLDocument) window.getDocument(); jsDoc.setExecutingDynamicExternalPosponed(element.getStartLineNumber() == -1 - && ATTRIBUTE_NOT_DEFINED != srcAttrib); + && !hasNoSrcAttrib); } try { executeScriptIfNeeded(script, false, false); @@ -116,23 +119,17 @@ public void execute() { } }; - final AbstractJavaScriptEngine engine = element.getPage().getWebClient().getJavaScriptEngine(); - if (engine != null - && element.hasAttribute("async") && !engine.isScriptRunning()) { - final HtmlPage owningPage = element.getHtmlPageOrNull(); - owningPage.addAfterLoadAction(action); + final AbstractJavaScriptEngine engine = webClient.getJavaScriptEngine(); + if (element.hasAttribute("async") && !hasNoSrcAttrib) { + engine.addPostponedAction(action); } - else if (engine != null - && (element.hasAttribute("async") - || postponed && StringUtils.isBlank(element.getTextContent()))) { + else if (postponed && !hasNoSrcAttrib) { engine.addPostponedAction(action); } else { try { action.execute(); - if (engine != null) { - engine.processPostponedActions(); - } + engine.processPostponedActions(); } catch (final RuntimeException e) { throw e; @@ -308,6 +305,10 @@ public static boolean isJavaScript(String typeAttribute, final String languageAt private static void executeEvent(final DomElement element, final String type) { final EventTarget eventTarget = element.getScriptableObject(); final Event event = new Event(element, type); + + event.setParentScope(eventTarget); + event.setPrototype(eventTarget.getPrototype(event.getClass())); + eventTarget.executeEventLocally(event); } diff --git a/src/main/java/org/htmlunit/html/SiblingDomNodeList.java b/src/main/java/org/htmlunit/html/SiblingDomNodeList.java index 009de12080e..b864693af43 100644 --- a/src/main/java/org/htmlunit/html/SiblingDomNodeList.java +++ b/src/main/java/org/htmlunit/html/SiblingDomNodeList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/StaticDomNodeList.java b/src/main/java/org/htmlunit/html/StaticDomNodeList.java index a0305646333..8a1305c0e6b 100644 --- a/src/main/java/org/htmlunit/html/StaticDomNodeList.java +++ b/src/main/java/org/htmlunit/html/StaticDomNodeList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/SubmittableElement.java b/src/main/java/org/htmlunit/html/SubmittableElement.java index a8c8a3006e0..b913146e4f9 100644 --- a/src/main/java/org/htmlunit/html/SubmittableElement.java +++ b/src/main/java/org/htmlunit/html/SubmittableElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/TableRowGroup.java b/src/main/java/org/htmlunit/html/TableRowGroup.java index f885b0cfafb..c1befc12605 100644 --- a/src/main/java/org/htmlunit/html/TableRowGroup.java +++ b/src/main/java/org/htmlunit/html/TableRowGroup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,7 +68,7 @@ public final List getRows() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code align} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getAlignAttribute() { return getAttributeDirect("align"); @@ -80,7 +80,7 @@ public final String getAlignAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code char} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharAttribute() { return getAttributeDirect("char"); @@ -92,7 +92,7 @@ public final String getCharAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code charoff} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getCharoffAttribute() { return getAttributeDirect("charoff"); @@ -104,7 +104,7 @@ public final String getCharoffAttribute() { * documentation for details on the use of this attribute. * * @return the value of the attribute {@code valign} - * or an empty string if that attribute isn't defined. + * or an empty string if that attribute isn't defined. */ public final String getValignAttribute() { return getAttributeDirect("valign"); diff --git a/src/main/java/org/htmlunit/html/UnknownElementFactory.java b/src/main/java/org/htmlunit/html/UnknownElementFactory.java index f5e640f9aaa..4ecff7bab49 100644 --- a/src/main/java/org/htmlunit/html/UnknownElementFactory.java +++ b/src/main/java/org/htmlunit/html/UnknownElementFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/ValidatableElement.java b/src/main/java/org/htmlunit/html/ValidatableElement.java index 654aa459727..0b441b20e32 100644 --- a/src/main/java/org/htmlunit/html/ValidatableElement.java +++ b/src/main/java/org/htmlunit/html/ValidatableElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ public interface ValidatableElement { /** * @return a boolean value boolean value that is true if the user - * has provided input that the browser is unable to convert. + * has provided input that the browser is unable to convert. */ default boolean hasBadInputValidityState() { return false; @@ -45,14 +45,14 @@ default boolean hasBadInputValidityState() { /** * @return a boolean value indicating whether the element's custom validity message - * has been set to a non-empty string by calling the element's setCustomValidity() method. + * has been set to a non-empty string by calling the element's setCustomValidity() method. */ boolean isCustomErrorValidityState(); /** * @return true if the value does not match the specified pattern, - * and false if it does match. - * If true, the element matches the :invalid CSS pseudo-class + * and false if it does match. + * If true, the element matches the :invalid CSS pseudo-class */ default boolean hasPatternMismatchValidityState() { return false; @@ -60,9 +60,9 @@ default boolean hasPatternMismatchValidityState() { /** * @return true if the value does not fit the rules determined by the step attribute - * (that is, it's not evenly divisible by the step value), - * or false if it does fit the step rule. - * If true, the element matches the :invalid and :out-of-range CSS pseudo-classes. + * (that is, it's not evenly divisible by the step value), + * or false if it does fit the step rule. + * If true, the element matches the :invalid and :out-of-range CSS pseudo-classes. */ default boolean isStepMismatchValidityState() { return false; @@ -70,8 +70,8 @@ default boolean isStepMismatchValidityState() { /** * @return true if the value is longer than the maximum length specified - * by the maxlength attribute, or false if it is shorter than or equal to the maximum. - * If true, the element matches the :invalid CSS pseudo-class + * by the maxlength attribute, or false if it is shorter than or equal to the maximum. + * If true, the element matches the :invalid CSS pseudo-class */ default boolean isTooLongValidityState() { return false; @@ -79,8 +79,8 @@ default boolean isTooLongValidityState() { /** * @return true if the value is shorter than the minimum length specified - * by the minlength attribute, or false if it is greater than or equal to the minimum. - * If true, the element matches the :invalid CSS pseudo-class + * by the minlength attribute, or false if it is greater than or equal to the minimum. + * If true, the element matches the :invalid CSS pseudo-class */ default boolean isTooShortValidityState() { return false; @@ -88,8 +88,8 @@ default boolean isTooShortValidityState() { /** * @return true if the value is not in the required syntax (when type is email or url), - * or false if the syntax is correct. - * If true, the element matches the :invalid CSS pseudo-class. + * or false if the syntax is correct. + * If true, the element matches the :invalid CSS pseudo-class. */ default boolean hasTypeMismatchValidityState() { return false; @@ -97,8 +97,8 @@ default boolean hasTypeMismatchValidityState() { /** * @return true if the value is greater than the maximum specified by the max attribute, - * or false if it is less than or equal to the maximum. - * If true, the element matches the :invalid and :out-of-range CSS pseudo-classes. + * or false if it is less than or equal to the maximum. + * If true, the element matches the :invalid and :out-of-range CSS pseudo-classes. */ default boolean hasRangeOverflowValidityState() { return false; @@ -106,8 +106,8 @@ default boolean hasRangeOverflowValidityState() { /** * @return true if the value is less than the minimum specified by the min attribute, - * or false if it is greater than or equal to the minimum. - * If true, the element matches the :invalid and :out-of-range CSS pseudo-classes. + * or false if it is greater than or equal to the minimum. + * If true, the element matches the :invalid and :out-of-range CSS pseudo-classes. */ default boolean hasRangeUnderflowValidityState() { return false; @@ -115,14 +115,14 @@ default boolean hasRangeUnderflowValidityState() { /** * @return true if the element meets all its validation constraints, and is therefore - * considered to be valid, or false if it fails any constraint. - * If true, the element matches the :valid CSS pseudo-class; the :invalid CSS pseudo-class otherwise. + * considered to be valid, or false if it fails any constraint. + * If true, the element matches the :valid CSS pseudo-class; the :invalid CSS pseudo-class otherwise. */ boolean isValidValidityState(); /** * @return true if the element has a required attribute, but no value, or false otherwise. - * If true, the element matches the :invalid CSS pseudo-class. + * If true, the element matches the :invalid CSS pseudo-class. */ default boolean isValueMissingValidityState() { return false; diff --git a/src/main/java/org/htmlunit/html/XHtmlPage.java b/src/main/java/org/htmlunit/html/XHtmlPage.java index 0ad14093a45..6f336bf0659 100644 --- a/src/main/java/org/htmlunit/html/XHtmlPage.java +++ b/src/main/java/org/htmlunit/html/XHtmlPage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/XmlSerializer.java b/src/main/java/org/htmlunit/html/XmlSerializer.java index 0eb2cb5a44b..14f9d99e324 100644 --- a/src/main/java/org/htmlunit/html/XmlSerializer.java +++ b/src/main/java/org/htmlunit/html/XmlSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,6 +54,12 @@ public class XmlSerializer { private final StringBuilder indent_ = new StringBuilder(); private File outputDir_; + /** + * Saves the given {@link SgmlPage} to the file. + * @param page the page to save + * @param file the destination + * @throws IOException in case of error + */ public void save(final SgmlPage page, final File file) throws IOException { save(page, file, false); } @@ -279,7 +285,7 @@ protected Map getAttributesFor(final HtmlLink link) throws IOEx final String protocol = link.getWebRequest().getUrl().getProtocol(); if ("http".equals(protocol) || "https".equals(protocol)) { try { - final WebResponse response = link.getWebResponse(true, null); + final WebResponse response = link.getWebResponse(true, null, false, null); final File file = createFile(hrefAttr.getValue(), ".css"); FileUtils.writeStringToFile(file, response.getContentAsString(), ISO_8859_1); diff --git a/src/main/java/org/htmlunit/html/impl/Color.java b/src/main/java/org/htmlunit/html/impl/Color.java index bdd1e267813..2dc3fe586e8 100644 --- a/src/main/java/org/htmlunit/html/impl/Color.java +++ b/src/main/java/org/htmlunit/html/impl/Color.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/impl/SelectableTextInput.java b/src/main/java/org/htmlunit/html/impl/SelectableTextInput.java index 04b4560a603..9e23ec7b611 100644 --- a/src/main/java/org/htmlunit/html/impl/SelectableTextInput.java +++ b/src/main/java/org/htmlunit/html/impl/SelectableTextInput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/impl/SelectableTextSelectionDelegate.java b/src/main/java/org/htmlunit/html/impl/SelectableTextSelectionDelegate.java index 0430e4460e5..334d2805102 100644 --- a/src/main/java/org/htmlunit/html/impl/SelectableTextSelectionDelegate.java +++ b/src/main/java/org/htmlunit/html/impl/SelectableTextSelectionDelegate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/impl/SelectionDelegate.java b/src/main/java/org/htmlunit/html/impl/SelectionDelegate.java index c2cdd07e260..0133077f0a5 100644 --- a/src/main/java/org/htmlunit/html/impl/SelectionDelegate.java +++ b/src/main/java/org/htmlunit/html/impl/SelectionDelegate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/impl/SimpleRange.java b/src/main/java/org/htmlunit/html/impl/SimpleRange.java index fbef296df7e..a9fa08f70a3 100644 --- a/src/main/java/org/htmlunit/html/impl/SimpleRange.java +++ b/src/main/java/org/htmlunit/html/impl/SimpleRange.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -291,7 +291,7 @@ public DomDocumentFragment extractContents() throws DOMException { /** * @return true if startContainer equals endContainer and - * startOffset equals endOffset + * startOffset equals endOffset * @throws DOMException in case of error */ public boolean isCollapsed() throws DOMException { @@ -300,7 +300,7 @@ public boolean isCollapsed() throws DOMException { /** * @return the deepest common ancestor container of this range's two - * boundary-points. + * boundary-points. * @throws DOMException in case of error */ public DomNode getCommonAncestorContainer() throws DOMException { diff --git a/src/main/java/org/htmlunit/html/impl/SimpleSelectionDelegate.java b/src/main/java/org/htmlunit/html/impl/SimpleSelectionDelegate.java index 52458d67ba8..d45435cdb85 100644 --- a/src/main/java/org/htmlunit/html/impl/SimpleSelectionDelegate.java +++ b/src/main/java/org/htmlunit/html/impl/SimpleSelectionDelegate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/impl/package-info.java b/src/main/java/org/htmlunit/html/impl/package-info.java index bad5bdf5a12..07d9b477f31 100644 --- a/src/main/java/org/htmlunit/html/impl/package-info.java +++ b/src/main/java/org/htmlunit/html/impl/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/package-info.java b/src/main/java/org/htmlunit/html/package-info.java index f2fb04e7dea..6aed541c35d 100644 --- a/src/main/java/org/htmlunit/html/package-info.java +++ b/src/main/java/org/htmlunit/html/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/parser/HTMLParser.java b/src/main/java/org/htmlunit/html/parser/HTMLParser.java index 63da9984060..9df2e782538 100644 --- a/src/main/java/org/htmlunit/html/parser/HTMLParser.java +++ b/src/main/java/org/htmlunit/html/parser/HTMLParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ import java.io.IOException; import org.htmlunit.SgmlPage; +import org.htmlunit.WebClient; import org.htmlunit.WebResponse; import org.htmlunit.html.DomNode; import org.htmlunit.html.ElementFactory; @@ -75,12 +76,19 @@ ElementFactory getElementFactory(SgmlPage page, String namespaceURI, * @param source the (X)HTML to be parsed * @throws SAXException if a SAX error occurs * @throws IOException if an IO error occurs + * + * @deprecated as of version 4.12.0; use + * {@link #parseFragment(WebClient, DomNode, DomNode, String, boolean)} instead. */ - void parseFragment(DomNode parent, String source) throws SAXException, IOException; + @Deprecated + default void parseFragment(final DomNode parent, final String source) throws SAXException, IOException { + parseFragment(null, parent, parent, source, false); + } /** * Parses the HTML content from the given string into an object tree representation. * + * @param webClient the {@link WebClient} * @param parent where the new parsed nodes will be added to * @param context the context to build the fragment context stack * @param source the (X)HTML to be parsed @@ -88,9 +96,41 @@ ElementFactory getElementFactory(SgmlPage page, String namespaceURI, * @throws SAXException if a SAX error occurs * @throws IOException if an IO error occurs */ - void parseFragment(DomNode parent, DomNode context, String source, + void parseFragment(WebClient webClient, DomNode parent, DomNode context, String source, boolean createdByJavascript) throws SAXException, IOException; + /** + * Parses the HTML content from the given string into an object tree representation. + * + * @param parent where the new parsed nodes will be added to + * @param context the context to build the fragment context stack + * @param source the (X)HTML to be parsed + * @param createdByJavascript if true the (script) tag was created by javascript + * @throws SAXException if a SAX error occurs + * @throws IOException if an IO error occurs + * + * @deprecated as of version 4.12.0; use + * {@link #parseFragment(WebClient, DomNode, DomNode, String, boolean)} instead. + */ + @Deprecated + default void parseFragment(final DomNode parent, final DomNode context, final String source, + final boolean createdByJavascript) throws SAXException, IOException { + parseFragment(null, parent, context, source, createdByJavascript); + } + + /** + * Parses the WebResponse into an object tree representation. + * + * @param webClient the {@link WebClient} + * @param webResponse the response data + * @param page the HtmlPage to add the nodes + * @param xhtml if true use the XHtml parser + * @param createdByJavascript if true the (script) tag was created by javascript + * @throws IOException if there is an IO error + */ + void parse(WebClient webClient, WebResponse webResponse, HtmlPage page, + boolean xhtml, boolean createdByJavascript) throws IOException; + /** * Parses the WebResponse into an object tree representation. * @@ -99,6 +139,13 @@ void parseFragment(DomNode parent, DomNode context, String source, * @param xhtml if true use the XHtml parser * @param createdByJavascript if true the (script) tag was created by javascript * @throws IOException if there is an IO error + * + * @deprecated as of version 4.12.0; use + * {@link #parse(WebClient, WebResponse, HtmlPage, boolean, boolean)} instead. */ - void parse(WebResponse webResponse, HtmlPage page, boolean xhtml, boolean createdByJavascript) throws IOException; + @Deprecated + default void parse(final WebResponse webResponse, final HtmlPage page, final boolean xhtml, + final boolean createdByJavascript) throws IOException { + parse(null, webResponse, page, xhtml, createdByJavascript); + } } diff --git a/src/main/java/org/htmlunit/html/parser/HTMLParserDOMBuilder.java b/src/main/java/org/htmlunit/html/parser/HTMLParserDOMBuilder.java index f5adceaa6a8..c12143e4a9f 100644 --- a/src/main/java/org/htmlunit/html/parser/HTMLParserDOMBuilder.java +++ b/src/main/java/org/htmlunit/html/parser/HTMLParserDOMBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/parser/HTMLParserListener.java b/src/main/java/org/htmlunit/html/parser/HTMLParserListener.java index b941688e16d..0eb758ed0e6 100644 --- a/src/main/java/org/htmlunit/html/parser/HTMLParserListener.java +++ b/src/main/java/org/htmlunit/html/parser/HTMLParserListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoDOMBuilder.java b/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoDOMBuilder.java index 9e68ab12967..4241ac13949 100644 --- a/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoDOMBuilder.java +++ b/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoDOMBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,6 @@ import java.util.ArrayDeque; import java.util.Deque; -import org.apache.commons.lang3.ArrayUtils; import org.htmlunit.BrowserVersion; import org.htmlunit.ObjectInstantiationException; import org.htmlunit.WebClient; @@ -270,10 +269,6 @@ public void startElement(String namespaceURI, final String localName, final Stri headParsed_ = lastTagWasSynthesized_ ? HeadParsed.SYNTHESIZED : HeadParsed.YES; } - if (namespaceURI != null) { - namespaceURI = namespaceURI.trim(); - } - // If we're adding a body element, keep track of any temporary synthetic ones // that we may have had to create earlier (for document.write(), for example). HtmlBody oldBody = null; @@ -285,6 +280,9 @@ public void startElement(String namespaceURI, final String localName, final Stri } } + if (namespaceURI != null) { + namespaceURI = namespaceURI.trim(); + } // Add the new node. if (!(page_ instanceof XHtmlPage) && Html.XHTML_NAMESPACE.equals(namespaceURI)) { namespaceURI = null; @@ -295,6 +293,7 @@ public void startElement(String namespaceURI, final String localName, final Stri if (factory == HtmlUnitNekoHtmlParser.SVG_FACTORY) { namespaceURI = Html.SVG_NAMESPACE; } + final DomElement newElement = factory.createElementNS(page_, namespaceURI, qName, atts); newElement.setStartLocation(locator_.getLineNumber(), locator_.getColumnNumber()); @@ -310,7 +309,7 @@ else if (newElement instanceof HtmlTemplate) { // Forms own elements simply by enclosing source-wise rather than DOM parent-child relationship // Forms without a will keep consuming forever - if (newElement instanceof HtmlForm) { + else if (newElement instanceof HtmlForm) { consumingForm_ = (HtmlForm) newElement; formEndingIsAdjusting_ = false; } @@ -416,20 +415,28 @@ else if (newElement instanceof HtmlHiddenInput) { appendChild(currentNode, newElement); } - private DomNode findElementOnStack(final String... searchedElementNames) { - DomNode searchedNode = null; + private DomNode findElementOnStack(final String searchedElementName) { for (final DomNode node : stack_) { - if (ArrayUtils.contains(searchedElementNames, node.getNodeName())) { - searchedNode = node; - break; + if (searchedElementName.equals(node.getNodeName())) { + return node; } } - if (searchedNode == null) { - searchedNode = stack_.peek(); // this is surely wrong but at least it won't throw a NPE + // this is surely wrong but at least it won't throw a NPE + return stack_.peek(); + } + + private DomNode findElementOnStack(final String... searchedElementNames) { + for (final DomNode node : stack_) { + for (final String searchedElementName : searchedElementNames) { + if (searchedElementName.equals(node.getNodeName())) { + return node; + } + } } - return searchedNode; + // this is surely wrong but at least it won't throw a NPE + return stack_.peek(); } private static boolean isTableChild(final String nodeName) { @@ -541,24 +548,14 @@ private void handleCharacters() { if (org.apache.commons.lang3.StringUtils.isBlank(textValue)) { appendChild(currentNode_, new DomText(page_, textValue)); + return; } - else { - // malformed HTML: some text => text comes before the table - if (currentNode_ instanceof HtmlTableRow) { - final HtmlTableRow row = (HtmlTableRow) currentNode_; - final HtmlTable enclosingTable = row.getEnclosingTable(); - if (enclosingTable != null) { // may be null when called from Range.createContextualFragment - if (enclosingTable.getPreviousSibling() instanceof DomText) { - final DomText domText = (DomText) enclosingTable.getPreviousSibling(); - domText.setTextContent(domText.getWholeText() + textValue); - } - else { - enclosingTable.insertBefore(new DomText(page_, textValue)); - } - } - } - else if (currentNode_ instanceof HtmlTable) { - final HtmlTable enclosingTable = (HtmlTable) currentNode_; + + // malformed HTML: some text => text comes before the table + if (currentNode_ instanceof HtmlTableRow) { + final HtmlTableRow row = (HtmlTableRow) currentNode_; + final HtmlTable enclosingTable = row.getEnclosingTable(); + if (enclosingTable != null) { // may be null when called from Range.createContextualFragment if (enclosingTable.getPreviousSibling() instanceof DomText) { final DomText domText = (DomText) enclosingTable.getPreviousSibling(); domText.setTextContent(domText.getWholeText() + textValue); @@ -567,13 +564,23 @@ else if (currentNode_ instanceof HtmlTable) { enclosingTable.insertBefore(new DomText(page_, textValue)); } } - else if (currentNode_ instanceof HtmlImage) { - currentNode_.getParentNode().appendChild(new DomText(page_, textValue)); + } + else if (currentNode_ instanceof HtmlTable) { + final HtmlTable enclosingTable = (HtmlTable) currentNode_; + if (enclosingTable.getPreviousSibling() instanceof DomText) { + final DomText domText = (DomText) enclosingTable.getPreviousSibling(); + domText.setTextContent(domText.getWholeText() + textValue); } else { - appendChild(currentNode_, new DomText(page_, textValue)); + enclosingTable.insertBefore(new DomText(page_, textValue)); } } + else if (currentNode_ instanceof HtmlImage) { + currentNode_.getParentNode().appendChild(new DomText(page_, textValue)); + } + else { + appendChild(currentNode_, new DomText(page_, textValue)); + } } /** {@inheritDoc} */ diff --git a/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoHtmlParser.java b/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoHtmlParser.java index 74b464f2385..89e5d3fbea2 100644 --- a/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoHtmlParser.java +++ b/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoHtmlParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,14 +21,15 @@ import java.net.URL; import java.nio.charset.Charset; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import org.htmlunit.ObjectInstantiationException; import org.htmlunit.Page; import org.htmlunit.SgmlPage; import org.htmlunit.WebAssert; +import org.htmlunit.WebClient; import org.htmlunit.WebResponse; import org.htmlunit.cyberneko.HTMLScanner; import org.htmlunit.cyberneko.HTMLTagBalancer; @@ -73,7 +74,7 @@ public final class HtmlUnitNekoHtmlParser implements HTMLParser { */ public static final SvgElementFactory SVG_FACTORY = new SvgElementFactory(); - private static final Map ELEMENT_FACTORIES = new HashMap<>(); + private static final Map ELEMENT_FACTORIES = new ConcurrentHashMap<>(); static { final DefaultElementFactory defaultElementFactory = new DefaultElementFactory(); @@ -83,31 +84,11 @@ public final class HtmlUnitNekoHtmlParser implements HTMLParser { } /** - * Parses the HTML content from the given string into an object tree representation. - * - * @param parent the parent for the new nodes - * @param source the (X)HTML to be parsed - * @throws SAXException if a SAX error occurs - * @throws IOException if an IO error occurs - */ - @Override - public void parseFragment(final DomNode parent, final String source) throws SAXException, IOException { - parseFragment(parent, parent, source, false); - } - - /** - * Parses the HTML content from the given string into an object tree representation. - * - * @param parent where the new parsed nodes will be added to - * @param context the context to build the fragment context stack - * @param source the (X)HTML to be parsed - * @param createdByJavascript if true the (script) tag was created by javascript - * @throws SAXException if a SAX error occurs - * @throws IOException if an IO error occurs + * {@inheritDoc} */ @Override - public void parseFragment(final DomNode parent, final DomNode context, final String source, - final boolean createdByJavascript) + public void parseFragment(final WebClient webClient, final DomNode parent, final DomNode context, + final String source, final boolean createdByJavascript) throws SAXException, IOException { final Page page = parent.getPage(); if (!(page instanceof HtmlPage)) { @@ -153,16 +134,10 @@ else if (ancestors.size() == 1 } /** - * Parses the WebResponse into an object tree representation. - * - * @param webResponse the response data - * @param page the HtmlPage to add the nodes - * @param xhtml if true use the XHtml parser - * @param createdByJavascript if true the (script) tag was created by javascript - * @throws IOException if there is an IO error + * {@inheritDoc} */ @Override - public void parse(final WebResponse webResponse, final HtmlPage page, + public void parse(final WebClient webClient, final WebResponse webResponse, final HtmlPage page, final boolean xhtml, final boolean createdByJavascript) throws IOException { final URL url = webResponse.getWebRequest().getUrl(); final HtmlUnitNekoDOMBuilder domBuilder = @@ -182,6 +157,13 @@ public void parse(final WebResponse webResponse, final HtmlPage page, domBuilder.setFeature(HTMLScanner.STYLE_STRIP_CDATA_DELIMS, true); domBuilder.setFeature(HTMLScanner.CDATA_EARLY_CLOSING, false); } + + if (webClient != null) { + final int bufferSize = webClient.getOptions().getNekoReaderBufferSize(); + if (bufferSize > 0) { + domBuilder.setProperty(HTMLScanner.READER_BUFFER_SIZE, bufferSize); + } + } } catch (final Exception e) { throw new ObjectInstantiationException("Error setting HTML parser feature", e); @@ -315,7 +297,9 @@ class HtmlUnitNekoHTMLErrorHandler implements XMLErrorHandler { html_ = htmlContent; } - /** @see DefaultErrorHandler#error(String,String,XMLParseException) */ + /** + * @see DefaultErrorHandler#error(String,String,XMLParseException) + */ @Override public void error(final String domain, final String key, final XMLParseException exception) throws XNIException { @@ -327,7 +311,9 @@ public void error(final String domain, final String key, key); } - /** @see DefaultErrorHandler#warning(String,String,XMLParseException) */ + /** + * @see DefaultErrorHandler#warning(String,String,XMLParseException) + */ @Override public void warning(final String domain, final String key, final XMLParseException exception) throws XNIException { diff --git a/src/main/java/org/htmlunit/html/parser/neko/package-info.java b/src/main/java/org/htmlunit/html/parser/neko/package-info.java index 3ee2186e58e..2944fb2de07 100644 --- a/src/main/java/org/htmlunit/html/parser/neko/package-info.java +++ b/src/main/java/org/htmlunit/html/parser/neko/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/parser/package-info.java b/src/main/java/org/htmlunit/html/parser/package-info.java index 9d946ab60cc..53b21ca71ab 100644 --- a/src/main/java/org/htmlunit/html/parser/package-info.java +++ b/src/main/java/org/htmlunit/html/parser/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/serializer/HtmlSerializerInnerOuterText.java b/src/main/java/org/htmlunit/html/serializer/HtmlSerializerInnerOuterText.java index 2396e2593c4..3e919e6a3df 100644 --- a/src/main/java/org/htmlunit/html/serializer/HtmlSerializerInnerOuterText.java +++ b/src/main/java/org/htmlunit/html/serializer/HtmlSerializerInnerOuterText.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/serializer/HtmlSerializerNormalizedText.java b/src/main/java/org/htmlunit/html/serializer/HtmlSerializerNormalizedText.java index 35006258db1..9be60feb6dd 100644 --- a/src/main/java/org/htmlunit/html/serializer/HtmlSerializerNormalizedText.java +++ b/src/main/java/org/htmlunit/html/serializer/HtmlSerializerNormalizedText.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/serializer/HtmlSerializerVisibleText.java b/src/main/java/org/htmlunit/html/serializer/HtmlSerializerVisibleText.java index 635a3f33d93..435a3d22201 100644 --- a/src/main/java/org/htmlunit/html/serializer/HtmlSerializerVisibleText.java +++ b/src/main/java/org/htmlunit/html/serializer/HtmlSerializerVisibleText.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -512,9 +512,7 @@ protected void appendSelect(final HtmlSerializerTextBuilder builder, */ protected void appendOption(final HtmlSerializerTextBuilder builder, final HtmlOption htmlOption, final Mode mode) { - builder.ignoreHtmlBreaks(); appendChildren(builder, htmlOption, mode); - builder.processHtmlBreaks(); } /** @@ -787,7 +785,6 @@ private enum State { private final StringBuilder builder_; private int trimRightPos_; private boolean contentAdded_; - private boolean ignoreHtmlBreaks_; /** * Ctor. @@ -985,10 +982,6 @@ public void appendBlockSeparator() { * @param mode the {@link Mode} */ public void appendBreak(final Mode mode) { - if (ignoreHtmlBreaks_) { - return; - } - builder_.setLength(trimRightPos_); builder_.append('\n'); @@ -1046,20 +1039,6 @@ public void resetContentAdded() { contentAdded_ = false; } - /** - * Ignore the following html breaks in the content to be added. - */ - public void ignoreHtmlBreaks() { - ignoreHtmlBreaks_ = true; - } - - /** - * Prozess the following html breaks in the content to be added. - */ - public void processHtmlBreaks() { - ignoreHtmlBreaks_ = false; - } - /** * @return the constructed text. */ diff --git a/src/main/java/org/htmlunit/html/serializer/package-info.java b/src/main/java/org/htmlunit/html/serializer/package-info.java index 040d6ac6e07..bf893024405 100644 --- a/src/main/java/org/htmlunit/html/serializer/package-info.java +++ b/src/main/java/org/htmlunit/html/serializer/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/xpath/HtmlUnitPrefixResolver.java b/src/main/java/org/htmlunit/html/xpath/HtmlUnitPrefixResolver.java index 46fe6e3feda..824f7a3d240 100644 --- a/src/main/java/org/htmlunit/html/xpath/HtmlUnitPrefixResolver.java +++ b/src/main/java/org/htmlunit/html/xpath/HtmlUnitPrefixResolver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/html/xpath/XPathAdapter.java b/src/main/java/org/htmlunit/html/xpath/XPathAdapter.java index cf0b7497e3e..203c0cc72da 100644 --- a/src/main/java/org/htmlunit/html/xpath/XPathAdapter.java +++ b/src/main/java/org/htmlunit/html/xpath/XPathAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,14 +45,6 @@ private enum STATE { } private final Expression mainExp_; - private FunctionTable funcTable_; - - /** - * Initiates the function table. - */ - private void initFunctionTable() { - funcTable_ = new FunctionTable(); - } /** * Constructor. @@ -64,11 +56,9 @@ private void initFunctionTable() { public XPathAdapter(final String exprString, final PrefixResolver prefixResolver, final boolean caseSensitive) throws TransformerException { - initFunctionTable(); - final ErrorListener errorHandler = new DefaultErrorHandler(); final XPathParser parser = new XPathParser(errorHandler); - final Compiler compiler = new Compiler(errorHandler, funcTable_); + final Compiler compiler = new Compiler(errorHandler, new FunctionTable()); final String expression = preProcessXPath(exprString, caseSensitive); parser.initXPath(compiler, expression, prefixResolver); diff --git a/src/main/java/org/htmlunit/html/xpath/XPathHelper.java b/src/main/java/org/htmlunit/html/xpath/XPathHelper.java index cd608257e39..881058edc74 100644 --- a/src/main/java/org/htmlunit/html/xpath/XPathHelper.java +++ b/src/main/java/org/htmlunit/html/xpath/XPathHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -92,6 +92,14 @@ public static List getByXPath(final DomNode contextNode, final String xpa } } + /** + * @param the type of nodes expected + * @param node the start node + * @param xpath the {@link XPathAdapter} to search for + * @param prefixResolver the {@link PrefixResolver} to be used + * @return a list of nodes matching the given xpath + * @throws TransformerException in case of error + */ public static List getByXPath(final Node node, final XPathAdapter xpath, final PrefixResolver prefixResolver) throws TransformerException { final List list = new ArrayList<>(); @@ -104,7 +112,8 @@ public static List getByXPath(final Node node, final XPathAdapter xpath, if (result instanceof XNodeSet) { final NodeList nodelist = result.nodelist(); - for (int i = 0; i < nodelist.getLength(); i++) { + final int length = nodelist.getLength(); + for (int i = 0; i < length; i++) { list.add((T) nodelist.item(i)); } } diff --git a/src/main/java/org/htmlunit/html/xpath/package-info.java b/src/main/java/org/htmlunit/html/xpath/package-info.java index 74e1b478cc0..e399cdcf4ab 100644 --- a/src/main/java/org/htmlunit/html/xpath/package-info.java +++ b/src/main/java/org/htmlunit/html/xpath/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/http/HttpStatus.java b/src/main/java/org/htmlunit/http/HttpStatus.java index 1533561f77d..436141565eb 100644 --- a/src/main/java/org/htmlunit/http/HttpStatus.java +++ b/src/main/java/org/htmlunit/http/HttpStatus.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/http/HttpUtils.java b/src/main/java/org/htmlunit/http/HttpUtils.java index fa6cf9de713..34d357f9c2b 100644 --- a/src/main/java/org/htmlunit/http/HttpUtils.java +++ b/src/main/java/org/htmlunit/http/HttpUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -293,7 +293,7 @@ private HttpUtils() { * @param buf buffer with the sequence of chars to be parsed * @param range defines the bounds and current position of the buffer * @param delimiters set of delimiting characters. Can be {@code null} if the token - * is not delimited by any character. + * is not delimited by any character. */ private static String parseToken(final String buf, final ParseRange range, final BitSet delimiters) { final StringBuilder dst = new StringBuilder(); @@ -345,7 +345,7 @@ private static void skipWhiteSpace(final String buf, final ParseRange range) { * @param buf buffer with the sequence of chars to be parsed * @param range defines the bounds and current position of the buffer * @param delimiters set of delimiting characters. Can be {@code null} if the value - * is delimited by a whitespace only. + * is delimited by a whitespace only. * @param dst destination buffer */ private static void copyContent(final String buf, final ParseRange range, diff --git a/src/main/java/org/htmlunit/http/package-info.java b/src/main/java/org/htmlunit/http/package-info.java index 58526dc5f98..b9e197f8bc5 100644 --- a/src/main/java/org/htmlunit/http/package-info.java +++ b/src/main/java/org/htmlunit/http/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/httpclient/HtmlUnitBrowserCompatCookieHeaderValueFormatter.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitBrowserCompatCookieHeaderValueFormatter.java index 89718701242..0b0e8b2eac4 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitBrowserCompatCookieHeaderValueFormatter.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitBrowserCompatCookieHeaderValueFormatter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/httpclient/HtmlUnitBrowserCompatCookieSpec.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitBrowserCompatCookieSpec.java index 77ca3918c30..fce1220057f 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitBrowserCompatCookieSpec.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitBrowserCompatCookieSpec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -223,7 +223,8 @@ public List

formatCookies(final List cookies) { final CharArrayBuffer buffer = new CharArrayBuffer(20 * cookies.size()); buffer.append(SM.COOKIE); buffer.append(": "); - for (int i = 0; i < cookies.size(); i++) { + final int size = cookies.size(); + for (int i = 0; i < size; i++) { final Cookie cookie = cookies.get(i); if (i > 0) { buffer.append("; "); diff --git a/src/main/java/org/htmlunit/httpclient/HtmlUnitCookieSpecProvider.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitCookieSpecProvider.java index 41063f6e0d6..35b6a5bce37 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitCookieSpecProvider.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitCookieSpecProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/httpclient/HtmlUnitCookieStore.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitCookieStore.java index 79cdac2a5d4..dd371bb1f70 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitCookieStore.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitCookieStore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/httpclient/HtmlUnitDomainHandler.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitDomainHandler.java index b8d0c0c8cbc..9340bdd8a0d 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitDomainHandler.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitDomainHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/httpclient/HtmlUnitExpiresHandler.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitExpiresHandler.java index b23bc40a79a..733632c4e33 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitExpiresHandler.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitExpiresHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/httpclient/HtmlUnitHttpOnlyHandler.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitHttpOnlyHandler.java index b4cd18ca563..ea38eba236c 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitHttpOnlyHandler.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitHttpOnlyHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/httpclient/HtmlUnitMaxAgeHandler.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitMaxAgeHandler.java index 063819cd62e..c49d93eb27f 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitMaxAgeHandler.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitMaxAgeHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/httpclient/HtmlUnitPathHandler.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitPathHandler.java index 40773ec4676..ec1385557a1 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitPathHandler.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitPathHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/httpclient/HtmlUnitRedirectStrategie.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitRedirectStrategie.java index 24bbed61091..48f930f9f83 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitRedirectStrategie.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitRedirectStrategie.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/httpclient/HtmlUnitSSLConnectionSocketFactory.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitSSLConnectionSocketFactory.java index 6fab8d69698..b98582cc863 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitSSLConnectionSocketFactory.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitSSLConnectionSocketFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/httpclient/HtmlUnitSameSiteHandler.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitSameSiteHandler.java index 3123dadca5f..f9fb0fe5485 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitSameSiteHandler.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitSameSiteHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/httpclient/HtmlUnitSecureHandler.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitSecureHandler.java index beda0515837..dfd8e8055f4 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitSecureHandler.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitSecureHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/httpclient/HtmlUnitUsernamePasswordCredentials.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitUsernamePasswordCredentials.java index 4502bcbc49d..a4095db56b1 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitUsernamePasswordCredentials.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitUsernamePasswordCredentials.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/httpclient/HtmlUnitVersionAttributeHandler.java b/src/main/java/org/htmlunit/httpclient/HtmlUnitVersionAttributeHandler.java index 5026a3a8626..4fc36c0f1ed 100644 --- a/src/main/java/org/htmlunit/httpclient/HtmlUnitVersionAttributeHandler.java +++ b/src/main/java/org/htmlunit/httpclient/HtmlUnitVersionAttributeHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/httpclient/HttpClientConverter.java b/src/main/java/org/htmlunit/httpclient/HttpClientConverter.java index 45b626c082b..9a7a9562f26 100644 --- a/src/main/java/org/htmlunit/httpclient/HttpClientConverter.java +++ b/src/main/java/org/htmlunit/httpclient/HttpClientConverter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,16 +16,12 @@ import java.net.MalformedURLException; import java.net.URL; -import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Collection; -import java.util.Date; import java.util.List; import java.util.Set; import org.apache.http.NoHttpResponseException; -import org.apache.http.client.utils.DateUtils; -import org.apache.http.client.utils.URLEncodedUtils; import org.apache.http.cookie.ClientCookie; import org.apache.http.cookie.Cookie; import org.apache.http.cookie.CookieOrigin; @@ -35,8 +31,6 @@ import org.apache.http.message.BufferedHeader; import org.apache.http.util.CharArrayBuffer; import org.htmlunit.BrowserVersion; -import org.htmlunit.http.HttpStatus; -import org.htmlunit.http.HttpUtils; import org.htmlunit.util.NameValuePair; import org.htmlunit.util.UrlUtils; @@ -47,84 +41,6 @@ */ public final class HttpClientConverter { - /** Forwarder to HttpStatus.SC_OK. - * @deprecated as of version 4.1.0; use {@link HttpStatus#OK_200} instead - */ - @Deprecated - public static final int OK = org.apache.http.HttpStatus.SC_OK; - - /** Forwarder to HttpStatus.SC_NO_CONTENT. - * @deprecated as of version 4.1.0; use {@link HttpStatus#NO_CONTENT_204} instead - */ - @Deprecated - public static final int NO_CONTENT = org.apache.http.HttpStatus.SC_NO_CONTENT; - - /** Forwarder to HttpStatus.MULTIPLE_CHOICES. - * @deprecated as of version 4.1.0; use {@link HttpStatus#MULTIPLE_CHOICES_300} instead - */ - @Deprecated - public static final int MULTIPLE_CHOICES = org.apache.http.HttpStatus.SC_MULTIPLE_CHOICES; - - /** Forwarder to HttpStatus.MOVED_PERMANENTLY. - * @deprecated as of version 4.1.0; use {@link HttpStatus#MOVED_PERMANENTLY_301} instead - */ - @Deprecated - public static final int MOVED_PERMANENTLY = org.apache.http.HttpStatus.SC_MOVED_PERMANENTLY; - - /** Forwarder to HttpStatus.MOVED_TEMPORARILY. - * @deprecated as of version 4.1.0; use {@link HttpStatus#FOUND_302} instead - */ - @Deprecated - public static final int MOVED_TEMPORARILY = org.apache.http.HttpStatus.SC_MOVED_TEMPORARILY; - - /** Forwarder to HttpStatus.SEE_OTHER. - * @deprecated as of version 4.1.0; use {@link HttpStatus#SEE_OTHER_303} instead - */ - @Deprecated - public static final int SEE_OTHER = org.apache.http.HttpStatus.SC_SEE_OTHER; - - /** Forwarder to HttpStatus.TEMPORARY_REDIRECT. - * @deprecated as of version 4.1.0; use {@link HttpStatus#TEMPORARY_REDIRECT_307} instead - */ - @Deprecated - public static final int TEMPORARY_REDIRECT = org.apache.http.HttpStatus.SC_TEMPORARY_REDIRECT; - - /** 308. - * @deprecated as of version 4.1.0; use {@link HttpStatus#PERMANENT_REDIRECT_308} instead - */ - @Deprecated - public static final int PERMANENT_REDIRECT = 308; - - /** Forwarder to HttpStatus.NOT_MODIFIED. - * @deprecated as of version 4.1.0; use {@link HttpStatus#NOT_MODIFIED_304} instead - */ - @Deprecated - public static final int NOT_MODIFIED = org.apache.http.HttpStatus.SC_NOT_MODIFIED; - - /** Forwarder to HttpStatus.SC_USE_PROXY. - * @deprecated as of version 4.1.0; use {@link HttpStatus#USE_PROXY_305} instead - */ - @Deprecated - public static final int USE_PROXY = org.apache.http.HttpStatus.SC_USE_PROXY; - - /** Forwarder to HttpStatus.SC_FORBIDDEN. - * @deprecated as of version 4.1.0; use {@link HttpStatus#FORBIDDEN_403} instead - */ - @Deprecated - public static final int FORBIDDEN = org.apache.http.HttpStatus.SC_FORBIDDEN; - - /** Forwarder to HttpStatus.SC_NOT_FOUND. - * @deprecated as of version 4.1.0; use {@link HttpStatus#NOT_FOUND_404} instead - */ - @Deprecated - public static final int NOT_FOUND = org.apache.http.HttpStatus.SC_NOT_FOUND; - - /** Forwarder to HttpStatus.SC_INTERNAL_SERVER_ERROR. - * @deprecated as of version 4.1.0; use {@link HttpStatus#INTERNAL_SERVER_ERROR_500} instead - */ - @Deprecated - public static final int INTERNAL_SERVER_ERROR = org.apache.http.HttpStatus.SC_INTERNAL_SERVER_ERROR; - private HttpClientConverter() { // util class } @@ -142,67 +58,6 @@ public static List nameValuePairsToHttpClient(fin return resultingPairs; } - /** - * Parses url query into name/value pairs using methods from HttpClient. - * @param query the urlencoded query - * @param charset the charset or null (defaulting to utf-8) - * @return the name/value pairs - * - * @deprecated as of version 4.1.0; use {@link HttpUtils#parseUrlQuery(String, Charset)} instead - */ - @Deprecated - public static List parseUrlQuery(final String query, final Charset charset) { - final List pairs = URLEncodedUtils.parse(query, charset); - - final List resultingPairs = new ArrayList<>(); - for (final org.apache.http.NameValuePair pair : pairs) { - resultingPairs.add(new NameValuePair(pair.getName(), pair.getValue())); - } - return resultingPairs; - } - - /** - * @param parameters the paramters - * @param enc the charset - * @return the query string from the given parameters - * - * @deprecated as of version 4.1.0; use {@link HttpUtils#toQueryFormFields(Iterable, Charset)} instead - */ - @Deprecated - public static String toQueryFormFields(final List parameters, final Charset enc) { - return URLEncodedUtils.format(nameValuePairsToHttpClient(parameters), enc); - } - - /** - * Parses the specified date string, assuming that it is formatted according to RFC 1123, RFC 1036 or as an ANSI - * C HTTP date header. This method returns {@code null} if the specified string is {@code null} or unparseable. - * - * @param s the string to parse as a date - * @return the date version of the specified string, or {@code null} - * - * @deprecated as of version 4.1.0; use {@link HttpUtils#parseDate(String)} instead - */ - @Deprecated - public static Date parseHttpDate(final String s) { - if (s == null) { - return null; - } - return DateUtils.parseDate(s); - } - - /** - * Formats the given date according to the RFC 1123 pattern. - * - * @param date The date to format. - * @return An RFC 1123 formatted date string. - * - * @deprecated as of version 4.1.0; use {@link HttpUtils#parseDate(String)} instead - */ - @Deprecated - public static String formatDate(final Date date) { - return DateUtils.formatDate(date); - } - /** * @param e the exception to check * @return true if the provided Exception is na {@link NoHttpResponseException} @@ -254,6 +109,13 @@ public static URL replaceForCookieIfNecessary(URL url) { return url; } + /** + * @param cookieString the string to parse + * @param pageUrl the page url as root + * @param browserVersion the {@link BrowserVersion} + * @return a list of {@link org.htmlunit.util.Cookie}'s + * @throws MalformedCookieException in case the cookie does not conform to the spec + */ public static List parseCookie(final String cookieString, final URL pageUrl, final BrowserVersion browserVersion) throws MalformedCookieException { @@ -298,6 +160,13 @@ public static List fromHttpClient(final List c return list; } + /** + * Adds all matching cookies to the provided set. + * @param cookies the cookies to select from + * @param normalizedUrl the url to match against + * @param browserVersion the {@link BrowserVersion} + * @param matches the set to add + */ public static void addMatching(final Set cookies, final URL normalizedUrl, final BrowserVersion browserVersion, final Set matches) { diff --git a/src/main/java/org/htmlunit/httpclient/HttpDelete.java b/src/main/java/org/htmlunit/httpclient/HttpDelete.java index 5463dfb1743..3f9d2a671d5 100644 --- a/src/main/java/org/htmlunit/httpclient/HttpDelete.java +++ b/src/main/java/org/htmlunit/httpclient/HttpDelete.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,10 +25,17 @@ */ public class HttpDelete extends HttpEntityEnclosingRequestBase { + /** + * Ctor. + */ public HttpDelete() { super(); } + /** + * Ctor. + * @param uri the uri + */ public HttpDelete(final URI uri) { super(); setURI(uri); diff --git a/src/main/java/org/htmlunit/httpclient/HttpOptions.java b/src/main/java/org/htmlunit/httpclient/HttpOptions.java index 723fa53afa3..0b643b8ac96 100644 --- a/src/main/java/org/htmlunit/httpclient/HttpOptions.java +++ b/src/main/java/org/htmlunit/httpclient/HttpOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,10 +25,17 @@ */ public class HttpOptions extends HttpEntityEnclosingRequestBase { + /** + * Ctor. + */ public HttpOptions() { super(); } + /** + * Ctor. + * @param uri the uri + */ public HttpOptions(final URI uri) { super(); setURI(uri); diff --git a/src/main/java/org/htmlunit/httpclient/SocksConnectionSocketFactory.java b/src/main/java/org/htmlunit/httpclient/SocksConnectionSocketFactory.java index 0821abd4099..e71a68a4383 100644 --- a/src/main/java/org/htmlunit/httpclient/SocksConnectionSocketFactory.java +++ b/src/main/java/org/htmlunit/httpclient/SocksConnectionSocketFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/httpclient/package-info.java b/src/main/java/org/htmlunit/httpclient/package-info.java index 6ecc919c21c..a2147c5928d 100644 --- a/src/main/java/org/htmlunit/httpclient/package-info.java +++ b/src/main/java/org/htmlunit/httpclient/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/javascript/AbstractJavaScriptEngine.java b/src/main/java/org/htmlunit/javascript/AbstractJavaScriptEngine.java index 1a36e9ecbc4..29a558c6080 100644 --- a/src/main/java/org/htmlunit/javascript/AbstractJavaScriptEngine.java +++ b/src/main/java/org/htmlunit/javascript/AbstractJavaScriptEngine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/javascript/DebugFrameAdapter.java b/src/main/java/org/htmlunit/javascript/DebugFrameAdapter.java index 9322c33abd4..99bbe72727a 100644 --- a/src/main/java/org/htmlunit/javascript/DebugFrameAdapter.java +++ b/src/main/java/org/htmlunit/javascript/DebugFrameAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/javascript/DebugFrameImpl.java b/src/main/java/org/htmlunit/javascript/DebugFrameImpl.java index a67a6441683..dbfa9d33993 100644 --- a/src/main/java/org/htmlunit/javascript/DebugFrameImpl.java +++ b/src/main/java/org/htmlunit/javascript/DebugFrameImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/javascript/DebuggerAdapter.java b/src/main/java/org/htmlunit/javascript/DebuggerAdapter.java index 7d53f77c97a..f1434b77ec0 100644 --- a/src/main/java/org/htmlunit/javascript/DebuggerAdapter.java +++ b/src/main/java/org/htmlunit/javascript/DebuggerAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/javascript/DebuggerImpl.java b/src/main/java/org/htmlunit/javascript/DebuggerImpl.java index 716a619eb0c..ef35f99e8b0 100644 --- a/src/main/java/org/htmlunit/javascript/DebuggerImpl.java +++ b/src/main/java/org/htmlunit/javascript/DebuggerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/javascript/DefaultJavaScriptErrorListener.java b/src/main/java/org/htmlunit/javascript/DefaultJavaScriptErrorListener.java index 9dff512805d..10124fabc8d 100644 --- a/src/main/java/org/htmlunit/javascript/DefaultJavaScriptErrorListener.java +++ b/src/main/java/org/htmlunit/javascript/DefaultJavaScriptErrorListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/javascript/FunctionWrapper.java b/src/main/java/org/htmlunit/javascript/FunctionWrapper.java index 87f4e699086..0313778f880 100644 --- a/src/main/java/org/htmlunit/javascript/FunctionWrapper.java +++ b/src/main/java/org/htmlunit/javascript/FunctionWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/javascript/HtmlUnitContextFactory.java b/src/main/java/org/htmlunit/javascript/HtmlUnitContextFactory.java index e13a903f9a0..1926f59b5e2 100644 --- a/src/main/java/org/htmlunit/javascript/HtmlUnitContextFactory.java +++ b/src/main/java/org/htmlunit/javascript/HtmlUnitContextFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,12 +18,14 @@ import static org.htmlunit.BrowserVersionFeatures.JS_PROPERTY_DESCRIPTOR_NAME; import java.io.Serializable; +import java.util.function.Consumer; import org.htmlunit.BrowserVersion; import org.htmlunit.ScriptException; import org.htmlunit.ScriptPreProcessor; import org.htmlunit.WebClient; import org.htmlunit.corejs.javascript.Callable; +import org.htmlunit.corejs.javascript.CompilerEnvirons; import org.htmlunit.corejs.javascript.Context; import org.htmlunit.corejs.javascript.ContextAction; import org.htmlunit.corejs.javascript.ContextFactory; @@ -32,12 +34,10 @@ import org.htmlunit.corejs.javascript.EvaluatorException; import org.htmlunit.corejs.javascript.Function; import org.htmlunit.corejs.javascript.Script; -import org.htmlunit.corejs.javascript.ScriptRuntime; import org.htmlunit.corejs.javascript.Scriptable; import org.htmlunit.corejs.javascript.debug.Debugger; import org.htmlunit.html.HtmlElement; import org.htmlunit.html.HtmlPage; -import org.htmlunit.javascript.regexp.HtmlUnitRegExpProxy; /** * ContextFactory that supports termination of scripts if they exceed a timeout. Based on example from @@ -156,7 +156,8 @@ public void terminateScriptIfNecessary() { @Override protected Script compileString(String source, final Evaluator compiler, final ErrorReporter compilationErrorReporter, final String sourceName, - final int lineno, final Object securityDomain) { + final int lineno, final Object securityDomain, + final Consumer compilerEnvironsProcessor) { // this method gets called by Context.compileString and by ScriptRuntime.evalSpecial // which is used for window.eval. We have to take care in which case we are. @@ -192,7 +193,7 @@ protected Script compileString(String source, final Evaluator compiler, source = preProcess(page, source, sourceName, lineno, null); return super.compileString(source, compiler, compilationErrorReporter, - sourceName, lineno, securityDomain); + sourceName, lineno, securityDomain, compilerEnvironsProcessor); } @Override @@ -252,7 +253,7 @@ protected Context makeContext() { cx.setClassShutter(fullClassName -> false); // Use pure interpreter mode to get observeInstructionCount() callbacks. - cx.setOptimizationLevel(-1); + cx.setInterpretedMode(true); // Set threshold on how often we want to receive the callbacks cx.setInstructionObserverThreshold(INSTRUCTION_COUNT_THRESHOLD); @@ -265,9 +266,6 @@ protected Context makeContext() { cx.setDebugger(debugger_, null); } - // register custom RegExp processing - ScriptRuntime.setRegExpProxy(cx, new HtmlUnitRegExpProxy(ScriptRuntime.getRegExpProxy(cx))); - cx.setMaximumInterpreterStackDepth(5_000); return cx; @@ -341,8 +339,6 @@ protected boolean hasFeature(final Context cx, final int featureIndex) { return true; case Context.FEATURE_HTMLUNIT_FN_ARGUMENTS_IS_RO_VIEW: return true; - case Context.FEATURE_HTMLUNIT_FUNCTION_DECLARED_FORWARD_IN_BLOCK: - return true; case Context.FEATURE_HTMLUNIT_MEMBERBOX_NAME: return browserVersion_.hasFeature(JS_PROPERTY_DESCRIPTOR_NAME); case Context.FEATURE_HTMLUNIT_ARRAY_SORT_COMPERATOR_ACCEPTS_BOOL: diff --git a/src/main/java/org/htmlunit/javascript/HtmlUnitScriptable.java b/src/main/java/org/htmlunit/javascript/HtmlUnitScriptable.java index f7eba4f944c..608f982b3e0 100644 --- a/src/main/java/org/htmlunit/javascript/HtmlUnitScriptable.java +++ b/src/main/java/org/htmlunit/javascript/HtmlUnitScriptable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -109,7 +109,7 @@ public void put(final String name, final Scriptable start, final Object value) { } catch (final IllegalArgumentException e) { // is it the right place or should Rhino throw a RuntimeError instead of an IllegalArgumentException? - throw JavaScriptEngine.reportRuntimeError("'set " + throw JavaScriptEngine.typeError("'set " + name + "' called on an object that does not implement interface " + getClassName()); } } @@ -117,22 +117,17 @@ public void put(final String name, final Scriptable start, final Object value) { /** * Gets a named property from the object. * Normally HtmlUnit objects don't need to overwrite this method as properties are defined - * on the prototypes from the XML configuration. In some cases where "content" of object + * on the prototypes. In some cases where "content" of object * has priority compared to the properties consider using utility {@link #getWithPreemption(String)}. + * * {@inheritDoc} */ @Override public Object get(final String name, final Scriptable start) { // Try to get property configured on object itself. - Object response = super.get(name, start); - if (response != NOT_FOUND) { - return response; - } - if (this == start) { - response = getWithPreemption(name); - } - if (response == NOT_FOUND && start instanceof Window) { - response = ((Window) start).getWithFallback(name); + final Object response = super.get(name, start); + if (response == NOT_FOUND && this == start) { + return getWithPreemption(name); } return response; } diff --git a/src/main/java/org/htmlunit/javascript/HtmlUnitScriptableProxy.java b/src/main/java/org/htmlunit/javascript/HtmlUnitScriptableProxy.java index 32bb6a37384..60d3bb07e29 100644 --- a/src/main/java/org/htmlunit/javascript/HtmlUnitScriptableProxy.java +++ b/src/main/java/org/htmlunit/javascript/HtmlUnitScriptableProxy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/htmlunit/javascript/JavaScriptEngine.java b/src/main/java/org/htmlunit/javascript/JavaScriptEngine.java index 87cb90feb54..3c941bfef46 100644 --- a/src/main/java/org/htmlunit/javascript/JavaScriptEngine.java +++ b/src/main/java/org/htmlunit/javascript/JavaScriptEngine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +46,6 @@ import org.htmlunit.corejs.javascript.EcmaError; import org.htmlunit.corejs.javascript.Function; import org.htmlunit.corejs.javascript.FunctionObject; -import org.htmlunit.corejs.javascript.Interpreter; import org.htmlunit.corejs.javascript.JavaScriptException; import org.htmlunit.corejs.javascript.NativeArray; import org.htmlunit.corejs.javascript.NativeArrayIterator; @@ -104,7 +103,7 @@ * @author Sven Strickroth * * @see - * Rhino and Java Browser + * Rhino and Java Browser */ public class JavaScriptEngine implements AbstractJavaScriptEngine\n" + "\n" @@ -220,8 +209,7 @@ public void acceptHeaderJavascript() throws Exception { @Test @Alerts("Accept: */*") public void acceptHeaderJavascriptWithoutType() throws Exception { - final String html - = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + " \n" + "\n" @@ -240,8 +228,7 @@ public void acceptHeaderJavascriptWithoutType() throws Exception { @Test @Alerts("Accept: text/css,*/*;q=0.1") public void acceptHeaderCssWithoutType() throws Exception { - final String html - = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + " \n" + "\n" + "\n" + "\n" + "to page 2\n" + ""; - final String content2 = "page 2\n" + final String content2 = DOCTYPE_HTML + + "page 2\n" + "\n" + "\n" + "to page 1\n" @@ -235,11 +261,12 @@ public void usage() throws Exception { } /** - *@throws Exception if the test fails + * @throws Exception if the test fails */ @Test public void jsUrlEncoded() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + " page 1\n" + " \n" @@ -250,7 +277,8 @@ public void jsUrlEncoded() throws Exception { + "\n" + ""; - final String content2 = "\n" + final String content2 = DOCTYPE_HTML + + "\n" + "\n" + " page 2\n" + " \n" @@ -292,11 +320,12 @@ public void jsUrlEncoded() throws Exception { } /** - *@throws Exception if the test fails + * @throws Exception if the test fails */ @Test public void cssUrlEncoded() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + " page 1\n" + " \n" @@ -315,7 +344,8 @@ public void cssUrlEncoded() throws Exception { + "\n" + ""; - final String content2 = "\n" + final String content2 = DOCTYPE_HTML + + "\n" + "\n" + " page 2\n" + " \n" @@ -362,11 +392,12 @@ public void cssUrlEncoded() throws Exception { } /** - *@throws Exception if the test fails + * @throws Exception if the test fails */ @Test public void maxSizeMaintained() throws Exception { - final String html = "page 1\n" + final String html = DOCTYPE_HTML + + "page 1\n" + "\n" + "\n" + ""; @@ -581,7 +584,8 @@ public void domainDuplicateLeadingDot() throws Exception { */ @Test public void domainDuplicateLeadingDotSend() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "next page\n" + ""; @@ -608,7 +612,8 @@ public void domainDuplicateLeadingDotSend() throws Exception { */ @Test public void domainDuplicateLeadingDotRedirect() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "next page\n" + ""; @@ -647,7 +652,8 @@ public void domain2() throws Exception { responseHeader1.add(new NameValuePair("Set-Cookie", "c4=4; Domain=" + DOMAIN + "; Path=/")); responseHeader1.add(new NameValuePair("Set-Cookie", "c5=5; Domain=.org; Path=/")); - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "

Cookie Domain Test

\n" @@ -678,7 +684,8 @@ public void domain3() throws Exception { responseHeader1.add(new NameValuePair("Set-Cookie", "c4=4; Domain=" + DOMAIN + "; Path=/")); responseHeader1.add(new NameValuePair("Set-Cookie", "c5=5; Domain=.org; Path=/")); - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "

Cookie Domain Test

\n" @@ -705,7 +712,8 @@ public void differentHostsSameDomain() throws Exception { final List responseHeader1 = new ArrayList<>(); responseHeader1.add(new NameValuePair("Set-Cookie", "cross-domain=1; Domain=." + DOMAIN + "; Path=/")); - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "

Cookie Domain Test

\n" @@ -729,7 +737,8 @@ public void differentHostsSameDomain() throws Exception { @Test @Alerts("cross-domain=1") public void differentHostsSameDomainCookieFromJS() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -755,7 +764,8 @@ public void differentHostsSameDomainCookieFromJS() throws Exception { @Test @Alerts("cross-domain=1") public void differentHostsSameDomainCookieFromMeta() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" @@ -947,7 +957,7 @@ public void sameSiteIncludeFromSameDomain() throws Exception { responseHeader.add(new NameValuePair("Set-Cookie", "c4=empty; SameSite=")); responseHeader.add(new NameValuePair("Set-Cookie", "c5=unknown; SameSite=unknown")); - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + " \n" + "\n" @@ -1002,7 +1012,7 @@ public void sameSiteIncludeFromSubDomain() throws Exception { responseHeader.add(new NameValuePair("Set-Cookie", "c4=empty; SameSite=")); responseHeader.add(new NameValuePair("Set-Cookie", "c5=unknown; SameSite=unknown")); - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + " \n" + "\n" @@ -1057,7 +1067,7 @@ public void sameSiteIFrameFromSameDomain() throws Exception { responseHeader.add(new NameValuePair("Set-Cookie", "c4=empty; SameSite=")); responseHeader.add(new NameValuePair("Set-Cookie", "c5=unknown; SameSite=unknown")); - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -1112,7 +1122,7 @@ public void sameSiteIFrameFromSubDomain() throws Exception { responseHeader.add(new NameValuePair("Set-Cookie", "c4=empty; SameSite=")); responseHeader.add(new NameValuePair("Set-Cookie", "c5=unknown; SameSite=unknown")); - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -1151,4 +1161,57 @@ public void sameSiteIFrameFromSubDomain() throws Exception { assertEquals("unknown", mgr.getCookie("c5").getSameSite()); } } + + /** + * Test for issue #270. + * @throws Exception in case of error + */ + @Test + @Alerts("JDSessionID=1234567890") + public void issue270() throws Exception { + final List responseHeader1 = new ArrayList<>(); + responseHeader1.add(new NameValuePair("Set-Cookie", "first=1; path=/c")); + + final String html = DOCTYPE_HTML + + "\n" + + "\n" + + "\n" + + ""; + + final URL firstUrl = new URL(URL_HOST1); + getMockWebConnection().setResponse(firstUrl, html); + loadPage2(html, firstUrl); + + loadPage2(HTML_ALERT_COOKIE, firstUrl); + verifyTitle2(getWebDriver(), getExpectedAlerts()); + } + + @Override + protected final WebDriver getWebDriver() { + final WebDriver driver = super.getWebDriver(); + if (driver instanceof HtmlUnitDriver) { + // set timeout to fail fast when the url not mapped + ((HtmlUnitDriver) driver).getWebClient().getOptions().setTimeout(1000); + } + + return driver; + } } diff --git a/src/test/java/org/htmlunit/CookieManager5Test.java b/src/test/java/org/htmlunit/CookieManager5Test.java index 79f49ea6873..17b22161bb0 100644 --- a/src/test/java/org/htmlunit/CookieManager5Test.java +++ b/src/test/java/org/htmlunit/CookieManager5Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,22 +27,21 @@ import javax.servlet.http.HttpServletResponse; import org.apache.http.client.utils.DateUtils; -import org.htmlunit.html.HtmlPageTest; -import org.htmlunit.junit.BrowserRunner; import org.htmlunit.util.Cookie; import org.htmlunit.util.MimeType; import org.htmlunit.util.NameValuePair; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link CookieManager}. * * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class CookieManager5Test extends WebServerTestCase { + /** + * @throws Exception if an error occurs + */ @Test public void sameDomainWithClientCookie() throws Exception { final List headers = new ArrayList<>(); @@ -64,6 +63,9 @@ public void sameDomainWithClientCookie() throws Exception { } } + /** + * @throws Exception if an error occurs + */ @Test public void unqualifiedHostWithClientCookie() throws Exception { final List headers = new ArrayList<>(); @@ -85,6 +87,9 @@ public void unqualifiedHostWithClientCookie() throws Exception { } } + /** + * @throws Exception if an error occurs + */ @Test public void subdomainWithClientCookie() throws Exception { final List headers = new ArrayList<>(); @@ -106,6 +111,9 @@ public void subdomainWithClientCookie() throws Exception { } } + /** + * @throws Exception if an error occurs + */ @Test public void differentSubdomainWithClientCookie() throws Exception { final List headers = new ArrayList<>(); @@ -172,23 +180,32 @@ public void updateCookieExpires() throws Exception { servlets.put(SetCookieExpires1000Servlet.URL, SetCookieExpires1000Servlet.class); startWebServer("./", null, servlets); - final WebClient webClient = getWebClient(); - webClient.getPage("http://localhost:" + PORT + SetCookieExpires10Servlet.URL); - assertEquals(1, webClient.getCookieManager().getCookies().size()); - Cookie cookie = webClient.getCookieManager().getCookies().iterator().next(); - assertFalse("" + cookie.getExpires(), cookie.getExpires().after(date)); + try (WebClient webClient = getWebClient()) { + webClient.getPage("http://localhost:" + PORT + SetCookieExpires10Servlet.URL); + assertEquals(1, webClient.getCookieManager().getCookies().size()); + Cookie cookie = webClient.getCookieManager().getCookies().iterator().next(); + assertFalse("" + cookie.getExpires(), cookie.getExpires().after(date)); + + webClient.getPage("http://localhost:" + PORT + SetCookieExpires1000Servlet.URL); + assertEquals(1, webClient.getCookieManager().getCookies().size()); + cookie = webClient.getCookieManager().getCookies().iterator().next(); + assertTrue("" + cookie.getExpires(), cookie.getExpires().after(date)); + } + } - webClient.getPage("http://localhost:" + PORT + SetCookieExpires1000Servlet.URL); - assertEquals(1, webClient.getCookieManager().getCookies().size()); - cookie = webClient.getCookieManager().getCookies().iterator().next(); - assertTrue("" + cookie.getExpires(), cookie.getExpires().after(date)); + @Override + protected WebClient getWebClient() { + final WebClient webClient = super.getWebClient(); + // set timeout to fail fast when the url not mapped + webClient.getOptions().setTimeout(1000); + return webClient; } /** * Helper class for {@link #updateCookieExpires}. */ public abstract static class SetCookieExpiresServlet extends HttpServlet { - private static final String HTML_ = HtmlPageTest.STANDARDS_MODE_PREFIX_ + private static final String HTML_ = DOCTYPE_HTML + "\n" + "\n" + ""; diff --git a/src/test/java/org/htmlunit/CookieManagerTest.java b/src/test/java/org/htmlunit/CookieManagerTest.java index bc82c12763c..1b4fd9573bb 100644 --- a/src/test/java/org/htmlunit/CookieManagerTest.java +++ b/src/test/java/org/htmlunit/CookieManagerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,13 +24,10 @@ import java.util.Map; import org.apache.http.client.utils.DateUtils; -import org.htmlunit.html.HtmlPageTest; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.htmlunit.util.MimeType; import org.htmlunit.util.NameValuePair; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.htmlunit.HtmlUnitDriver; @@ -44,12 +41,10 @@ * @author Frank Danek * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class CookieManagerTest extends WebDriverTestCase { /** HTML code with JS code alert(document.cookie). */ - public static final String HTML_ALERT_COOKIE - = HtmlPageTest.STANDARDS_MODE_PREFIX_ + public static final String HTML_ALERT_COOKIE = DOCTYPE_HTML + "\n" + "\n" @@ -303,7 +299,7 @@ public void setCookieExpired() throws Exception { @Test @Alerts({"cookies: first=1", "cookies: "}) public void setCookieTimeout() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" - + ""; - - final URL firstUrl = new URL("http://host1.htmlunit.org:" + PORT + "/"); - getMockWebConnection().setResponse(firstUrl, html); - loadPage2(html, firstUrl); - - loadPage2(HTML_ALERT_COOKIE, firstUrl); - verifyTitle2(getWebDriver(), getExpectedAlerts()); - } } diff --git a/src/test/java/org/htmlunit/DefaultCredentialsProvider2Test.java b/src/test/java/org/htmlunit/DefaultCredentialsProvider2Test.java index d3a8ff56164..83fd1192933 100644 --- a/src/test/java/org/htmlunit/DefaultCredentialsProvider2Test.java +++ b/src/test/java/org/htmlunit/DefaultCredentialsProvider2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ */ package org.htmlunit; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.io.StringWriter; import java.net.URL; @@ -27,10 +27,8 @@ import org.apache.logging.log4j.core.config.Configurator; import org.apache.logging.log4j.core.layout.PatternLayout; import org.htmlunit.html.HtmlPage; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; /** * Tests for {@link DefaultCredentialsProvider}. @@ -38,7 +36,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class DefaultCredentialsProvider2Test extends WebServerTestCase { /** @@ -135,7 +132,7 @@ public void basicAuthentication_singleAuthenticaiton() throws Exception { @Test @Alerts("SecRet") public void basicAuthenticationUserFromUrl() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; getMockWebConnection().setDefaultResponse(html); getWebClient().getCredentialsProvider().clear(); @@ -184,7 +181,7 @@ public void basicAuthenticationUserFromUrl() throws Exception { @Test @Alerts("SecRet") public void basicAuthenticationUserFromUrlUsedForNextSteps() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; getMockWebConnection().setDefaultResponse(html); getWebClient().getCredentialsProvider().clear(); @@ -248,7 +245,7 @@ public void basicAuthenticationUserFromUrlUsedForNextSteps() throws Exception { @Test @Alerts("SecRet") public void basicAuthenticationUserFromUrlOverwrite() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; getMockWebConnection().setDefaultResponse(html); getWebClient().getCredentialsProvider().clear(); @@ -307,7 +304,7 @@ public void basicAuthenticationUserFromUrlOverwrite() throws Exception { @Test @Alerts("SecRet") public void basicAuthenticationUserFromUrlOverwriteDefaultCredentials() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; getMockWebConnection().setDefaultResponse(html); getWebClient().getCredentialsProvider().clear(); @@ -333,7 +330,7 @@ public void basicAuthenticationUserFromUrlOverwriteDefaultCredentials() throws E @Test @Alerts("SecRet") public void basicAuthenticationUserFromUrlOverwriteWrongDefaultCredentials() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; getMockWebConnection().setDefaultResponse(html); getWebClient().getCredentialsProvider().clear(); @@ -372,7 +369,8 @@ public void basicAuthenticationUserFromUrlOverwriteWrongDefaultCredentials() thr @Test @Alerts("Hello World") public void basicAuthenticationXHR() throws Exception { - final String html = ""; + String html = DOCTYPE_HTML + + ""; html = "HTTP/1.1 200 OK\r\n" + "Content-Length: " + (html.length()) + "\r\n" + "Content-Type: text/html\r\n" @@ -1142,7 +1146,8 @@ public void locationSetHref() throws Exception { "Sec-Fetch-User: ?1", "Priority: u=0, i"}) public void locationSetSearch() throws Exception { - String html = ""; + String html = DOCTYPE_HTML + + ""; html = "HTTP/1.1 200 OK\r\n" + "Content-Length: " + (html.length()) + "\r\n" + "Content-Type: text/html\r\n" @@ -1293,7 +1298,8 @@ public void locationSetSearch() throws Exception { "Sec-Fetch-User: ?1", /* wrong */ "Priority: u=0, i"}) public void loadJavascript() throws Exception { - String html = " "; + String html = DOCTYPE_HTML + + " "; html = "HTTP/1.1 200 OK\r\n" + "Content-Length: " + (html.length()) + "\r\n" + "Content-Type: text/html\r\n" @@ -1443,12 +1449,13 @@ public void loadJavascript() throws Exception { "Sec-Fetch-Site: same-origin", "Sec-Fetch-User: ?1", /* wrong */ "Priority: u=0, i"}) - // this fails on our CI but i have no idea why + // this fails on our CI but I have no idea why // seems like the request for downloading the script never reaches the // PrimitiveWebServer - @NotYetImplemented(value = {}, os = OS.Linux) + @DisabledOnOs(OS.LINUX) public void loadJavascriptCharset() throws Exception { - String html = "" + String html = DOCTYPE_HTML + + "" + "" + "" + ""; @@ -1479,6 +1486,18 @@ public void loadJavascriptCharset() throws Exception { expectedHeaders[i] = expectedHeaders[i].replaceAll("§§ACCEPT§§", getBrowserVersion().getScriptAcceptHeader()); } + + // let's try some wait on our CI server + final long endTime = System.currentTimeMillis() + Duration.ofSeconds(4).toMillis(); + while (primitiveWebServer.getRequests().size() < 1 + && System.currentTimeMillis() < endTime) { + Thread.sleep(100); + } + + if (primitiveWebServer.getRequests().size() < 2) { + Assertions.fail("Still no request / request count:" + primitiveWebServer.getRequests().size()); + } + final String request = primitiveWebServer.getRequests().get(1); final String[] headers = request.split("\\r\\n"); assertEquals(Arrays.asList(expectedHeaders).toString(), Arrays.asList(headers).toString()); diff --git a/src/test/java/org/htmlunit/HttpWebConnectionInsecureSSLTest.java b/src/test/java/org/htmlunit/HttpWebConnectionInsecureSSLTest.java index cc622a7edbd..8bf5d259e23 100644 --- a/src/test/java/org/htmlunit/HttpWebConnectionInsecureSSLTest.java +++ b/src/test/java/org/htmlunit/HttpWebConnectionInsecureSSLTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,10 +23,9 @@ import org.eclipse.jetty.server.SslConnectionFactory; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.ssl.SslContextFactory.Server; -import org.htmlunit.junit.BrowserRunner; import org.htmlunit.util.WebConnectionWrapper; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; /** * Tests for insecure SSL. @@ -34,16 +33,16 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class HttpWebConnectionInsecureSSLTest extends WebServerTestCase { /** * @throws Exception if an error occurs */ - @Test(expected = SSLHandshakeException.class) + @Test public void normal() throws Exception { final URL https = new URL("https://localhost:" + PORT2 + "/"); - loadPage("
test
", https); + Assertions.assertThrows(SSLHandshakeException.class, + () -> loadPage("
test
", https)); } /** diff --git a/src/test/java/org/htmlunit/HttpWebConnectionInsecureSSLWithClientCertificateTest.java b/src/test/java/org/htmlunit/HttpWebConnectionInsecureSSLWithClientCertificateTest.java index 197fa70a0f4..f4b70ceb99f 100644 --- a/src/test/java/org/htmlunit/HttpWebConnectionInsecureSSLWithClientCertificateTest.java +++ b/src/test/java/org/htmlunit/HttpWebConnectionInsecureSSLWithClientCertificateTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ package org.htmlunit; import static org.eclipse.jetty.http.HttpVersion.HTTP_1_1; -import static org.junit.Assert.fail; import java.io.ByteArrayInputStream; import java.io.InputStream; @@ -26,9 +25,8 @@ import org.eclipse.jetty.server.SslConnectionFactory; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.ssl.SslContextFactory.Server; -import org.htmlunit.junit.BrowserRunner; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; /** * Tests for insecure SSL, with client certificate. @@ -37,17 +35,17 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class HttpWebConnectionInsecureSSLWithClientCertificateTest extends WebServerTestCase { /** * @throws Exception if an error occurs */ - @Test(expected = SSLHandshakeException.class) + @Test public void insecureSSL_clientCertificates_fail() throws Exception { final URL https = new URL("https://localhost:" + PORT2 + "/"); - loadPage("
test
", https); - fail("SSLHandshakeException expected"); + + Assertions.assertThrows(SSLHandshakeException.class, + () -> loadPage("
test
", https)); } /** @@ -70,10 +68,12 @@ public void insecureSSL_clientCertificates() throws Exception { * * @throws Exception if an error occurs */ - @Test(expected = SSLHandshakeException.class) + @Test public void insecureSSL_clientCertificatesInputStream_fail() throws Exception { final URL https = new URL("https://localhost:" + PORT2 + "/"); - loadPage("
test
", https); + + Assertions.assertThrows(SSLHandshakeException.class, + () -> loadPage("
test
", https)); } /** diff --git a/src/test/java/org/htmlunit/HttpWebConnectionProxyTest.java b/src/test/java/org/htmlunit/HttpWebConnectionProxyTest.java index 84236df65dc..ef4e4e70887 100644 --- a/src/test/java/org/htmlunit/HttpWebConnectionProxyTest.java +++ b/src/test/java/org/htmlunit/HttpWebConnectionProxyTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,12 +17,10 @@ import java.net.URL; import org.eclipse.jetty.server.Server; -import org.htmlunit.junit.BrowserRunner; import org.htmlunit.util.UrlUtils; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * Tests methods in {@link HttpWebConnection}. @@ -30,7 +28,6 @@ * @author John J Murdoch * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class HttpWebConnectionProxyTest extends WebServerTestCase { private Server proxyWebServer_; @@ -39,7 +36,7 @@ public class HttpWebConnectionProxyTest extends WebServerTestCase { * Performs pre-test construction. * @throws Exception if an error occurs */ - @Before + @BeforeEach public void setup() throws Exception { // we have to stop all servers running already to free the port WebDriverTestCase.stopWebServers(); @@ -62,7 +59,7 @@ public void setup() throws Exception { * @throws Exception if an error occurs */ @Override - @After + @AfterEach public void tearDown() throws Exception { if (proxyWebServer_ != null) { proxyWebServer_.stop(); diff --git a/src/test/java/org/htmlunit/HttpWebConnectionTest.java b/src/test/java/org/htmlunit/HttpWebConnectionTest.java index 9dd4f7a155c..ac4b88d54ca 100644 --- a/src/test/java/org/htmlunit/HttpWebConnectionTest.java +++ b/src/test/java/org/htmlunit/HttpWebConnectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ */ package org.htmlunit; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; @@ -52,13 +52,11 @@ import org.apache.http.message.BasicStatusLine; import org.htmlunit.html.HtmlPage; import org.htmlunit.http.HttpStatus; -import org.htmlunit.junit.BrowserRunner; import org.htmlunit.util.KeyDataPair; import org.htmlunit.util.MimeType; import org.htmlunit.util.NameValuePair; import org.htmlunit.util.ServletContentWrapper; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Tests methods in {@link HttpWebConnection}. @@ -69,7 +67,6 @@ * @author Ronald Brill * @author Carsten Steul */ -@RunWith(BrowserRunner.class) public class HttpWebConnectionTest extends WebServerTestCase { /** @@ -292,7 +289,8 @@ public void emptyPut() throws Exception { public static class EmptyPutServlet extends ServletContentWrapper { /** Constructor. */ public EmptyPutServlet() { - super("\n" + super(DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/MiniServer.java b/src/test/java/org/htmlunit/MiniServer.java index a36cdc8d2ab..5f6e25c1bd5 100644 --- a/src/test/java/org/htmlunit/MiniServer.java +++ b/src/test/java/org/htmlunit/MiniServer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,19 +58,35 @@ public class MiniServer extends Thread implements Closeable { private static final Set DROP_REQUESTS = new HashSet<>(); private static final Set DROP_GET_REQUESTS = new HashSet<>(); + /** + * Resets the drop and drop-get request counters. + */ public static void resetDropRequests() { DROP_REQUESTS.clear(); DROP_GET_REQUESTS.clear(); } + /** + * Add the given url to the list of drop requests. + * @param url to url to add + */ public static void configureDropRequest(final URL url) { DROP_REQUESTS.add(url); } + /** + * Add the given url to the list of drop-get requests. + * @param url to url to add + */ public static void configureDropGetRequest(final URL url) { DROP_GET_REQUESTS.add(url); } + /** + * Ctor. + * @param port the port to listen on + * @param mockWebConnection the {@link MockWebConnection} to get the responses from + */ public MiniServer(final int port, final MockWebConnection mockWebConnection) { port_ = port; mockWebConnection_ = mockWebConnection; @@ -211,6 +227,9 @@ else if ("POST".equalsIgnoreCase(methodText)) { } } + /** + * @return the last received request + */ public String getLastRequest() { return lastRequest_; } diff --git a/src/test/java/org/htmlunit/MockWebConnectionTest.java b/src/test/java/org/htmlunit/MockWebConnectionTest.java index 4b2784d7c82..ceff0b936c2 100644 --- a/src/test/java/org/htmlunit/MockWebConnectionTest.java +++ b/src/test/java/org/htmlunit/MockWebConnectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,17 +17,15 @@ import static java.nio.charset.StandardCharsets.UTF_8; import org.htmlunit.html.HtmlPage; -import org.htmlunit.junit.BrowserRunner; import org.htmlunit.util.MimeType; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Tests for {@link MockWebConnection}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class MockWebConnectionTest extends SimpleWebTestCase { /** @@ -35,7 +33,8 @@ public class MockWebConnectionTest extends SimpleWebTestCase { */ @Test public void charset() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + " Pound Test\n" diff --git a/src/test/java/org/htmlunit/NiceRefreshHandlerTest.java b/src/test/java/org/htmlunit/NiceRefreshHandlerTest.java index de64339a37d..17758a23cd6 100644 --- a/src/test/java/org/htmlunit/NiceRefreshHandlerTest.java +++ b/src/test/java/org/htmlunit/NiceRefreshHandlerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,16 +17,14 @@ import java.net.URL; import org.htmlunit.html.HtmlPage; -import org.htmlunit.junit.BrowserRunner; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Tests for {@link NiceRefreshHandler}. * * @author Marc Guillemot + * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public final class NiceRefreshHandlerTest extends SimpleWebTestCase { /** @@ -46,7 +44,8 @@ public void noRefreshForDelayLargerThanMax() throws Exception { } private void doTest(final int handlerMaxDelay, final URL expectedUrl) throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "Meta Redirect Page\n" + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/NicelyResynchronizingAjaxControllerTest.java b/src/test/java/org/htmlunit/NicelyResynchronizingAjaxControllerTest.java index 9607ff8bbfa..060ca3abfe1 100644 --- a/src/test/java/org/htmlunit/NicelyResynchronizingAjaxControllerTest.java +++ b/src/test/java/org/htmlunit/NicelyResynchronizingAjaxControllerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ */ package org.htmlunit; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Tests for {@link NicelyResynchronizingAjaxController}. diff --git a/src/test/java/org/htmlunit/NoHttpResponseTest.java b/src/test/java/org/htmlunit/NoHttpResponseTest.java index 1ef0df8478e..1e4dc767beb 100644 --- a/src/test/java/org/htmlunit/NoHttpResponseTest.java +++ b/src/test/java/org/htmlunit/NoHttpResponseTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,19 +14,16 @@ */ package org.htmlunit; -import static org.junit.Assert.fail; - import java.net.URL; import java.nio.charset.StandardCharsets; import org.htmlunit.html.HtmlPage; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; -import org.junit.After; -import org.junit.Test; -import org.junit.experimental.runners.Enclosed; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriverException; @@ -38,7 +35,6 @@ * @author Frank Danek * @author Ronald Brill */ -@RunWith(Enclosed.class) public class NoHttpResponseTest { private static final String HTML = ""; + final String html = DOCTYPE_HTML + ""; try { loadPage(html); } diff --git a/src/test/java/org/htmlunit/ScriptPreProcessorTest.java b/src/test/java/org/htmlunit/ScriptPreProcessorTest.java index 2d66a5a9ea5..a48cab7a0ab 100644 --- a/src/test/java/org/htmlunit/ScriptPreProcessorTest.java +++ b/src/test/java/org/htmlunit/ScriptPreProcessorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ */ package org.htmlunit; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.util.ArrayList; @@ -22,9 +22,7 @@ import org.htmlunit.html.HtmlElement; import org.htmlunit.html.HtmlPage; -import org.htmlunit.junit.BrowserRunner; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Tests for {@link ScriptPreProcessor}. @@ -41,7 +39,6 @@ * @author Daniel Gredler * @author Sudhan Moghe */ -@RunWith(BrowserRunner.class) public class ScriptPreProcessorTest extends WebServerTestCase { /** @@ -54,8 +51,8 @@ public void scriptPreProcessor() throws IOException { final MockWebConnection webConnection = new MockWebConnection(); final String alertText = "content"; final String newAlertText = "newcontent"; - final String content - = "foo\n" + "

hello world

\n" @@ -118,7 +115,8 @@ public void handleAlert(final Page page, final String message) { public void scriptPreProcessor_UnimplementedJavascript() throws Exception { final WebClient client = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); - final String content = "foo\n" + final String content = DOCTYPE_HTML + + "foo\n" + "

hello world

\n" + "\n" + "\n" @@ -151,7 +149,8 @@ public String preProcess(final HtmlPage htmlPage, final String sourceCode, final */ @Test public void scriptPreProcessor_Eval() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + + ""; final WebClient client = getWebClient(); final MockWebConnection conn = new MockWebConnection(); diff --git a/src/test/java/org/htmlunit/SgmlPage2Test.java b/src/test/java/org/htmlunit/SgmlPage2Test.java index 1ec03fba12b..48974b4c4b7 100644 --- a/src/test/java/org/htmlunit/SgmlPage2Test.java +++ b/src/test/java/org/htmlunit/SgmlPage2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,8 @@ package org.htmlunit; import org.htmlunit.html.HtmlPage; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; import org.openqa.selenium.WebDriver; import org.openqa.selenium.htmlunit.HtmlUnitDriver; @@ -27,7 +25,6 @@ * * @author Ahmed Ashour */ -@RunWith(BrowserRunner.class) public final class SgmlPage2Test extends WebDriverTestCase { /** @@ -36,7 +33,8 @@ public final class SgmlPage2Test extends WebDriverTestCase { @Test @Alerts({"2", "2"}) public void getElementsByTagName() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -50,8 +47,8 @@ public void localStorage() throws Exception { assertEquals(1, localStorage.size()); assertEquals("Tom", localStorage.get("myCat")); - html - = "\n" + html = DOCTYPE_HTML + + "\n" + "\n" @@ -73,8 +70,8 @@ public void populateLocalStorage() throws Exception { localStorage.put("myCat", "Tom"); - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -96,8 +93,8 @@ public void sessionStorage() throws Exception { webClient.getStorageHolder().getSessionStorage(webClient.getCurrentWindow()); assertEquals(0, sessionStorage.size()); - String html - = "\n" + String html = DOCTYPE_HTML + + "\n" + "\n" @@ -107,8 +104,8 @@ public void sessionStorage() throws Exception { assertEquals(1, sessionStorage.size()); assertEquals("Tom", sessionStorage.get("myCat")); - html - = "\n" + html = DOCTYPE_HTML + + "\n" + "\n" @@ -131,8 +128,8 @@ public void populateSessionStorage() throws Exception { sessionStorage.put("myCat", "Tom"); - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/StringWebResponseTest.java b/src/test/java/org/htmlunit/StringWebResponseTest.java index 1ecb35b6fbd..6048c35da83 100644 --- a/src/test/java/org/htmlunit/StringWebResponseTest.java +++ b/src/test/java/org/htmlunit/StringWebResponseTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.io.input.BOMInputStream; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link StringWebResponse}. @@ -43,6 +43,9 @@ public void charset() { assertSame(UTF_8, webResponse.getContentCharset()); } + /** + * @throws Exception if the test fails + */ @Test public void charsetImplicit() { final StringWebResponse webResponse = new StringWebResponse("hello", URL_FIRST); @@ -54,7 +57,8 @@ public void charsetImplicit() { */ @Test public void charsetInContent() { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\u010C\u00CDSLO"; final StringWebResponse webResponse = new StringWebResponse(content, UTF_8, URL_FIRST); @@ -63,9 +67,13 @@ public void charsetInContent() { assertEquals(content, webResponse.getContentAsString()); } + /** + * @throws Exception if the test fails + */ @Test public void charsetInContentImplicit() { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\u010C\u00CDSLO"; final StringWebResponse webResponse = new StringWebResponse(content, URL_FIRST); @@ -75,11 +83,12 @@ public void charsetInContentImplicit() { } /** - * @throws IOException + * @throws IOException in case of error */ @Test public void inputStream() throws IOException { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\u010C\u00CDSLO"; final StringWebResponse webResponse = new StringWebResponse(content, URL_FIRST); diff --git a/src/test/java/org/htmlunit/TestCaseTest.java b/src/test/java/org/htmlunit/TestCaseTest.java index 7afaf2c0656..181b218c5e4 100644 --- a/src/test/java/org/htmlunit/TestCaseTest.java +++ b/src/test/java/org/htmlunit/TestCaseTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package org.htmlunit; import static java.nio.charset.StandardCharsets.ISO_8859_1; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.io.File; import java.util.ArrayList; @@ -28,7 +28,7 @@ import org.htmlunit.html.HtmlTitle; import org.htmlunit.javascript.configuration.ClassConfiguration; import org.htmlunit.javascript.configuration.JavaScriptConfiguration; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Tests for various test cases. diff --git a/src/test/java/org/htmlunit/TextPageTest.java b/src/test/java/org/htmlunit/TextPageTest.java index 719f8da1687..a2e6b46cd94 100644 --- a/src/test/java/org/htmlunit/TextPageTest.java +++ b/src/test/java/org/htmlunit/TextPageTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,28 +16,21 @@ import java.io.File; import java.nio.charset.StandardCharsets; +import java.nio.file.Path; import org.apache.commons.io.FileUtils; -import org.htmlunit.junit.BrowserRunner; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * Tests for text content. * * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class TextPageTest extends WebServerTestCase { - /** - * Utility for temporary folders. - * Has to be public due to JUnit's constraints for @Rule. - */ - @Rule - public final TemporaryFolder tmpFolderProvider_ = new TemporaryFolder(); + @TempDir + static Path TEMP_DIR_; /** * @throws Exception if the test fails @@ -54,8 +47,11 @@ public void save() throws Exception { final TextPage page = client.getPage("http://localhost:" + primitiveWebServer.getPort() + "/" + "text"); - final File tmpFolder = tmpFolderProvider_.newFolder("hu"); + final File tmpFolder = new File(TEMP_DIR_.toFile(), "hu"); + tmpFolder.mkdir(); final File file = new File(tmpFolder, "hu_txt.plain"); + FileUtils.deleteQuietly(file); + page.save(file); assertTrue(file.exists()); assertTrue(file.isFile()); diff --git a/src/test/java/org/htmlunit/TopLevelWindowTest.java b/src/test/java/org/htmlunit/TopLevelWindowTest.java index 51142b533f9..4ad7d82cdff 100644 --- a/src/test/java/org/htmlunit/TopLevelWindowTest.java +++ b/src/test/java/org/htmlunit/TopLevelWindowTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,10 +24,8 @@ import org.htmlunit.html.HtmlPage; import org.htmlunit.javascript.background.JavaScriptJob; import org.htmlunit.javascript.background.JavaScriptJobManager; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; /** * Tests for {@link TopLevelWindow}. @@ -37,7 +35,6 @@ * @author Daniel Gredler * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class TopLevelWindowTest extends SimpleWebTestCase { /** @@ -100,6 +97,17 @@ public int waitForJobsStartingBefore(final long delayMillis) { } /** {@inheritDoc} */ @Override + public int waitForJobsStartingBefore(final long delayMillis, final long timeoutMillis) { + return jobCount.intValue(); + } + /** {@inheritDoc} */ + @Override + public int waitForJobsStartingBefore(final long delayMillis, final long timeoutMillis, + final JavaScriptJobFilter filter) { + return jobCount.intValue(); + } + /** {@inheritDoc} */ + @Override public int waitForJobsStartingBefore(final long delayMillis, final JavaScriptJobFilter filter) { return jobCount.intValue(); } @@ -191,7 +199,8 @@ public void webWindowClosed(final WebWindowEvent event) { window.setJobManager(mgr); final MockWebConnection conn = getMockWebConnection(); - conn.setDefaultResponse(""); + conn.setDefaultResponse(DOCTYPE_HTML + + ""); client.getPage(URL_FIRST); assertEquals(1, jobCount.intValue()); @@ -210,10 +219,13 @@ public void history() throws Exception { final History history = window.getHistory(); final MockWebConnection conn = getMockWebConnection(); - conn.setResponse(URL_FIRST, "foo\n" - + "bar"); - conn.setResponse(URL_SECOND, "foo"); - conn.setResponse(URL_THIRD, "foo"); + conn.setResponse(URL_FIRST, DOCTYPE_HTML + + "foo\n" + + "bar"); + conn.setResponse(URL_SECOND, DOCTYPE_HTML + + "foo"); + conn.setResponse(URL_THIRD, DOCTYPE_HTML + + "foo"); assertEquals(0, history.getLength()); assertEquals(-1, history.getIndex()); @@ -305,7 +317,7 @@ public void history() throws Exception { */ @Test public void onBeforeUnloadCalledOnClose() throws Exception { - final String html = "abc"; + final String html = DOCTYPE_HTML + "abc"; final List alerts = new ArrayList<>(); final HtmlPage page = loadPage(html, alerts); assertTrue(alerts.isEmpty()); @@ -323,7 +335,8 @@ public void onBeforeUnloadCalledOnClose() throws Exception { @Test @Alerts("closing") public void setTimeoutDuringOnUnload() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; + + final String[] expected = getExpectedAlerts(); + + setExpectedAlerts(); final HtmlPage page = loadPageWithAlerts(html); // verify that 1 background job exists - assertEquals(1, page.getEnclosingWindow().getJobManager().getJobCount()); + assertEquals(Integer.parseInt(expected[0]), page.getEnclosingWindow().getJobManager().getJobCount()); final byte[] bytes = SerializationUtils.serialize(page); page.getWebClient().close(); // deserialize page and verify that 1 background job exists final HtmlPage clonedPage = (HtmlPage) SerializationUtils.deserialize(bytes); - assertEquals(1, clonedPage.getEnclosingWindow().getJobManager().getJobCount()); + assertEquals(Integer.parseInt(expected[1]), clonedPage.getEnclosingWindow().getJobManager().getJobCount()); // configure a new CollectingAlertHandler (in fact it has surely already one and we could get and cast it) final List collectedAlerts = Collections.synchronizedList(new ArrayList()); @@ -172,7 +181,8 @@ public void serialization_withJSBackgroundTasks() throws Exception { clonedPage.getWebClient().waitForBackgroundJavaScriptStartingBefore(100); assertEquals(0, clonedPage.getEnclosingWindow().getJobManager().getJobCount()); - final String[] expectedAlerts = {"exiting"}; + + final String[] expectedAlerts = {expected[2]}; assertEquals(expectedAlerts, collectedAlerts); } @@ -185,7 +195,7 @@ public void serialization_withJSBackgroundTasks() throws Exception { FF = "en-US,en;q=0.5", FF_ESR = "en-US,en;q=0.5") public void acceptLanguage() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; loadPage(html); assertEquals(getExpectedAlerts()[0], getMockWebConnection().getLastAdditionalHeaders().get(HttpHeader.ACCEPT_LANGUAGE)); @@ -197,7 +207,7 @@ public void acceptLanguage() throws Exception { */ @Test public void acceptLanguageFr() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; final BrowserVersion frBrowser = new BrowserVersion.BrowserVersionBuilder(getBrowserVersion()) @@ -219,7 +229,7 @@ public void acceptLanguageFr() throws Exception { */ @Test public void newWindowScopeForAboutBlank() throws Exception { - final HtmlPage p = loadPage(""); + final HtmlPage p = loadPage(DOCTYPE_HTML + ""); p.executeJavaScript("top.foo = 'hello';"); final ScriptResult result = p.executeJavaScript("top.foo"); assertEquals("hello", result.getJavaScriptResult()); @@ -285,15 +295,14 @@ private void checkCookie(final String cookieString, final String name, final Str * @throws Exception if something goes wrong */ @Test - @Retry @Alerts({"loadExtraContent started at Page 1", " loadExtraContent finished at Page 1"}) @HtmlUnitNYI(CHROME = {"loadExtraContent started at Page 1", " loadExtraContent finished at Page 2"}, EDGE = {"loadExtraContent started at Page 1", " loadExtraContent finished at Page 2"}, FF = {"loadExtraContent started at Page 1", " loadExtraContent finished at Page 2"}, FF_ESR = {"loadExtraContent started at Page 1", " loadExtraContent finished at Page 2"}) public void makeSureTheCurrentJobHasEndedBeforeReplaceWindowPage() throws Exception { - final String htmlContent1 - = "\n" + final String htmlContent1 = DOCTYPE_HTML + + "\n" + "" + " Page 1\n" + "\n" @@ -320,8 +329,8 @@ public void makeSureTheCurrentJobHasEndedBeforeReplaceWindowPage() throws Except + "\n" + ""; - final String htmlContent2 - = "\n" + final String htmlContent2 = DOCTYPE_HTML + + "\n" + "" + " Page 2\n" + "\n" @@ -345,7 +354,7 @@ public void makeSureTheCurrentJobHasEndedBeforeReplaceWindowPage() throws Except // Immediately load page 2. Timeout function was triggered already final HtmlPage page2 = client.getPage(URL_SECOND); verify(() -> page1.getEnclosingWindow().getName(), - getExpectedAlerts()[0] + getExpectedAlerts()[1], DEFAULT_WAIT_TIME * 4); + getExpectedAlerts()[0] + getExpectedAlerts()[1], DEFAULT_WAIT_TIME.multipliedBy(4)); // Fails: return 98 (about) instead of 1 // assertEquals(1, page.querySelectorAll("p").size()); @@ -356,8 +365,7 @@ public void makeSureTheCurrentJobHasEndedBeforeReplaceWindowPage() throws Except */ @Test public void toLocaleLowerCase() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + "\n" + "to second"; - final String secondContent = ""; + final String secondContent = DOCTYPE_HTML + ""; final MockWebConnection webConnection = getMockWebConnection(); webConnection.setResponse(URL_SECOND, secondContent); @@ -185,7 +188,8 @@ public void clickReturnsWhenThePageHasBeenCompleteLoaded() throws Exception { @Test @Alerts({"open", "first", "second"}) public void windowOpenedByAnchorTargetIsAttachedToJavascriptEventLoop() throws Exception { - final String firstContent = "\n" + final String firstContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" + ""; @@ -439,7 +458,8 @@ private void doTestDeflateCompression(final boolean gzipCompatibleCompression) t final MockWebConnection conn = getMockWebConnection(); conn.setResponse(URL_SECOND, content, 200, "OK", "text/javascript", headers); - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "Hello world\n" + "\n" + ""; @@ -525,7 +545,11 @@ public void javascriptContentDetectorContentTypeTextPlain() throws Exception { * @throws Exception if something goes wrong */ @Test - @NotYetImplemented + @Alerts({}) + @HtmlUnitNYI(CHROME = "executed", + EDGE = "executed", + FF = "executed", + FF_ESR = "executed") public void javascriptContentDetectorContentTypeApplicationJavascript() throws Exception { final MockWebConnection conn = getMockWebConnection(); conn.setDefaultResponse("", 200, "OK", MimeType.TEXT_JAVASCRIPT); @@ -558,8 +582,8 @@ public void encodingCharsetGBK() throws Exception { private void encodingCharset(final String title, final String metaCharset, final String responseCharset) throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "" + title + "\n" + "\n" @@ -587,10 +611,14 @@ private void encodingCharset(final String title, * @throws Exception if the test fails */ @Test - @Alerts({"en-US", "en-US,en"}) + @Alerts(DEFAULT = {"en-US", "en-US"}, + FF = {"en-US", "en-US,en"}, + FF_ESR = {"en-US", "en-US,en"}) + @HtmlUnitNYI(CHROME = {"en-US", "en-US,en"}, + EDGE = {"en-US", "en-US,en"}) public void language() throws Exception { - final String html - = "\n" @@ -247,7 +253,8 @@ public void script() throws Exception { */ @Test public void link() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " foo\n" + " \n" @@ -271,7 +278,8 @@ public void link() throws Exception { */ @Test public void object() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " foo\n" + "\n" @@ -295,7 +303,8 @@ public void object() throws Exception { */ @Test public void svgScript() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " foo\n" + "\n" @@ -316,7 +325,8 @@ public void svgScript() throws Exception { */ @Test public void invalidElementEventWithNoJS() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + + "" + "" + " foo" + "" @@ -334,7 +344,8 @@ public void invalidElementEventWithNoJS() throws Exception { */ @Test public void checkingWithNoJS() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + + "" + "" + " foo" + "" @@ -362,7 +373,8 @@ public void checkingWithNoJS() throws Exception { */ @Test public void frameSetWithNoJS() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " foo\n" + "\n" @@ -384,7 +396,8 @@ public void frameSetWithNoJS() throws Exception { */ @Test public void imageEventHandlersWithNoJs() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " \n" @@ -402,7 +415,8 @@ public void imageEventHandlersWithNoJs() throws Exception { */ @Test public void clickWithNoJs() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " \n" diff --git a/src/test/java/org/htmlunit/WebClient9Test.java b/src/test/java/org/htmlunit/WebClient9Test.java index 90802dac309..2aa6b742382 100644 --- a/src/test/java/org/htmlunit/WebClient9Test.java +++ b/src/test/java/org/htmlunit/WebClient9Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,9 +22,7 @@ import org.htmlunit.cssparser.parser.CSSOMParser; import org.htmlunit.cssparser.parser.InputSource; import org.htmlunit.cssparser.parser.javacc.CSS3Parser; -import org.htmlunit.junit.BrowserRunner; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Tests for {@link WebClient} and its CSS3Parser pool. @@ -32,7 +30,6 @@ * @author René Schwietzke * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class WebClient9Test extends SimpleWebTestCase { /** @@ -141,6 +138,9 @@ public void flow1_2() { } } + /** + * @throws Exception if the test fails + */ @Test public void multithreading() throws InterruptedException { final String css = "body { background-color: green; }"; diff --git a/src/test/java/org/htmlunit/WebClientOptionsTest.java b/src/test/java/org/htmlunit/WebClientOptionsTest.java index ce12272e638..4413aca7009 100644 --- a/src/test/java/org/htmlunit/WebClientOptionsTest.java +++ b/src/test/java/org/htmlunit/WebClientOptionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,19 +14,19 @@ */ package org.htmlunit; +import java.security.KeyStore; + import javax.net.ssl.SSLContext; import org.apache.commons.lang3.SerializationUtils; -import org.htmlunit.junit.BrowserRunner; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; /** * Tests for {@link WebClientOptions}. * * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class WebClientOptionsTest extends SimpleWebTestCase { /** @@ -42,12 +42,37 @@ public void serialization() throws Exception { assertEquals(original.isJavaScriptEnabled(), deserialized.isJavaScriptEnabled()); assertEquals(original.isCssEnabled(), deserialized.isCssEnabled()); - assertEquals(original.isPrintContentOnFailingStatusCode(), deserialized.isPrintContentOnFailingStatusCode()); + assertEquals(original.isPrintContentOnFailingStatusCode(), + deserialized.isPrintContentOnFailingStatusCode()); assertEquals(original.isThrowExceptionOnFailingStatusCode(), deserialized.isThrowExceptionOnFailingStatusCode()); - assertEquals(original.isThrowExceptionOnScriptError(), deserialized.isThrowExceptionOnScriptError()); - assertEquals(original.isPopupBlockerEnabled(), deserialized.isPopupBlockerEnabled()); - assertEquals(original.isRedirectEnabled(), deserialized.isRedirectEnabled()); + assertEquals(original.isThrowExceptionOnScriptError(), + deserialized.isThrowExceptionOnScriptError()); + assertEquals(original.isPopupBlockerEnabled(), + deserialized.isPopupBlockerEnabled()); + assertEquals(original.isRedirectEnabled(), + deserialized.isRedirectEnabled()); + + assertEquals(original.isGeolocationEnabled(), + deserialized.isGeolocationEnabled()); + assertEquals(original.getGeolocation(), + deserialized.getGeolocation()); + + assertEquals(original.getNekoReaderBufferSize(), + deserialized.getNekoReaderBufferSize()); + + assertEquals(original.isWebSocketEnabled(), + deserialized.isWebSocketEnabled()); + assertEquals(original.getWebSocketMaxTextMessageSize(), + deserialized.getWebSocketMaxTextMessageSize()); + assertEquals(original.getWebSocketMaxTextMessageBufferSize(), + deserialized.getWebSocketMaxTextMessageBufferSize()); + assertEquals(original.getWebSocketMaxBinaryMessageSize(), + deserialized.getWebSocketMaxBinaryMessageSize()); + assertEquals(original.getWebSocketMaxBinaryMessageBufferSize(), + deserialized.getWebSocketMaxBinaryMessageBufferSize()); + + assertEquals(original.isFetchPolyfillEnabled(), deserialized.isFetchPolyfillEnabled()); } /** @@ -65,6 +90,19 @@ public void serializationChanged() throws Exception { original.setPopupBlockerEnabled(true); original.setRedirectEnabled(false); + original.setGeolocationEnabled(true); + original.setGeolocation(new WebClientOptions.Geolocation(1d, 2d, 3d, 4d, 5d, 6d, 7d)); + + original.setNekoReaderBufferSize(1234567); + + original.setWebSocketEnabled(false); + original.setWebSocketMaxTextMessageSize(77); + original.setWebSocketMaxTextMessageBufferSize(771); + original.setWebSocketMaxBinaryMessageSize(44); + original.setWebSocketMaxBinaryMessageBufferSize(441); + + original.setFetchPolyfillEnabled(true); + final byte[] bytes = SerializationUtils.serialize(original); final WebClientOptions deserialized = (WebClientOptions) SerializationUtils.deserialize(bytes); @@ -77,6 +115,31 @@ public void serializationChanged() throws Exception { assertEquals(original.isThrowExceptionOnScriptError(), deserialized.isThrowExceptionOnScriptError()); assertEquals(original.isPopupBlockerEnabled(), deserialized.isPopupBlockerEnabled()); assertEquals(original.isRedirectEnabled(), deserialized.isRedirectEnabled()); + + assertEquals(original.isGeolocationEnabled(), deserialized.isGeolocationEnabled()); + assertEquals(original.getGeolocation().getAccuracy(), deserialized.getGeolocation().getAccuracy()); + assertEquals(original.getGeolocation().getLatitude(), deserialized.getGeolocation().getLatitude()); + assertEquals(original.getGeolocation().getLongitude(), deserialized.getGeolocation().getLongitude()); + assertEquals(original.getGeolocation().getAltitude(), deserialized.getGeolocation().getAltitude()); + assertEquals(original.getGeolocation().getAltitudeAccuracy(), + deserialized.getGeolocation().getAltitudeAccuracy()); + assertEquals(original.getGeolocation().getHeading(), deserialized.getGeolocation().getHeading()); + assertEquals(original.getGeolocation().getSpeed(), deserialized.getGeolocation().getSpeed()); + + assertEquals(original.getNekoReaderBufferSize(), deserialized.getNekoReaderBufferSize()); + + assertEquals(original.isWebSocketEnabled(), + deserialized.isWebSocketEnabled()); + assertEquals(original.getWebSocketMaxTextMessageSize(), + deserialized.getWebSocketMaxTextMessageSize()); + assertEquals(original.getWebSocketMaxTextMessageBufferSize(), + deserialized.getWebSocketMaxTextMessageBufferSize()); + assertEquals(original.getWebSocketMaxBinaryMessageSize(), + deserialized.getWebSocketMaxBinaryMessageSize()); + assertEquals(original.getWebSocketMaxBinaryMessageBufferSize(), + deserialized.getWebSocketMaxBinaryMessageBufferSize()); + + assertEquals(original.isFetchPolyfillEnabled(), deserialized.isFetchPolyfillEnabled()); } /** @@ -92,4 +155,37 @@ public void serializationSSLContextProvider() throws Exception { assertNull(deserialized.getSSLContext()); } + + /** + * @throws Exception if an error occurs + */ + @Test + public void serializationSSLTrustStore() throws Exception { + final WebClientOptions original = new WebClientOptions(); + + final KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + original.setSSLTrustStore(keyStore); + + final byte[] bytes = SerializationUtils.serialize(original); + final WebClientOptions deserialized = (WebClientOptions) SerializationUtils.deserialize(bytes); + + assertNull(deserialized.getSSLTrustStore()); + } + + /** + * @throws Exception if an error occurs + */ + @Test + public void sslClientCertificateStore() throws Exception { + final WebClientOptions original = new WebClientOptions(); + + final KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + original.setSSLClientCertificateKeyStore(keyStore, "secret".toCharArray()); + + final byte[] bytes = SerializationUtils.serialize(original); + final WebClientOptions deserialized = (WebClientOptions) SerializationUtils.deserialize(bytes); + + assertNull(deserialized.getSSLClientCertificateStore()); + Assertions.assertArrayEquals("secret".toCharArray(), deserialized.getSSLClientCertificatePassword()); + } } diff --git a/src/test/java/org/htmlunit/WebClientTest.java b/src/test/java/org/htmlunit/WebClientTest.java index f0a2afac0f5..1dc3eff649c 100644 --- a/src/test/java/org/htmlunit/WebClientTest.java +++ b/src/test/java/org/htmlunit/WebClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,8 +15,8 @@ package org.htmlunit; import static java.util.Arrays.asList; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.fail; import java.io.ByteArrayOutputStream; import java.io.File; @@ -45,19 +45,16 @@ import org.htmlunit.html.HtmlElement; import org.htmlunit.html.HtmlInlineFrame; import org.htmlunit.html.HtmlPage; -import org.htmlunit.html.HtmlPageTest; import org.htmlunit.html.parser.HTMLParser; import org.htmlunit.html.parser.neko.HtmlUnitNekoHtmlParser; import org.htmlunit.http.HttpStatus; import org.htmlunit.javascript.host.html.HTMLStyleElement; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.htmlunit.util.MimeType; import org.htmlunit.util.NameValuePair; import org.htmlunit.util.UrlUtils; import org.htmlunit.xml.XmlPage; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Tests for {@link WebClient}. @@ -77,7 +74,6 @@ * @author Carsten Steul * @author Joerg Werner */ -@RunWith(BrowserRunner.class) public class WebClientTest extends SimpleWebTestCase { /** @@ -87,7 +83,8 @@ public class WebClientTest extends SimpleWebTestCase { */ @Test public void credentialProvider_NoCredentials() throws Exception { - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "No access"; final WebClient client = getWebClient(); client.getOptions().setPrintContentOnFailingStatusCode(false); @@ -113,7 +110,8 @@ public void credentialProvider_NoCredentials() throws Exception { */ @Test public void htmlWindowEvents_changed() throws Exception { - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "link to foo2\n" + ""; final WebClient client = getWebClient(); @@ -164,12 +162,13 @@ public void webWindowClosed(final WebWindowEvent event) { */ @Test public void htmlWindowEvents_opened() throws Exception { - final String page1Content = "foo\n" + final String page1Content = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + "link to foo2\n" + ""; - final String page2Content = "foo"; + final String page2Content = DOCTYPE_HTML + "foo"; final WebClient client = getWebClient(); final List events = new LinkedList<>(); @@ -219,12 +218,13 @@ public void webWindowClosed(final WebWindowEvent event) { */ @Test public void htmlWindowEvents_closedFromFrame() throws Exception { - final String firstContent = "first\n" + final String firstContent = DOCTYPE_HTML + + "first\n" + "\n" + "link to foo2\n" + ""; - final String secondContent = "second"; - final String thirdContent = "third"; + final String secondContent = DOCTYPE_HTML + "second"; + final String thirdContent = DOCTYPE_HTML + "third"; final WebClient client = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); @@ -289,8 +289,8 @@ public void redirection301_MovedPermanently_GetMethod() throws Exception { * @throws Exception if the test fails */ private void doTestRedirectionSameUrlAfterPost(final int statusCode) throws Exception { - final String firstContent = "First"; - final String secondContent = "Second"; + final String firstContent = DOCTYPE_HTML + "First"; + final String secondContent = DOCTYPE_HTML + "Second"; final WebClient webClient = getWebClient(); @@ -436,7 +436,7 @@ public void redirection307_TemporaryRedirect_PostMethod() throws Exception { * @param statusCode the code to return from the initial request * @param initialRequestMethod the initial request * @param expectedRedirectedRequestMethod the submit method of the second (redirected) request - * If a redirect is not expected to happen then this must be null + * If a redirect is not expected to happen then this must be null * @param newLocation the Location set in the redirection header * @throws Exception if the test fails */ @@ -470,8 +470,8 @@ public void redirectionSameURL() throws Exception { } private HtmlPage getPageWithRedirectionsSameURL(final int nbRedirections) throws Exception { - final String firstContent = "First"; - final String secondContent = "Second"; + final String firstContent = DOCTYPE_HTML + "First"; + final String secondContent = DOCTYPE_HTML + "Second"; final WebClient webClient = getWebClient(); @@ -523,7 +523,7 @@ private void redirection_AdditionalHeadersMaintained(final int statusCode) throw final List headers = asList(new NameValuePair("Location", URL_SECOND.toString())); conn.setResponse(URL_FIRST, "", statusCode, "", MimeType.TEXT_HTML, headers); - conn.setResponse(URL_SECOND, "abc"); + conn.setResponse(URL_SECOND, DOCTYPE_HTML + "abc"); final WebRequest request = new WebRequest(URL_FIRST); request.setAdditionalHeader("foo", "bar"); @@ -539,7 +539,7 @@ private void redirection_AdditionalHeadersMaintained(final int statusCode) throw * @param statusCode the code to return from the initial request * @param initialRequestMethod the initial request * @param expectedRedirectedRequestMethod the submit method of the second (redirected) request - * If a redirect is not expected to happen then this must be null + * If a redirect is not expected to happen then this must be null * @param newLocation the Location set in the redirection header * @param useProxy indicates if the test should be performed with a proxy * @throws Exception if the test fails @@ -553,8 +553,8 @@ private void doTestRedirection( final boolean useProxy) throws Exception { - final String firstContent = "First"; - final String secondContent = "Second"; + final String firstContent = DOCTYPE_HTML + "First"; + final String secondContent = DOCTYPE_HTML + "Second"; final WebClient webClient; final String proxyHost; @@ -644,7 +644,8 @@ public void setPageCreator_null() { */ @Test public void setPageCreator() throws Exception { - final String page1Content = "foo\n" + final String page1Content = DOCTYPE_HTML + + "foo\n" + "\n" + "link to foo2\n" + ""; @@ -706,7 +707,8 @@ public HTMLParser getHtmlParser() { */ @Test public void loadPage_PostWithParameters() throws Exception { - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + ""; final WebClient client = getWebClient(); @@ -727,7 +729,8 @@ public void loadPage_PostWithParameters() throws Exception { */ @Test public void loadPage_SlashesInQueryString() throws Exception { - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "to page 2\n" + ""; @@ -754,7 +757,7 @@ public void loadFilePage() throws Exception { // It could be useful to have existing files to test in a special location in filesystem. // It will be really needed when we have to test binary files using the file protocol. - final String htmlContent = "foo"; + final String htmlContent = DOCTYPE_HTML + "foo"; final File currentDirectory = new File((new File("")).getAbsolutePath()); final File tmpFile = File.createTempFile("test", ".html", currentDirectory); tmpFile.deleteOnExit(); @@ -873,10 +876,12 @@ public void loadFilePageXml() throws Exception { */ @Test public void redirectViaJavaScriptDuringInitialPageLoad() throws Exception { - final String firstContent = "First"; - final String secondContent = "Second"; + final String secondContent = DOCTYPE_HTML + + "Second"; final WebClient webClient = getWebClient(); @@ -900,7 +905,7 @@ public void redirectViaJavaScriptDuringInitialPageLoad() throws Exception { public void loadWebResponseInto() throws Exception { final WebClient webClient = getWebClient(); final WebResponse webResponse = new StringWebResponse( - "first", URL_FIRST); + DOCTYPE_HTML + "first", URL_FIRST); final Page page = webClient.loadWebResponseInto(webResponse, webClient.getCurrentWindow()); assertTrue(HtmlPage.class.isInstance(page)); @@ -917,7 +922,7 @@ public void loadWebResponseInto() throws Exception { */ @Test public void getPageFailingStatusCode() throws Exception { - final String firstContent = "Hello World"; + final String firstContent = DOCTYPE_HTML + "Hello World"; final WebClient webClient = getWebClient(); @@ -951,7 +956,7 @@ public void proxyConfig() throws Exception { defaultProxyHost, defaultProxyPort)) { // Configure the mock web connection. - final String html = "Hello World"; + final String html = DOCTYPE_HTML + "Hello World"; final MockWebConnection webConnection = new MockWebConnection(); webConnection.setResponse(URL_FIRST, html); webClient.setWebConnection(webConnection); @@ -1021,7 +1026,7 @@ public void proxyConfig() throws Exception { public void proxyConfigWithRedirect() throws Exception { final String defaultProxyHost = "defaultProxyHost"; final int defaultProxyPort = 777; - final String html = "Hello World"; + final String html = DOCTYPE_HTML + "Hello World"; try (WebClient webClient = new WebClient(getBrowserVersion(), defaultProxyHost, defaultProxyPort)) { webClient.getOptions().getProxyConfig().addHostsToProxyBypass("hostToByPass"); @@ -1030,7 +1035,8 @@ public void proxyConfigWithRedirect() throws Exception { final List headers = Collections.singletonList(new NameValuePair("Location", location2)); final MockWebConnection webConnection = new MockWebConnection(); webConnection.setResponse(URL_FIRST, html, 302, "Some error", MimeType.TEXT_HTML, headers); - webConnection.setResponse(new URL(location2), "2nd page"); + webConnection.setResponse(new URL(location2), + DOCTYPE_HTML + "2nd page"); webClient.setWebConnection(webConnection); final Page page2 = webClient.getPage(URL_FIRST); @@ -1060,7 +1066,8 @@ public void proxyConfigWithRedirect() throws Exception { public void proxyConfigForJS() throws Exception { final String defaultProxyHost = "defaultProxyHost"; final int defaultProxyPort = 777; - final String html = "Hello World\n" + final String html = DOCTYPE_HTML + + "Hello World\n" + "\n" + ""; try (WebClient webClient = new WebClient(getBrowserVersion(), defaultProxyHost, defaultProxyPort)) { @@ -1137,7 +1144,8 @@ public void refreshHandlerAccessors() { */ @Test public void badCharset() throws Exception { - final String page1Content = "foo\n" + final String page1Content = DOCTYPE_HTML + + "foo\n" + ""; final WebClient client = getWebClient(); @@ -1167,12 +1175,14 @@ public void expandUrlHandlesColonsInRelativeUrl() throws Exception { */ @Test public void reusingHtmlPageToSubmitFormMultipleTimes() throws Exception { - final String firstContent = "First\n" + final String firstContent = DOCTYPE_HTML + + "First\n" + "\n" + "
\n" + "\n" + "
"; - final String secondContent = "SecondSecond"; + final String secondContent = DOCTYPE_HTML + + "SecondSecond"; final WebClient webClient = getWebClient(); @@ -1195,11 +1205,13 @@ public void reusingHtmlPageToSubmitFormMultipleTimes() throws Exception { */ @Test public void openerInFrameset() throws Exception { - final String firstContent = "\n" + final String firstContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" + ""; - final String secondContent = "to top"; + final String secondContent = DOCTYPE_HTML + + "to top"; final WebClient webClient = getWebClient(); @@ -1212,7 +1224,7 @@ public void openerInFrameset() throws Exception { webClient.setAlertHandler(new CollectingAlertHandler(collectedAlerts)); final HtmlPage page = webClient.getPage(URL_FIRST); - final HtmlPage pageInFrame = (HtmlPage) ((WebWindow) page.getFrames().get(0)).getEnclosedPage(); + final HtmlPage pageInFrame = (HtmlPage) page.getFrames().get(0).getEnclosedPage(); pageInFrame.getAnchors().get(0).click(); final String[] expectedAlerts = {"null", "null"}; @@ -1301,7 +1313,7 @@ private File getTestFile(final String fileName) throws Exception { */ @Test public void requestHeader() throws Exception { - final String content = ""; + final String content = DOCTYPE_HTML + ""; final WebClient client = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); @@ -1330,7 +1342,7 @@ public void requestHeaderOverwritesClient() throws Exception { final String fromRequest = "from request"; final String fromClient = "from client"; - final String content = ""; + final String content = DOCTYPE_HTML + ""; final WebClient client = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); @@ -1364,7 +1376,7 @@ public void requestHeaderOverwritesClient() throws Exception { public void clientHeaderOverwritesDefault() throws Exception { final String fromClient = "from client"; - final String content = ""; + final String content = DOCTYPE_HTML + ""; final WebClient client = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); @@ -1385,7 +1397,7 @@ public void clientHeaderOverwritesDefault() throws Exception { */ @Test public void requestHeaderDoNotOverwriteWebRequestAcceptHeader() throws Exception { - final String content = ""; + final String content = DOCTYPE_HTML + ""; final WebClient webClient = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); @@ -1419,7 +1431,7 @@ public void requestHeaderDoNotOverwriteWebRequestAcceptHeader() throws Exception */ @Test public void requestHeaderDoNotOverwriteWebRequestAcceptHeader2() throws Exception { - final String content = ""; + final String content = DOCTYPE_HTML + ""; final WebClient client = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); @@ -1457,7 +1469,8 @@ public void requestHeaderDoNotOverwriteWebRequestAcceptHeader2() throws Exceptio */ @Test public void contentTypeCaseInsensitive() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + ""; final WebClient client = getWebClient(); @@ -1504,7 +1517,8 @@ public void loadFilePageWithExternalJS() throws Exception { FileUtils.writeStringToFile(tmpFileJS, "alert('foo')", encoding); // HTML file - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; final File tmpFile = File.createTempFile("test", ".html", currentDirectory); @@ -1528,7 +1542,7 @@ public void loadFilePageWithExternalJS() throws Exception { */ @Test public void onBeforeUnloadCalledOnCorrectPage() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; final List alerts = new ArrayList<>(); loadPage(html, alerts); assertTrue(alerts.isEmpty()); @@ -1542,7 +1556,7 @@ public void onBeforeUnloadCalledOnCorrectPage() throws Exception { @Test public void urlEncoding() throws Exception { final URL url = new URL("http://host/x+y\u00E9/a\u00E9 b?c \u00E9 d"); - final HtmlPage page = loadPage(BrowserVersion.FIREFOX, "", new ArrayList<>(), url); + final HtmlPage page = loadPage(BrowserVersion.FIREFOX, DOCTYPE_HTML + "", new ArrayList<>(), url); final WebRequest wrs = page.getWebResponse().getWebRequest(); assertEquals("http://host/x+y%C3%A9/a%C3%A9%20b?c%20%C3%A9%20d", wrs.getUrl()); } @@ -1555,7 +1569,8 @@ public void urlEncoding() throws Exception { @Test public void urlEncoding2() throws Exception { final URL url = new URL("http://host/x+y\u00E9/a\u00E9 b?c \u00E9 d"); - final HtmlPage page = loadPage(BrowserVersion.BEST_SUPPORTED, "", new ArrayList<>(), url); + final HtmlPage page = loadPage(BrowserVersion.BEST_SUPPORTED, + DOCTYPE_HTML + "", new ArrayList<>(), url); final WebRequest wrs = page.getWebResponse().getWebRequest(); assertEquals("http://host/x+y%C3%A9/a%C3%A9%20b?c%20%C3%A9%20d", wrs.getUrl()); } @@ -1567,7 +1582,7 @@ public void urlEncoding2() throws Exception { @Test public void plusNotEncodedInUrl() throws Exception { final URL url = new URL("http://host/search/my+category/"); - final HtmlPage page = loadPage("", new ArrayList<>(), url); + final HtmlPage page = loadPage(DOCTYPE_HTML + "", new ArrayList<>(), url); final WebRequest wrs = page.getWebResponse().getWebRequest(); assertEquals("http://host/search/my+category/", wrs.getUrl()); } @@ -1581,8 +1596,8 @@ public void cssEnablementControlsCssLoading() throws Exception { final MockWebConnection conn = new MockWebConnection(); client.setWebConnection(conn); - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n" + " \n" @@ -1619,7 +1634,7 @@ public void cssEnablementControlsCssLoading() throws Exception { public void getPageDataProtocol() throws Exception { final WebClient webClient = getWebClient(); - final String html = "DataUrl Test"; + final String html = DOCTYPE_HTML + "DataUrl Test"; final Page page = webClient.getPage("data:text/html;charset=utf-8," + html); assertEquals("DataUrl Test", ((HtmlPage) page).asNormalizedText()); @@ -1632,7 +1647,8 @@ public void getPageDataProtocol() throws Exception { public void getPageJavascriptProtocol() throws Exception { final WebClient webClient = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); - webConnection.setDefaultResponse("Hello World"); + webConnection.setDefaultResponse(DOCTYPE_HTML + + "Hello World"); webClient.setWebConnection(webConnection); final List collectedAlerts = new ArrayList<>(); @@ -1686,7 +1702,7 @@ public void javaScriptTimeout() throws Exception { try { client.getOptions().setThrowExceptionOnScriptError(false); - final String content = ""; + final String content = DOCTYPE_HTML + ""; final MockWebConnection webConnection = new MockWebConnection(); webConnection.setDefaultResponse(content); client.setWebConnection(webConnection); @@ -1737,7 +1753,7 @@ public void openWindowWithNullUrl() throws Exception { public void basicWindowTracking() throws Exception { // Create mock web connection. final MockWebConnection conn = new MockWebConnection(); - conn.setDefaultResponse("First\n" + "
\n" + "\n" + "
"; conn.setResponse(URL_FIRST, html1); - final String html2 = "Second\n" + final String html2 = DOCTYPE_HTML + + "Second\n" + "\n" + ""; @@ -1853,13 +1873,15 @@ public void windowTracking_SpecialCase3() throws Exception { final List collectedAlerts = new ArrayList<>(); webClient.setAlertHandler(new CollectingAlertHandler(collectedAlerts)); - final String html1 = "First\n" + final String html1 = DOCTYPE_HTML + + "First\n" + "\n" + "\n" + ""; conn.setResponse(URL_FIRST, html1); - final String html2 = "Second\n" + final String html2 = DOCTYPE_HTML + + "Second\n" + "\n" + "
\n" + "
\n" @@ -1874,7 +1896,8 @@ public void windowTracking_SpecialCase3() throws Exception { + ""; conn.setResponse(URL_SECOND, html2); - final String html3 = "Third\n" + final String html3 = DOCTYPE_HTML + + "Third\n" + "\n" + "\n" @@ -2052,12 +2078,13 @@ public void currentWindow() throws Exception { final WebClient client = getWebClient(); final MockWebConnection conn = new MockWebConnection(); - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; conn.setResponse(URL_FIRST, html); final URL frameUrl = new URL(URL_FIRST, "frame.html"); - conn.setResponse(frameUrl, ""); - conn.setResponse(URL_SECOND, ""); + conn.setResponse(frameUrl, DOCTYPE_HTML + ""); + conn.setResponse(URL_SECOND, DOCTYPE_HTML + ""); client.setWebConnection(conn); client.getPage(URL_FIRST); @@ -2076,7 +2103,8 @@ public void currentWindow() throws Exception { */ @Test public void currentWindow2() throws Exception { - final String html = "\n" + ""; - final String html2 = "\n" @@ -2272,7 +2303,8 @@ public void close() throws Exception { */ @Test public void test() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" @@ -2376,7 +2408,8 @@ public void webSocketDisabled() throws Exception { */ @Test public void loadHtmlCodeIntoCurrentWindow() throws Exception { - final String htmlCode = "" + final String htmlCode = DOCTYPE_HTML + + "" + " " + " Title" + " " @@ -2416,11 +2449,13 @@ public void loadXHtmlCodeIntoCurrentWindow() throws Exception { */ @Test public void reset() throws Exception { - final String html = "testpage\n" + final String html = DOCTYPE_HTML + + "testpage\n" + "\n" + ""; - final String html2 = "testpage\n" + final String html2 = DOCTYPE_HTML + + "testpage\n" + "\n" + "\n" + ""; @@ -2481,8 +2516,7 @@ public void reset() throws Exception { */ @Test public void loginFlowClickSubmitRedirect() throws Exception { - final String startPage = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String startPage = DOCTYPE_HTML + "Start page" + "
" + " " @@ -2492,8 +2526,7 @@ public void loginFlowClickSubmitRedirect() throws Exception { int reqCount = getMockWebConnection().getRequestCount(); - final String submitPage = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String submitPage = DOCTYPE_HTML + "Submit page" + "" + "" @@ -2508,8 +2541,7 @@ public void loginFlowClickSubmitRedirect() throws Exception { final URL urlRedirectPage = new URL(URL_FIRST, "redirect.html"); getMockWebConnection().setResponse(urlRedirectPage, "", 302, "Found", null, headers); - final String landingPage = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String landingPage = DOCTYPE_HTML + "Landing page" + ""; final URL urlLandingPage = new URL(URL_FIRST, "landing.html"); @@ -2543,7 +2575,8 @@ public void loginFlowClickSubmitRedirect() throws Exception { */ @Test public void getPageInSeparateThread() throws Exception { - final String html = "testpage\n" + final String html = DOCTYPE_HTML + + "testpage\n" + "\n" + ""; diff --git a/src/test/java/org/htmlunit/WebClientWaitForBackgroundJobsTest.java b/src/test/java/org/htmlunit/WebClientWaitForBackgroundJobsTest.java index 81e79ea3a8e..6759e1a2230 100644 --- a/src/test/java/org/htmlunit/WebClientWaitForBackgroundJobsTest.java +++ b/src/test/java/org/htmlunit/WebClientWaitForBackgroundJobsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,6 +14,9 @@ */ package org.htmlunit; +import static org.htmlunit.WebDriverTestCase.LOG_TITLE_FUNCTION; +import static org.htmlunit.WebDriverTestCase.LOG_WINDOW_NAME_FUNCTION; + import java.io.IOException; import java.net.URL; import java.util.ArrayList; @@ -24,18 +27,16 @@ import org.apache.commons.logging.LogFactory; import org.htmlunit.html.HtmlPage; import org.htmlunit.javascript.background.JavaScriptJobManager; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Tries; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junitpioneer.jupiter.RetryingTest; /** * Tests for {@link WebClient#waitForBackgroundJavaScriptStartingBefore(long)} and * {@link WebClient#waitForBackgroundJavaScript(long)}. * * @author Marc Guillemot + * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class WebClientWaitForBackgroundJobsTest extends SimpleWebTestCase { private long startTime_; @@ -59,16 +60,18 @@ private void assertMaxTestRunTime(final long maxRunTimeMilliseconds) { */ @Test public void dontWaitWhenUnnecessary() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + " test\n" + " \n" + "\n" @@ -76,8 +79,8 @@ public void dontWaitWhenUnnecessary() throws Exception { + "\n" + ""; - final List collectedAlerts = Collections.synchronizedList(new ArrayList()); - final HtmlPage page = loadPage(content, collectedAlerts); + final HtmlPage page = loadPage(content); + assertEquals("test", page.getTitleText()); final JavaScriptJobManager jobManager = page.getEnclosingWindow().getJobManager(); assertNotNull(jobManager); assertEquals(1, jobManager.getJobCount()); @@ -86,32 +89,33 @@ public void dontWaitWhenUnnecessary() throws Exception { assertEquals(1, page.getWebClient().waitForBackgroundJavaScriptStartingBefore(7000)); assertMaxTestRunTime(100); assertEquals(1, jobManager.getJobCount()); - assertEquals(Collections.EMPTY_LIST, collectedAlerts); + assertEquals("test", page.getTitleText()); } /** * @throws Exception if the test fails */ - @Test - @Tries(3) + @RetryingTest(3) public void dontWaitWhenUnnecessary_jobRemovesOtherJob() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + " test\n" + " \n" @@ -120,8 +124,8 @@ public void dontWaitWhenUnnecessary_jobRemovesOtherJob() throws Exception { + "\n" + ""; - final List collectedAlerts = Collections.synchronizedList(new ArrayList()); - final HtmlPage page = loadPage(content, collectedAlerts); + final HtmlPage page = loadPage(content); + assertEquals("test", page.getTitleText()); final JavaScriptJobManager jobManager = page.getEnclosingWindow().getJobManager(); assertNotNull(jobManager); assertEquals(3, jobManager.getJobCount()); @@ -131,8 +135,7 @@ public void dontWaitWhenUnnecessary_jobRemovesOtherJob() throws Exception { assertMaxTestRunTime(400); assertEquals(0, jobManager.getJobCount()); - final String[] expectedAlerts = {"clearLongTimeout", "hello"}; - assertEquals(expectedAlerts, collectedAlerts); + assertEquals("testclearLongTimeout§hello§", page.getTitleText()); } /** @@ -140,13 +143,14 @@ public void dontWaitWhenUnnecessary_jobRemovesOtherJob() throws Exception { * to wait for this job to finish, even if this clearXXX has been called for it. * @throws Exception if the test fails */ - @Test - @Tries(3) + @RetryingTest(3) public void waitCalledDuringJobExecution() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " test\n" + " \n" + "\n" @@ -182,10 +186,8 @@ public WebResponse getResponse(final WebRequest request) throws IOException { final WebClient client = getWebClient(); client.setWebConnection(webConnection); - final List collectedAlerts = Collections.synchronizedList(new ArrayList()); - client.setAlertHandler(new CollectingAlertHandler(collectedAlerts)); - final HtmlPage page = client.getPage(URL_FIRST); + assertEquals("test", page.getTitleText()); final JavaScriptJobManager jobManager = page.getEnclosingWindow().getJobManager(); assertNotNull(jobManager); assertEquals(1, jobManager.getJobCount()); @@ -196,8 +198,7 @@ public WebResponse getResponse(final WebRequest request) throws IOException { assertMaxTestRunTime(600); assertEquals(0, jobManager.getJobCount()); - final String[] expectedAlerts = {"end work"}; - assertEquals(expectedAlerts, collectedAlerts); + assertEquals("testend work§", page.getTitleText()); } /** @@ -208,19 +209,21 @@ public WebResponse getResponse(final WebRequest request) throws IOException { */ @Test public void waitWhenLastJobStartsNewOne() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " test\n" + " \n" + "\n" @@ -228,8 +231,8 @@ public void waitWhenLastJobStartsNewOne() throws Exception { + "\n" + ""; - final List collectedAlerts = Collections.synchronizedList(new ArrayList()); - final HtmlPage page = loadPage(html, collectedAlerts); + final HtmlPage page = loadPage(html); + assertEquals("test", page.getTitleText()); final JavaScriptJobManager jobManager = page.getEnclosingWindow().getJobManager(); assertNotNull(jobManager); assertEquals(1, jobManager.getJobCount()); @@ -239,8 +242,7 @@ public void waitWhenLastJobStartsNewOne() throws Exception { assertMaxTestRunTime(1000); assertEquals(0, jobManager.getJobCount()); - final String[] expectedAlerts = {"work1", "work2"}; - assertEquals(expectedAlerts, collectedAlerts); + assertEquals("testwork1§work2§", page.getTitleText()); } /** @@ -249,10 +251,10 @@ public void waitWhenLastJobStartsNewOne() throws Exception { * a few retries should be done to see if new jobs exists. * @throws Exception if the test fails */ - @Test - @Tries(3) + @RetryingTest(3) public void waitWithsubWindows() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " test\n" + "\n" @@ -260,15 +262,17 @@ public void waitWithsubWindows() throws Exception { + "\n" + "\n" + ""; - final String nested = "\n" + final String nested = DOCTYPE_HTML + + "\n" + "\n" + " nested\n" + " \n" + "\n" @@ -277,8 +281,6 @@ public void waitWithsubWindows() throws Exception { + ""; final WebClient client = getWebClient(); - final List collectedAlerts = Collections.synchronizedList(new ArrayList()); - client.setAlertHandler(new CollectingAlertHandler(collectedAlerts)); final MockWebConnection webConnection = new MockWebConnection(); webConnection.setResponse(URL_FIRST, html); @@ -287,6 +289,7 @@ public void waitWithsubWindows() throws Exception { client.setWebConnection(webConnection); final HtmlPage page = client.getPage(URL_FIRST); + assertEquals("", page.getEnclosingWindow().getName()); final JavaScriptJobManager jobManager = page.getEnclosingWindow().getJobManager(); assertNotNull(jobManager); @@ -297,8 +300,7 @@ public void waitWithsubWindows() throws Exception { assertMaxTestRunTime(300); assertEquals(0, jobManager.getJobCount()); - final String[] expectedAlerts = {"work1"}; - assertEquals(expectedAlerts, collectedAlerts); + assertEquals("work1§", page.getEnclosingWindow().getName()); } /** @@ -307,17 +309,18 @@ public void waitWithsubWindows() throws Exception { * . * @throws Exception if the test fails */ - @Test - @Tries(3) + @RetryingTest(3) public void newJobStartedAfterWait() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " test\n" + " \n" + "\n" @@ -354,10 +357,8 @@ public WebResponse getResponse(final WebRequest request) throws IOException { final WebClient client = getWebClient(); client.setWebConnection(webConnection); - final List collectedAlerts = Collections.synchronizedList(new ArrayList()); - client.setAlertHandler(new CollectingAlertHandler(collectedAlerts)); - final HtmlPage page = client.getPage(URL_FIRST); + assertEquals("test", page.getTitleText()); final JavaScriptJobManager jobManager = page.getEnclosingWindow().getJobManager(); assertNotNull(jobManager); assertEquals(1, jobManager.getJobCount()); @@ -368,8 +369,7 @@ public WebResponse getResponse(final WebRequest request) throws IOException { assertMaxTestRunTime(1000); assertEquals(0, jobManager.getJobCount()); - final String[] expectedAlerts = {"xhr onchange", "work1"}; - assertEquals(expectedAlerts, collectedAlerts); + assertEquals("testxhr onchange§work1§", page.getTitleText()); } /** @@ -379,12 +379,13 @@ public WebResponse getResponse(final WebRequest request) throws IOException { * jobs occurs when one of this job is not active. * @throws Exception if the test fails */ - @Test - @Tries(3) + @RetryingTest(3) public void waitForJobThatIsAlreadyLate() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" @@ -408,15 +409,13 @@ public void waitForJobThatIsAlreadyLate() throws Exception { final WebClient client = getWebClient(); client.setWebConnection(webConnection); - final List collectedAlerts = Collections.synchronizedList(new ArrayList()); - client.setAlertHandler(new CollectingAlertHandler(collectedAlerts)); - - client.getPage(URL_FIRST); + final HtmlPage page = client.getPage(URL_FIRST); + assertEquals("", page.getTitleText()); startTimedTest(); - assertEquals(0, client.waitForBackgroundJavaScriptStartingBefore(1000)); + assertEquals(0, client.waitForBackgroundJavaScriptStartingBefore(1_000)); assertMaxTestRunTime(1000); - assertEquals(51, collectedAlerts.size()); + assertTrue(page.getTitleText(), page.getTitleText().endsWith("work48§work49§work50§work51§")); } /** @@ -425,7 +424,8 @@ public void waitForJobThatIsAlreadyLate() throws Exception { */ @Test public void jobSchedulesJobInOtherWindow1() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" @@ -484,15 +486,14 @@ public void jobSchedulesJobInOtherWindow2() throws Exception { + "\n" + ""; - final List collectedAlerts = Collections.synchronizedList(new ArrayList()); - final HtmlPage page = loadPage(html, collectedAlerts); + final HtmlPage page = loadPage(html); + assertEquals("", page.getTitleText()); startTimedTest(); assertEquals(0, page.getWebClient().waitForBackgroundJavaScriptStartingBefore(1000)); assertMaxTestRunTime(1000); - final String[] expectedAlerts = {"work1", "work2"}; - assertEquals(expectedAlerts, collectedAlerts); + assertEquals("work1§work2§", page.getTitleText()); } /** @@ -503,13 +504,14 @@ public void jobSchedulesJobInOtherWindow2() throws Exception { * has not done its job correctly). * @throws Exception if the test fails */ - @Test - @Tries(3) + @RetryingTest(3) public void waitForBackgroundJavaScriptStartingBefore_hangs() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " test\n" + " \n" + ""; - final String page3 = ""; @@ -599,45 +606,116 @@ public WebResponse getResponse(final WebRequest request) throws IOException { final HtmlPage page = (HtmlPage) client.getCurrentWindow().getEnclosedPage(); assertEquals("page 4", page.getTitleText()); } -} -/** - * Helper to ensure some synchronization state between threads to reproduce a particular situation in the tests. - * @author Marc Guillemot - */ -class ThreadSynchronizer { - private String state_ = "initial"; - private static final Log LOG = LogFactory.getLog(ThreadSynchronizer.class); + /** + * @throws Exception if the test fails + */ + @Test + public void timeoutBeforeAllStartedJobsFinished() throws Exception { + final String html = DOCTYPE_HTML + + "\n" + + "\n" + + "\n" + + "\n" + + " \n" + + "\n" + + ""; + + final HtmlPage page = loadPage(html); + assertEquals("", page.getTitleText()); + + startTimedTest(); + assertEquals(1, page.getWebClient().waitForBackgroundJavaScriptStartingBefore(650, 700)); + assertMaxTestRunTime(800); - synchronized void setState(final String newState) { - state_ = newState; - notifyAll(); + assertTrue(page.getTitleText(), page.getTitleText().startsWith("work0§work1§")); } /** - * Just like {@link Thread#sleep(long)} but throws a {@link RuntimeException}. - * @param millis the time to sleep in milliseconds + * @throws Exception if the test fails */ - public void sleep(final long millis) { - try { - if (LOG.isDebugEnabled()) { - LOG.debug("Sleeping for " + millis + "ms"); - } - Thread.sleep(millis); - } - catch (final InterruptedException e) { - throw new RuntimeException(e); - } + @Test + public void timeoutDirectStartedJob() throws Exception { + final String html = DOCTYPE_HTML + + "\n" + + "\n" + + "\n" + + "\n" + + " \n" + + "\n" + + ""; + + final HtmlPage page = loadPage(html); + assertEquals("", page.getTitleText()); + + startTimedTest(); + assertEquals(1, page.getWebClient().waitForBackgroundJavaScriptStartingBefore(400, 1000)); + assertMaxTestRunTime(1100); + + assertTrue(page.getTitleText(), page.getTitleText().startsWith("work0§")); } - synchronized void waitForState(final String expectedState) { - try { - while (!state_.equals(expectedState)) { - wait(); + /** + * Helper to ensure some synchronization state between threads + * to reproduce a particular situation in the tests. + */ + static class ThreadSynchronizer { + private String state_ = "initial"; + private static final Log LOG = LogFactory.getLog(ThreadSynchronizer.class); + + synchronized void setState(final String newState) { + state_ = newState; + notifyAll(); + } + + /** + * Just like {@link Thread#sleep(long)} but throws a {@link RuntimeException}. + * @param millis the time to sleep in milliseconds + */ + public void sleep(final long millis) { + try { + if (LOG.isDebugEnabled()) { + LOG.debug("Sleeping for " + millis + "ms"); + } + Thread.sleep(millis); + } + catch (final InterruptedException e) { + throw new RuntimeException(e); } } - catch (final InterruptedException e) { - throw new RuntimeException(e); + + synchronized void waitForState(final String expectedState) { + try { + while (!state_.equals(expectedState)) { + wait(); + } + } + catch (final InterruptedException e) { + throw new RuntimeException(e); + } } } } diff --git a/src/test/java/org/htmlunit/WebDriverTestCase.java b/src/test/java/org/htmlunit/WebDriverTestCase.java index e1c2e2f09a6..a87d25fbf6f 100644 --- a/src/test/java/org/htmlunit/WebDriverTestCase.java +++ b/src/test/java/org/htmlunit/WebDriverTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ import static java.nio.charset.StandardCharsets.ISO_8859_1; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.junit.Assert.fail; import java.io.File; import java.io.FileInputStream; @@ -24,6 +23,7 @@ import java.net.URISyntaxException; import java.net.URL; import java.nio.charset.Charset; +import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -67,14 +67,12 @@ import org.eclipse.jetty.webapp.WebAppContext; import org.htmlunit.MockWebConnection.RawResponseData; import org.htmlunit.html.HtmlElement; -import org.htmlunit.html.HtmlPageTest; import org.htmlunit.javascript.JavaScriptEngine; import org.htmlunit.util.NameValuePair; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.ComparisonFailure; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; import org.openqa.selenium.Alert; import org.openqa.selenium.By; import org.openqa.selenium.Dimension; @@ -90,7 +88,7 @@ import org.openqa.selenium.chrome.ChromeDriverService; import org.openqa.selenium.chrome.ChromeOptions; import org.openqa.selenium.devtools.DevTools; -import org.openqa.selenium.devtools.v85.emulation.Emulation; +import org.openqa.selenium.devtools.v138.emulation.Emulation; import org.openqa.selenium.edge.EdgeDriver; import org.openqa.selenium.edge.EdgeDriverService; import org.openqa.selenium.edge.EdgeOptions; @@ -110,30 +108,49 @@ * * By default, this test runs with HtmlUnit, but this behavior can be changed by having a property file named * "{@code test.properties}" in the HtmlUnit root directory. - * Sample: + * Sample (remove the part not matching your os): *
-   browsers=hu,ff,ie
-   chrome.bin=/path/to/chromedriver                     [Unix-like]
-   ff-esr.bin=/usr/bin/firefox                          [Unix-like]
-   ie.bin=C:\\path\\to\\32bit\\IEDriverServer.exe       [Windows]
-   edge.bin=C:\\path\\to\\msedgedriver.exe              [Windows]
-   autofix=true
+   browsers=hu,ff,chrome
+
+   ff.bin=/usr/bin/firefox                              [Unix]
+   ff-esr.bin=/usr/bin/firefox-esr                      [Unix]
+   geckodriver.bin=/usr/bin/driver/geckodriver          [Unix]
+   chrome.bin=/path/to/chromedriver                     [Unix]
+   edge.bin=/path/to/chromedriver                       [Unix]
+
+   geckodriver.bin=C:\\path\\to\\geckodriver.exe              [Windows]
+   ff.bin=C:\\path\\to\\Mozilla Firefox\\firefox.exe          [Windows]
+   ff-esr.bin=C:\\path\\to\\Mozilla Firefox ESR\\firefox.exe  [Windows]
+   chrome.bin=C:\\path\\to\\chromedriver.exe                  [Windows]
+   edge.bin=C:\\path\\to\\msedgedriver.exe                    [Windows]
+
+   autofix=false
    
+ * The file could contain some properties: *
    - *
  • browsers: is a comma separated list contains any combination of "hu" (for HtmlUnit with all browser versions), - * "hu-ff", "hu-ff-esr", "ff", "chrome", which will be used to drive real browsers
  • + *
  • browsers: is a comma separated list contains any combination of + *
      + *
    • hu (for HtmlUnit with all browser versions),
    • + *
    • hu-ff,
    • + *
    • hu-ff-esr,
    • + *
    • hu-chrome,
    • + *
    • hu-edge,
    • + *
    • ff, (running test using real Firefox),
    • + *
    • ff-esr, (running test using real Firefox ESR),
    • + *
    • chrome (running test using real Chrome),
    • + *
    • edge (running test using real Edge),
    • + *
    + *
  • * *
  • chrome.bin (mandatory if it does not exist in the path): is the location of the ChromeDriver binary (see - * Chrome Driver downloads)
  • + * Chrome Driver downloads) *
  • geckodriver.bin (mandatory if it does not exist in the path): is the location of the GeckoDriver binary - * (see Gecko Driver Usage)
  • + * (see Gecko Driver Releases) *
  • ff.bin (optional): is the location of the FF binary, in Windows use double back-slashes
  • *
  • ff-esr.bin (optional): is the location of the FF binary, in Windows use double back-slashes
  • - *
  • ie.bin (mandatory if it does not exist in the path): is the location of the IEDriverServer binary (see - * IEDriverServer downloads)
  • *
  • edge.bin (mandatory if it does not exist in the path): is the location of the MicrosoftWebDriver binary - * (see MicrosoftWebDriver downloads)
  • + * (see Microsoft Edge WebDriver downloads) *
  • autofix (optional): if {@code true}, try to automatically fix the real browser expectations, * or add/remove {@code @NotYetImplemented} annotations, use with caution!
  • *
@@ -145,11 +162,33 @@ */ public abstract class WebDriverTestCase extends WebTestCase { + private static final String LOG_EX_FUNCTION = + " function logEx(e) {\n" + + " let toStr = null;\n" + + " if (toStr === null && e instanceof EvalError) { toStr = ''; }\n" + + " if (toStr === null && e instanceof RangeError) { toStr = ''; }\n" + + " if (toStr === null && e instanceof ReferenceError) { toStr = ''; }\n" + + " if (toStr === null && e instanceof SyntaxError) { toStr = ''; }\n" + + " if (toStr === null && e instanceof TypeError) { toStr = ''; }\n" + + " if (toStr === null && e instanceof URIError) { toStr = ''; }\n" + + " if (toStr === null && e instanceof AggregateError) { toStr = '/AggregateError'; }\n" + + " if (toStr === null && typeof InternalError == 'function' " + + "&& e instanceof InternalError) { toStr = '/InternalError'; }\n" + + " if (toStr === null) {\n" + + " let rx = /\\[object (.*)\\]/;\n" + + " toStr = Object.prototype.toString.call(e);\n" + + " let match = rx.exec(toStr);\n" + + " if (match != null) { toStr = '/' + match[1]; }\n" + + " }" + + " log(e.name + toStr);\n" + + "}\n"; + /** * Function used in many tests. */ public static final String LOG_TITLE_FUNCTION = - " function log(msg) { window.document.title += msg + '\\u00a7'; }\n"; + " function log(msg) { window.document.title += msg + '\\u00a7'; }\n" + + LOG_EX_FUNCTION; /** * Function used in many tests. @@ -162,13 +201,17 @@ public abstract class WebDriverTestCase extends WebTestCase { + "msg = msg.replace(/\\r/g, '\\\\r'); " + "msg = msg.replace(/\\t/g, '\\\\t'); " + "msg = msg.replace(/\\u001e/g, '\\\\u001e'); " - + "window.document.title += msg + '\u00A7';}\n"; + + "window.document.title += msg + '\u00A7';}\n" + + + LOG_EX_FUNCTION; /** * Function used in many tests. */ public static final String LOG_WINDOW_NAME_FUNCTION = - " function log(msg) { window.top.name += msg + '\\u00a7'; }\n window.top.name = '';"; + " function log(msg) { window.top.name += msg + '\\u00a7'; }\n" + + " window.top.name = '';" + + LOG_EX_FUNCTION; /** * Function used in many tests. @@ -182,7 +225,8 @@ public abstract class WebDriverTestCase extends WebTestCase { * Function used in many tests. */ public static final String LOG_TEXTAREA_FUNCTION = " function log(msg) { " - + "document.getElementById('myLog').value += msg + '\u00A7';}\n"; + + "document.getElementById('myLog').value += msg + '\u00A7';}\n" + + LOG_EX_FUNCTION; /** * HtmlSniped to insert text area used for logging. @@ -241,7 +285,6 @@ public abstract class WebDriverTestCase extends WebTestCase { private static final Executor EXECUTOR_POOL = Executors.newFixedThreadPool(4); private boolean useRealBrowser_; - private Boolean useStandards_; /** * The HtmlUnitDriver. @@ -256,6 +299,9 @@ protected boolean needThreeConnections() { return false; } + /** + * @return the browser properties (and initializes them lazy) + */ public static Set getBrowsersProperties() { if (BROWSERS_PROPERTIES_ == null) { try { @@ -367,7 +413,7 @@ protected WebDriver getWebDriver() { * Closes the drivers. * @throws Exception If an error occurs */ - @AfterClass + @AfterAll public static void shutDownAll() throws Exception { for (final WebDriver driver : WEB_DRIVERS_.values()) { driver.quit(); @@ -432,9 +478,9 @@ private static void quit(final WebDriver driver) { * @throws Exception if it fails */ protected static void assertWebServersStopped() throws Exception { - Assert.assertNull(STATIC_SERVER_STARTER_, STATIC_SERVER_); - Assert.assertNull(STATIC_SERVER2_STARTER_, STATIC_SERVER2_); - Assert.assertNull(STATIC_SERVER3_STARTER_, STATIC_SERVER3_); + Assertions.assertNull(STATIC_SERVER_, STATIC_SERVER_STARTER_); + Assertions.assertNull(STATIC_SERVER2_, STATIC_SERVER2_STARTER_); + Assertions.assertNull(STATIC_SERVER3_, STATIC_SERVER3_STARTER_); } /** @@ -465,7 +511,7 @@ protected static void stopWebServers() throws Exception { /** * @return whether to use real browser or not. */ - protected boolean useRealBrowser() { + public boolean useRealBrowser() { return useRealBrowser_; } @@ -477,14 +523,6 @@ public void setUseRealBrowser(final boolean useRealBrowser) { useRealBrowser_ = useRealBrowser; } - /** - * Sets whether to use {@code Standards Mode} or not. - * @param useStandards whether to use {@code Standards Mode} or not - */ - public void setUseStandards(final boolean useStandards) { - useStandards_ = useStandards; - } - /** * Builds a new WebDriver instance. * @return the instance @@ -506,9 +544,11 @@ protected WebDriver buildWebDriver() throws IOException { final EdgeOptions options = new EdgeOptions(); // BiDi - options.setCapability("webSocketUrl", true); + // options.setCapability("webSocketUrl", true); options.addArguments("--lang=" + locale); + // https://stackoverflow.com/questions/11289597/webdriver-how-to-specify-preferred-languages-for-chrome + options.setExperimentalOption("prefs", Map.of("intl.accept_languages", locale)); options.addArguments("--remote-allow-origins=*"); // seems to be not required for edge @@ -542,9 +582,11 @@ protected WebDriver buildWebDriver() throws IOException { final ChromeOptions options = new ChromeOptions(); // BiDi - options.setCapability("webSocketUrl", true); + // options.setCapability("webSocketUrl", true); options.addArguments("--lang=" + locale); + // https://stackoverflow.com/questions/11289597/webdriver-how-to-specify-preferred-languages-for-chrome + options.setExperimentalOption("prefs", Map.of("intl.accept_languages", locale)); options.addArguments("--remote-allow-origins=*"); options.addArguments("--disable-search-engine-choice-screen"); // see https://www.selenium.dev/blog/2024/chrome-browser-woes/ @@ -597,7 +639,7 @@ private FirefoxDriver createFirefoxDriver(final String geckodriverBinary, final final FirefoxOptions options = new FirefoxOptions(); // BiDi - options.setCapability("webSocketUrl", true); + // options.setCapability("webSocketUrl", true); options.setBinary(binary); @@ -614,16 +656,6 @@ private FirefoxDriver createFirefoxDriver(final String geckodriverBinary, final return new FirefoxDriver(service, options); } - private static String getBrowserName(final BrowserVersion browserVersion) { - if (browserVersion == BrowserVersion.FIREFOX) { - return browserVersion.getNickname() + '-' + browserVersion.getBrowserVersionNumeric(); - } - if (browserVersion == BrowserVersion.FIREFOX_ESR) { - return browserVersion.getNickname() + '-' + browserVersion.getBrowserVersionNumeric(); - } - return browserVersion.getNickname(); - } - /** * Starts the web server delivering response from the provided connection. * @param mockConnection the sources for responses @@ -951,18 +983,9 @@ protected final WebDriver loadPage2(final String html, final URL url, * @return the web driver * @throws Exception if something goes wrong */ - protected final WebDriver loadPage2(String html, final URL url, + protected final WebDriver loadPage2(final String html, final URL url, final String contentType, final Charset charset, final Charset serverCharset) throws Exception { - if (useStandards_ != null) { - if (html.startsWith(HtmlPageTest.STANDARDS_MODE_PREFIX_)) { - fail("HTML must not be prefixed with Standards Mode."); - } - if (useStandards_) { - html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + html; - } - } getMockWebConnection().setResponse(url, html, contentType, charset); - return loadPage2(url, serverCharset); } @@ -1095,20 +1118,30 @@ protected final WebDriver loadPageVerifyTitle2(final String html, final String.. return verifyTitle2(driver, expectedAlerts); } - protected final WebDriver verifyTitle2(final long maxWaitTime, final WebDriver driver, + protected final WebDriver verifyTitle2(final Duration maxWaitTime, final WebDriver driver, final String... expectedAlerts) throws Exception { - final long maxWait = System.currentTimeMillis() + maxWaitTime; + + final StringBuilder expected = new StringBuilder(); + for (int i = 0; i < expectedAlerts.length; i++) { + expected.append(expectedAlerts[i]).append('\u00A7'); + } + final String expectedTitle = expected.toString(); + + final long maxWait = System.currentTimeMillis() + maxWaitTime.toMillis(); while (System.currentTimeMillis() < maxWait) { try { - return verifyTitle2(driver, expectedAlerts); + final String title = driver.getTitle(); + assertEquals(expectedTitle, title); + return driver; } catch (final AssertionError e) { // ignore and wait } } - return verifyTitle2(driver, expectedAlerts); + assertEquals(expectedTitle, driver.getTitle()); + return driver; } protected final WebDriver verifyTitle2(final WebDriver driver, @@ -1152,14 +1185,14 @@ protected final WebDriver verifyTextArea2(final WebDriver driver, final WebElement textArea = driver.findElement(By.id("myLog")); if (expectedAlerts.length == 0) { - assertEquals("", textArea.getAttribute("value")); + assertEquals("", textArea.getDomProperty("value")); return driver; } if (!useRealBrowser() && expectedAlerts.length == 1 && expectedAlerts[0].startsWith("data:image/png;base64,")) { - String value = textArea.getAttribute("value"); + String value = textArea.getDomProperty("value"); if (value.endsWith("\u00A7")) { value = value.substring(0, value.length() - 1); } @@ -1171,7 +1204,7 @@ protected final WebDriver verifyTextArea2(final WebDriver driver, for (int i = 0; i < expectedAlerts.length; i++) { expected.append(expectedAlerts[i]).append('\u00A7'); } - verify(() -> textArea.getAttribute("value"), expected.toString()); + verify(() -> textArea.getDomProperty("value"), expected.toString()); return driver; } @@ -1191,9 +1224,9 @@ protected final WebDriver verifyJsVariable(final WebDriver driver, final String return driver; } - protected final WebDriver verifyWindowName2(final long maxWaitTime, final WebDriver driver, + protected final WebDriver verifyWindowName2(final Duration maxWaitTime, final WebDriver driver, final String... expectedAlerts) throws Exception { - final long maxWait = System.currentTimeMillis() + maxWaitTime; + final long maxWait = System.currentTimeMillis() + maxWaitTime.toMillis(); while (System.currentTimeMillis() < maxWait) { try { @@ -1236,7 +1269,7 @@ protected final WebDriver verifySessionStorage2(final WebDriver driver, * @return the web driver * @throws Exception if something goes wrong */ - protected final WebDriver loadPageWithAlerts2(final String html, final long maxWaitTime) throws Exception { + protected final WebDriver loadPageWithAlerts2(final String html, final Duration maxWaitTime) throws Exception { return loadPageWithAlerts2(html, URL_FIRST, maxWaitTime); } @@ -1259,7 +1292,7 @@ protected final WebDriver loadPageWithAlerts2(final String html, final URL url) * @return the web driver * @throws Exception if something goes wrong */ - protected final WebDriver loadPageWithAlerts2(final String html, final URL url, final long maxWaitTime) + protected final WebDriver loadPageWithAlerts2(final String html, final URL url, final Duration maxWaitTime) throws Exception { final WebDriver driver = loadPage2(html, url); @@ -1285,7 +1318,7 @@ protected void verifyAlerts(final WebDriver driver, final String... expectedAler * @param expected the expected alerts * @throws Exception in case of failure */ - protected void verifyAlerts(final long maxWaitTime, final WebDriver driver, final String... expected) + protected void verifyAlerts(final Duration maxWaitTime, final WebDriver driver, final String... expected) throws Exception { final List actualAlerts = getCollectedAlerts(maxWaitTime, driver, expected.length); @@ -1333,7 +1366,7 @@ protected final WebDriver loadPageWithAlerts2(final String html, * @return the web driver * @throws Exception if something goes wrong */ - protected final WebDriver loadPageWithAlerts2(final String html, final URL url, final long maxWaitTime, + protected final WebDriver loadPageWithAlerts2(final String html, final URL url, final Duration maxWaitTime, final Map> servlets) throws Exception { expandExpectedAlertsVariables(URL_FIRST); @@ -1362,7 +1395,7 @@ protected final WebDriver loadPageWithAlerts2(final URL url) throws Exception { * @return the web driver * @throws Exception if something goes wrong */ - protected final WebDriver loadPageWithAlerts2(final URL url, final long maxWaitTime) throws Exception { + protected final WebDriver loadPageWithAlerts2(final URL url, final Duration maxWaitTime) throws Exception { startWebServer(getMockWebConnection(), null); final WebDriver driver = getWebDriver(); @@ -1404,11 +1437,11 @@ protected List getCollectedAlerts(final WebDriver driver, final int aler * @return the collected alerts * @throws Exception in case of problem */ - protected List getCollectedAlerts(final long maxWaitTime, final WebDriver driver, final int alertsLength) - throws Exception { + protected List getCollectedAlerts(final Duration maxWaitTime, + final WebDriver driver, final int alertsLength) throws Exception { final List collectedAlerts = new ArrayList<>(); - long maxWait = System.currentTimeMillis() + maxWaitTime; + long maxWait = System.currentTimeMillis() + maxWaitTime.toMillis(); while (collectedAlerts.size() < alertsLength && System.currentTimeMillis() < maxWait) { try { @@ -1478,21 +1511,22 @@ protected String loadExpectation(final String resourcePrefix, final String resou // check for duplicates if (realBrowserNyiExpectation != null) { if (realNyiExpectation != null) { - Assert.assertNotEquals("Duplicate NYI Expectation for Browser " + browserVersion.getNickname(), - realBrowserNyiExpectation, realNyiExpectation); + Assertions.assertNotEquals(realBrowserNyiExpectation, realNyiExpectation, + "Duplicate NYI Expectation for Browser " + browserVersion.getNickname()); } if (browserExpectation == null) { if (expectation != null) { - Assert.assertNotEquals("NYI Expectation matches the expected " - + "result for Browser " + browserVersion.getNickname(), - realBrowserNyiExpectation, expectation); + Assertions.assertNotEquals(realBrowserNyiExpectation, expectation, + "NYI Expectation matches the expected " + + "result for Browser " + browserVersion.getNickname()); } } else { - Assert.assertNotEquals("NYI Expectation matches the expected " - + "browser specific result for Browser " + browserVersion.getNickname(), - realBrowserNyiExpectation, browserExpectation); + Assertions.assertNotEquals(realBrowserNyiExpectation, browserExpectation, + "NYI Expectation matches the expected " + + "browser specific result for Browser " + + browserVersion.getNickname()); } return realBrowserNyiExpectation; @@ -1501,24 +1535,25 @@ protected String loadExpectation(final String resourcePrefix, final String resou if (realNyiExpectation != null) { if (browserExpectation == null) { if (expectation != null) { - Assert.assertNotEquals("NYI Expectation matches the expected " - + "result for Browser " + browserVersion.getNickname(), - realNyiExpectation, expectation); + Assertions.assertNotEquals(realNyiExpectation, expectation, + "NYI Expectation matches the expected " + + "result for Browser " + browserVersion.getNickname()); } } else { - Assert.assertNotEquals("NYI Expectation matches the expected " - + "browser specific result for Browser " + browserVersion.getNickname(), - realNyiExpectation, browserExpectation); + Assertions.assertNotEquals(realNyiExpectation, browserExpectation, + "NYI Expectation matches the expected " + + "browser specific result for Browser " + + browserVersion.getNickname()); } return realNyiExpectation; } if (browserExpectation != null) { if (expectation != null) { - Assert.assertNotEquals("Browser specific NYI Expectation matches the expected " - + "result for Browser " + browserVersion.getNickname(), - browserExpectation, expectation); + Assertions.assertNotEquals(browserExpectation, expectation, + "Browser specific NYI Expectation matches the expected " + + "result for Browser " + browserVersion.getNickname()); } return browserExpectation; } @@ -1541,7 +1576,7 @@ private static String loadContent(final URL url) throws URISyntaxException, IOEx * This should be always 0, if {@link #isWebClientCached()} is {@code false}. * @throws InterruptedException in case of problems */ - @Before + @BeforeEach public void beforeTest() throws InterruptedException { if (!isWebClientCached()) { if (!getJavaScriptThreads().isEmpty()) { @@ -1558,7 +1593,7 @@ public void beforeTest() throws InterruptedException { * @throws Exception in case of failure */ protected void assertTitle(final WebDriver webdriver, final String expected) throws Exception { - final long maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME; + final long maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME.toMillis(); while (true) { final String title = webdriver.getTitle(); @@ -1566,7 +1601,7 @@ protected void assertTitle(final WebDriver webdriver, final String expected) thr assertEquals(expected, title); return; } - catch (final ComparisonFailure e) { + catch (final org.opentest4j.AssertionFailedError e) { if (expected.length() <= title.length() || System.currentTimeMillis() > maxWait) { throw e; @@ -1580,7 +1615,7 @@ protected void assertTitle(final WebDriver webdriver, final String expected) thr * Release resources but DON'T close the browser if we are running with a real browser. * Note that HtmlUnitDriver is not cached by default, but that can be configured by {@link #isWebClientCached()}. */ - @After + @AfterEach @Override public void releaseResources() { final List unhandledAlerts = new ArrayList<>(); diff --git a/src/test/java/org/htmlunit/WebRequest2Test.java b/src/test/java/org/htmlunit/WebRequest2Test.java index 6a776fc3dc3..0523278c68b 100644 --- a/src/test/java/org/htmlunit/WebRequest2Test.java +++ b/src/test/java/org/htmlunit/WebRequest2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,11 +29,9 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.htmlunit.junit.BrowserRunner; import org.htmlunit.util.NameValuePair; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * Tests for {@link WebRequest#getParameters()}. @@ -46,14 +44,13 @@ * * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class WebRequest2Test extends WebServerTestCase { /** * Performs pre-test construction. * @throws Exception if an error occurs */ - @Before + @BeforeEach public void setup() throws Exception { // we have to stop all servers running already to free the port WebDriverTestCase.stopWebServers(); @@ -186,6 +183,9 @@ public void getParametersFromQueryAndUrlEncodedBodyPost() throws Exception { assertEquals("d", parameters.get(1).getValue()); } + /** + * @throws Exception if the test fails + */ @Test public void getParametersFromQueryAndUrlEncodedBodyPostWhenEncodingTypeIsMultipart() throws Exception { final URL url = new URL(URL_FIRST, "?a=b"); @@ -206,6 +206,9 @@ public void getParametersFromQueryAndUrlEncodedBodyPostWhenEncodingTypeIsMultipa assertEquals("d", parameters.get(1).getValue()); } + /** + * @throws Exception if the test fails + */ @Test public void getParametersUrlEncodedPostNoBody() throws Exception { final URL url = new URL(URL_FIRST, "?a=b"); @@ -223,6 +226,9 @@ public void getParametersUrlEncodedPostNoBody() throws Exception { assertEquals("b", parameters.get(0).getValue()); } + /** + * @throws Exception if the test fails + */ @Test public void getParametersTextEncodedPostNoBody() throws Exception { final URL url = new URL(URL_FIRST, "?a=b"); @@ -240,6 +246,9 @@ public void getParametersTextEncodedPostNoBody() throws Exception { assertEquals("b", parameters.get(0).getValue()); } + /** + * @throws Exception if the test fails + */ @Test public void getParametersTextEncodedPostBody() throws Exception { final URL url = new URL(URL_FIRST, "?a=b"); diff --git a/src/test/java/org/htmlunit/WebRequestTest.java b/src/test/java/org/htmlunit/WebRequestTest.java index ac07ae40c53..1cf4931f7f9 100644 --- a/src/test/java/org/htmlunit/WebRequestTest.java +++ b/src/test/java/org/htmlunit/WebRequestTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,8 +15,8 @@ package org.htmlunit; import static org.htmlunit.WebTestCase.URL_FIRST; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; import java.net.URL; import java.nio.charset.StandardCharsets; @@ -24,7 +24,7 @@ import org.apache.commons.lang3.SerializationUtils; import org.apache.http.auth.BasicUserPrincipal; import org.apache.http.auth.Credentials; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Tests for {@link WebRequest}. @@ -161,7 +161,7 @@ public void credentialsAndEmptyPath() throws Exception { final URL url = new URL("http://john.smith:secret@localhost"); final WebRequest request = new WebRequest(url); final Credentials credentials = request.getUrlCredentials(); - assertNotNull("Credentials object is null", credentials); + assertNotNull(credentials, "Credentials object is null"); assertEquals(new BasicUserPrincipal("john.smith"), credentials.getUserPrincipal()); assertEquals("secret", credentials.getPassword()); } @@ -174,7 +174,7 @@ public void credentialsAndPathWithDots() throws Exception { final URL url = new URL("http://john.smith:secret@localhost/../foo.html"); final WebRequest request = new WebRequest(url); final Credentials credentials = request.getUrlCredentials(); - assertNotNull("Credentials object is null", credentials); + assertNotNull(credentials, "Credentials object is null"); assertEquals(new BasicUserPrincipal("john.smith"), credentials.getUserPrincipal()); assertEquals("secret", credentials.getPassword()); } @@ -187,7 +187,7 @@ public void credentialsAndInternationalizedDomainName() throws Exception { final URL url = new URL("http://john.smith:secret@löcälhöst/"); final WebRequest request = new WebRequest(url); final Credentials credentials = request.getUrlCredentials(); - assertNotNull("Credentials object is null", credentials); + assertNotNull(credentials, "Credentials object is null"); assertEquals(new BasicUserPrincipal("john.smith"), credentials.getUserPrincipal()); assertEquals("secret", credentials.getPassword()); } diff --git a/src/test/java/org/htmlunit/WebResponse2Test.java b/src/test/java/org/htmlunit/WebResponse2Test.java index 79f6c434fe4..03fad4bac51 100644 --- a/src/test/java/org/htmlunit/WebResponse2Test.java +++ b/src/test/java/org/htmlunit/WebResponse2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,11 +22,9 @@ import java.util.Map; import org.htmlunit.html.HtmlPage; -import org.htmlunit.junit.BrowserRunner; import org.htmlunit.util.MimeType; import org.htmlunit.util.mocks.WebResponseMock; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Tests for {@link WebResponse}. @@ -34,7 +32,6 @@ * @author Marc Guillemot * @author Ahmed Ashour */ -@RunWith(BrowserRunner.class) public class WebResponse2Test extends SimpleWebTestCase { /** @@ -42,13 +39,13 @@ public class WebResponse2Test extends SimpleWebTestCase { */ @Test public void charsetInMetaTag() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "foo\n" + ""; final HtmlPage page = loadPage(html); - assertSame(UTF_8, page.getWebResponse().getContentCharsetOrNull()); + assertSame(UTF_8, page.getWebResponse().getContentCharset()); assertEquals(html, page.getWebResponse().getContentAsString()); } diff --git a/src/test/java/org/htmlunit/WebResponseData2Test.java b/src/test/java/org/htmlunit/WebResponseData2Test.java index ba2687af019..ecc13210558 100644 --- a/src/test/java/org/htmlunit/WebResponseData2Test.java +++ b/src/test/java/org/htmlunit/WebResponseData2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,9 +14,7 @@ */ package org.htmlunit; -import org.htmlunit.junit.BrowserRunner; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Tests for {@link WebResponseData}. @@ -24,7 +22,6 @@ * @author Daniel Gredler * @author Ahmed Ashour */ -@RunWith(BrowserRunner.class) public class WebResponseData2Test extends SimpleWebTestCase { /** diff --git a/src/test/java/org/htmlunit/WebResponseDataTest.java b/src/test/java/org/htmlunit/WebResponseDataTest.java index 5b082206cae..f903656030a 100644 --- a/src/test/java/org/htmlunit/WebResponseDataTest.java +++ b/src/test/java/org/htmlunit/WebResponseDataTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,11 +34,9 @@ import org.apache.commons.lang3.StringUtils; import org.htmlunit.html.HtmlPage; import org.htmlunit.http.HttpStatus; -import org.htmlunit.junit.BrowserRunner; import org.htmlunit.util.MimeType; import org.htmlunit.util.NameValuePair; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Tests for {@link WebResponseData}. @@ -47,7 +45,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class WebResponseDataTest extends WebServerTestCase { private static final String GZIPPED_FILE = "testfiles/test.html.gz"; diff --git a/src/test/java/org/htmlunit/WebResponseTest.java b/src/test/java/org/htmlunit/WebResponseTest.java index 276be329ecb..8e6e821d9b9 100644 --- a/src/test/java/org/htmlunit/WebResponseTest.java +++ b/src/test/java/org/htmlunit/WebResponseTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,12 +35,10 @@ import org.htmlunit.html.HtmlPage; import org.htmlunit.http.HttpStatus; -import org.htmlunit.junit.BrowserRunner; import org.htmlunit.util.MimeType; import org.htmlunit.util.NameValuePair; -import org.junit.After; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; /** * Tests for {@link WebResponse}. @@ -50,7 +48,6 @@ * @author Ronald Brill * @author Lai Quang Duong */ -@RunWith(BrowserRunner.class) public class WebResponseTest extends WebServerTestCase { /** @@ -59,8 +56,8 @@ public class WebResponseTest extends WebServerTestCase { @Test public void encodingCharsetUtf8() throws Exception { final String title = "\u6211\u662F\u6211\u7684FOCUS"; - final String content = - "\n" + final String content = DOCTYPE_HTML + + "\n" + "" + title + "\n" + "\n" + "\n" @@ -178,7 +175,8 @@ public void getContentAsStringIllegalCharset() throws Exception { * Servlet for {@link #binaryResponseHeaders()}. */ public static class BinaryResponseHeadersServlet extends HttpServlet { - private static final String RESPONSE = "FooThis is foo!"; + private static final String RESPONSE = DOCTYPE_HTML + + "FooThis is foo!"; /** * {@inheritDoc} @@ -218,14 +216,14 @@ public void binaryResponseHeaders() throws Exception { page.getWebResponse().getContentAsString(UTF_8)); assertEquals("gzip", page.getWebResponse().getResponseHeaderValue("Content-Encoding")); - assertEquals("73", page.getWebResponse().getResponseHeaderValue(HttpHeader.CONTENT_LENGTH)); + assertEquals("85", page.getWebResponse().getResponseHeaderValue(HttpHeader.CONTENT_LENGTH)); } /** * Stop the WebServer. * @throws Exception if it fails */ - @After + @AfterEach public void stopServer() throws Exception { stopWebServer(); } diff --git a/src/test/java/org/htmlunit/WebServerTestCase.java b/src/test/java/org/htmlunit/WebServerTestCase.java index 86721dab290..2c80978164c 100644 --- a/src/test/java/org/htmlunit/WebServerTestCase.java +++ b/src/test/java/org/htmlunit/WebServerTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ import java.net.BindException; import java.net.URL; import java.nio.charset.Charset; +import java.time.Duration; import java.util.List; import java.util.Map; @@ -48,7 +49,7 @@ import org.htmlunit.WebDriverTestCase.MockWebConnectionServlet; import org.htmlunit.html.HtmlPage; import org.htmlunit.util.MimeType; -import org.junit.After; +import org.junit.jupiter.api.AfterEach; /** * A WebTestCase which starts a local server, and doens't use WebDriver. @@ -235,7 +236,7 @@ protected void startWebServer(final String resourceBase, final String[] classpat * Performs post-test deconstruction. * @throws Exception if an error occurs */ - @After + @AfterEach public void tearDown() throws Exception { if (server_ != null) { server_.stop(); @@ -256,7 +257,7 @@ public void tearDown() throws Exception { */ protected final HtmlPage loadPageWithAlerts(final String html, final URL url) throws Exception { - return loadPageWithAlerts(html, url, 0); + return loadPageWithAlerts(html, url, Duration.ofSeconds(0)); } /** @@ -267,7 +268,7 @@ protected final HtmlPage loadPageWithAlerts(final String html, final URL url) * @return the page * @throws Exception if something goes wrong */ - protected final HtmlPage loadPageWithAlerts(final String html, final URL url, final long maxWaitTime) + protected final HtmlPage loadPageWithAlerts(final String html, final URL url, final Duration maxWaitTime) throws Exception { alertHandler_.clear(); expandExpectedAlertsVariables(URL_FIRST); @@ -276,7 +277,7 @@ protected final HtmlPage loadPageWithAlerts(final String html, final URL url, fi final HtmlPage page = loadPage(html, url); List actualAlerts = getCollectedAlerts(page); - final long maxWait = System.currentTimeMillis() + maxWaitTime; + final long maxWait = System.currentTimeMillis() + maxWaitTime.toMillis(); while (actualAlerts.size() < expectedAlerts.length && System.currentTimeMillis() < maxWait) { Thread.sleep(30); actualAlerts = getCollectedAlerts(page); @@ -493,7 +494,7 @@ protected SslConnectionFactory getSslConnectionFactory() { * Returns the WebClient instance for the current test with the current {@link BrowserVersion}. * @return a WebClient with the current {@link BrowserVersion} */ - protected final WebClient getWebClient() { + protected WebClient getWebClient() { if (webClient_ == null) { webClient_ = new WebClient(getBrowserVersion()); webClient_.setAlertHandler(alertHandler_); @@ -505,7 +506,7 @@ protected final WebClient getWebClient() { * Cleanup after a test. */ @Override - @After + @AfterEach public void releaseResources() { super.releaseResources(); if (webClient_ != null) { diff --git a/src/test/java/org/htmlunit/WebTestCase.java b/src/test/java/org/htmlunit/WebTestCase.java index c1cb0b1fa47..dfa377d35be 100644 --- a/src/test/java/org/htmlunit/WebTestCase.java +++ b/src/test/java/org/htmlunit/WebTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package org.htmlunit; import static java.nio.charset.StandardCharsets.ISO_8859_1; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; @@ -27,8 +27,10 @@ import java.net.URL; import java.nio.file.Files; import java.nio.file.Paths; +import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; +import java.util.Base64; import java.util.List; import java.util.Locale; import java.util.Objects; @@ -36,17 +38,21 @@ import javax.imageio.ImageIO; -import org.apache.commons.codec.binary.Base64; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.SerializationUtils; -import org.htmlunit.junit.RetryRule; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.rules.MethodRule; -import org.junit.rules.TestName; +import org.htmlunit.junit.BrowserVersionClassTemplateInvocationContextProvider; +import org.htmlunit.junit.ErrorOutputChecker; +import org.htmlunit.junit.SetExpectedAlertsBeforeTestExecutionCallback; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.ClassTemplate; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.TestMethodOrder; +import org.junit.jupiter.api.extension.ExtendWith; import com.github.romankh3.image.comparison.ImageComparison; import com.github.romankh3.image.comparison.ImageComparisonUtil; @@ -65,23 +71,22 @@ * @author Ahmed Ashour * @author Ronald Brill */ +@ClassTemplate +@ExtendWith({BrowserVersionClassTemplateInvocationContextProvider.class, + SetExpectedAlertsBeforeTestExecutionCallback.class, + ErrorOutputChecker.class}) +@TestMethodOrder(MethodOrderer.DisplayName.class) public abstract class WebTestCase { - /** - * Make the test method name available to the tests. - */ - @Rule - public TestName testMethodName_ = new TestName(); + /** The html5 doctype. */ + public static final String DOCTYPE_HTML = "\n"; /** - * Define retry. + * Make the test method name available to the tests. */ - @Rule - public final RetryRule retryRule_ = new RetryRule(4); - - + public TestInfo testInfo_; - /** Logging support. */ + // /** Logging support. */ // private static final Log LOG = LogFactory.getLog(WebTestCase.class); /** save the environment */ @@ -114,7 +119,7 @@ public abstract class WebTestCase { public static final String SOCKS_PROXY_HOST = System.getProperty("htmlunit.test.socksproxy.host", "localhost"); /** The default time used to wait for the expected alerts. */ - protected static final long DEFAULT_WAIT_TIME = 1000; + protected static final Duration DEFAULT_WAIT_TIME = Duration.ofSeconds(1); /** Constant for the URL which is used in the tests. */ public static final URL URL_FIRST; @@ -148,12 +153,6 @@ public abstract class WebTestCase { private String[] expectedAlerts_; private MockWebConnection mockWebConnection_; - /** - * JUnit 4 {@link Rule} controlling System.err. - */ - @Rule - public final MethodRule errOutputChecker_ = new ErrorOutputChecker(); - static { try { URL_FIRST = new URL("http://localhost:" + PORT + "/"); @@ -175,12 +174,17 @@ public abstract class WebTestCase { protected WebTestCase() { } + @BeforeEach + void init(final TestInfo testInfo) { + testInfo_ = testInfo; + } + /** * Assert that the specified object is null. * @param object the object to check */ public static void assertNull(final Object object) { - Assert.assertNull("Expected null but found [" + object + "]", object); + Assertions.assertNull(object, "Expected null but found [" + object + "]"); } /** @@ -189,7 +193,7 @@ public static void assertNull(final Object object) { * @param object the object to check */ public static void assertNull(final String message, final Object object) { - Assert.assertNull(message, object); + Assertions.assertNull(object, message); } /** @@ -197,7 +201,7 @@ public static void assertNull(final String message, final Object object) { * @param object the object to check */ public static void assertNotNull(final Object object) { - Assert.assertNotNull(object); + Assertions.assertNotNull(object); } /** @@ -206,7 +210,7 @@ public static void assertNotNull(final Object object) { * @param object the object to check */ public static void assertNotNull(final String message, final Object object) { - Assert.assertNotNull(message, object); + Assertions.assertNotNull(object, message); } /** @@ -215,7 +219,7 @@ public static void assertNotNull(final String message, final Object object) { * @param actual the actual object */ public static void assertSame(final Object expected, final Object actual) { - Assert.assertSame(expected, actual); + Assertions.assertSame(expected, actual); } /** @@ -225,7 +229,7 @@ public static void assertSame(final Object expected, final Object actual) { * @param actual the actual object */ public static void assertSame(final String message, final Object expected, final Object actual) { - Assert.assertSame(message, expected, actual); + Assertions.assertSame(expected, actual, message); } /** @@ -234,7 +238,7 @@ public static void assertSame(final String message, final Object expected, final * @param actual the actual object */ public static void assertNotSame(final Object expected, final Object actual) { - Assert.assertNotSame(expected, actual); + Assertions.assertNotSame(expected, actual); } /** @@ -244,7 +248,7 @@ public static void assertNotSame(final Object expected, final Object actual) { * @param actual the actual object */ public static void assertNotSame(final String message, final Object expected, final Object actual) { - Assert.assertNotSame(message, expected, actual); + Assertions.assertNotSame(expected, actual, message); } /** @@ -254,7 +258,7 @@ public static void assertNotSame(final String message, final Object expected, fi * @param actualUrl the URL to test */ protected static void assertEquals(final URL expectedUrl, final URL actualUrl) { - Assert.assertEquals(expectedUrl.toExternalForm(), actualUrl.toExternalForm()); + Assertions.assertEquals(expectedUrl.toExternalForm(), actualUrl.toExternalForm()); } /** @@ -263,7 +267,7 @@ protected static void assertEquals(final URL expectedUrl, final URL actualUrl) { * @param actual the object to test */ protected static void assertEquals(final Object expected, final Object actual) { - Assert.assertEquals(expected, actual); + Assertions.assertEquals(expected, actual); } /** @@ -273,7 +277,7 @@ protected static void assertEquals(final Object expected, final Object actual) { * @param actual the object to test */ protected static void assertEquals(final String message, final Object expected, final Object actual) { - Assert.assertEquals(message, expected, actual); + Assertions.assertEquals(expected, actual, message); } /** @@ -282,7 +286,7 @@ protected static void assertEquals(final String message, final Object expected, * @param actual the int to test */ protected static void assertEquals(final int expected, final int actual) { - Assert.assertEquals(expected, actual); + Assertions.assertEquals(expected, actual); } /** @@ -291,7 +295,7 @@ protected static void assertEquals(final int expected, final int actual) { * @param actual the boolean to test */ protected void assertEquals(final boolean expected, final boolean actual) { - Assert.assertEquals(Boolean.valueOf(expected), Boolean.valueOf(actual)); + Assertions.assertEquals(Boolean.valueOf(expected), Boolean.valueOf(actual)); } /** @@ -302,7 +306,7 @@ protected void assertEquals(final boolean expected, final boolean actual) { * @param actualUrl the URL to test */ protected void assertEquals(final String message, final URL expectedUrl, final URL actualUrl) { - Assert.assertEquals(message, expectedUrl.toExternalForm(), actualUrl.toExternalForm()); + Assertions.assertEquals(expectedUrl.toExternalForm(), actualUrl.toExternalForm(), message); } /** @@ -311,7 +315,7 @@ protected void assertEquals(final String message, final URL expectedUrl, final U * @param actualUrl the URL to test */ protected void assertEquals(final String expectedUrl, final URL actualUrl) { - Assert.assertEquals(expectedUrl, actualUrl.toExternalForm()); + Assertions.assertEquals(expectedUrl, actualUrl.toExternalForm()); } /** @@ -336,7 +340,7 @@ protected void assertEquals(final String[] expected, final List actual) * @param actual the collection of strings to test */ protected void assertEquals(final String message, final String[] expected, final List actual) { - Assert.assertEquals(message, Arrays.asList(expected).toString(), actual.toString()); + Assertions.assertEquals(Arrays.asList(expected).toString(), actual.toString(), message); } /** @@ -346,7 +350,7 @@ protected void assertEquals(final String message, final String[] expected, final * @param actualUrl the URL to test */ protected void assertEquals(final String message, final String expectedUrl, final URL actualUrl) { - Assert.assertEquals(message, expectedUrl, actualUrl.toExternalForm()); + Assertions.assertEquals(expectedUrl, actualUrl.toExternalForm(), message); } /** @@ -354,7 +358,7 @@ protected void assertEquals(final String message, final String expectedUrl, fina * @param condition condition to test */ protected void assertTrue(final boolean condition) { - Assert.assertTrue(condition); + Assertions.assertTrue(condition); } /** @@ -363,7 +367,7 @@ protected void assertTrue(final boolean condition) { * @param condition condition to test */ protected void assertTrue(final String message, final boolean condition) { - Assert.assertTrue(message, condition); + Assertions.assertTrue(condition, message); } /** @@ -371,7 +375,7 @@ protected void assertTrue(final String message, final boolean condition) { * @param condition condition to test */ protected void assertFalse(final boolean condition) { - Assert.assertFalse(condition); + Assertions.assertFalse(condition); } /** @@ -380,7 +384,7 @@ protected void assertFalse(final boolean condition) { * @param condition condition to test */ protected void assertFalse(final String message, final boolean condition) { - Assert.assertFalse(message, condition); + Assertions.assertFalse(condition, message); } /** @@ -395,7 +399,7 @@ public void setBrowserVersion(final BrowserVersion browserVersion) { * Returns the current {@link BrowserVersion}. * @return current {@link BrowserVersion} */ - protected final BrowserVersion getBrowserVersion() { + public final BrowserVersion getBrowserVersion() { if (browserVersion_ == null) { throw new IllegalStateException("You must annotate the test class with '@RunWith(BrowserRunner.class)'"); } @@ -453,7 +457,7 @@ protected T clone(final T object) { * Prepare the environment. * Rhino has localized error message... for instance for French */ - @BeforeClass + @BeforeAll public static void beforeClass() { Locale.setDefault(Locale.US); } @@ -461,7 +465,7 @@ public static void beforeClass() { /** * Restore the environment. */ - @AfterClass + @AfterAll public static void afterClass() { Locale.setDefault(SAVE_LOCALE); } @@ -484,8 +488,8 @@ protected void verify(final Supplier func, final String expected) throws * @throws Exception in case of failure */ protected void verify(final Supplier func, final String expected, - final long maxWaitTime) throws Exception { - final long maxWait = System.currentTimeMillis() + maxWaitTime; + final Duration maxWaitTime) throws Exception { + final long maxWait = System.currentTimeMillis() + maxWaitTime.toMillis(); String actual = null; while (System.currentTimeMillis() < maxWait) { @@ -515,7 +519,7 @@ protected MockWebConnection getMockWebConnection() { /** * Cleanup after a test. */ - @After + @AfterEach public void releaseResources() { if (mockWebConnection_ != null) { mockWebConnection_.clear(); @@ -553,7 +557,7 @@ protected String getFileContent(final String fileName) throws IOException { protected void compareImages(final String expected, final String current) throws IOException { final String currentBase64Image = current.split(",")[1]; - final byte[] currentImageBytes = Base64.decodeBase64(currentBase64Image); + final byte[] currentImageBytes = Base64.getDecoder().decode(currentBase64Image); try (ByteArrayInputStream currentBis = new ByteArrayInputStream(currentImageBytes)) { final BufferedImage currentImage = ImageIO.read(currentBis); @@ -565,7 +569,7 @@ protected void compareImages(final String expected, final String current) throws protected void compareImages(final String expected, final String current, final BufferedImage currentImage) throws IOException { final String expectedBase64Image = expected.split(",")[1]; - final byte[] expectedImageBytes = Base64.decodeBase64(expectedBase64Image); + final byte[] expectedImageBytes = Base64.getDecoder().decode(expectedBase64Image); try (ByteArrayInputStream expectedBis = new ByteArrayInputStream(expectedImageBytes)) { final BufferedImage expectedImage = ImageIO.read(expectedBis); @@ -579,7 +583,7 @@ protected void compareImages(final String expected, final ImageComparisonState imageComparisonState = imageComparisonResult.getImageComparisonState(); if (ImageComparisonState.SIZE_MISMATCH == imageComparisonState) { - final String dir = "target/" + testMethodName_.getMethodName(); + final String dir = "target/" + testInfo_.getDisplayName(); Files.createDirectories(Paths.get(dir)); final File expectedOut = new File(dir, "expected.png"); @@ -598,7 +602,7 @@ protected void compareImages(final String expected, fail(fail); } else if (ImageComparisonState.MISMATCH == imageComparisonState) { - final String dir = "target/" + testMethodName_.getMethodName(); + final String dir = "target/" + testInfo_.getDisplayName(); Files.createDirectories(Paths.get(dir)); final File expectedOut = new File(dir, "expected.png"); diff --git a/src/test/java/org/htmlunit/WebWindowListenerTest.java b/src/test/java/org/htmlunit/WebWindowListenerTest.java index 72c8b61350a..7ac256f6a05 100644 --- a/src/test/java/org/htmlunit/WebWindowListenerTest.java +++ b/src/test/java/org/htmlunit/WebWindowListenerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,18 +14,17 @@ */ package org.htmlunit; +import org.apache.commons.lang3.StringUtils; import org.htmlunit.html.HtmlPage; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.NotYetImplemented; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; +import org.junit.jupiter.api.Test; /** * Tests for {@link WebWindowListener}. * * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class WebWindowListenerTest extends SimpleWebTestCase { /** @@ -34,10 +33,19 @@ public class WebWindowListenerTest extends SimpleWebTestCase { * @throws Exception if the test fails */ @Test - @NotYetImplemented + @Alerts("changed '(null)' - 'Test 1 [org.htmlunit.TopLevelWindow]'; " + + "changed 'Test 1 [org.htmlunit.TopLevelWindow]' - 'Test 2 [org.htmlunit.TopLevelWindow]'; ") + @HtmlUnitNYI(CHROME = "changed 'Test 1 [org.htmlunit.TopLevelWindow]' - 'Test 2 [org.htmlunit.TopLevelWindow]'; " + + "changed '(null)' - 'Test 1 [org.htmlunit.TopLevelWindow]'; ", + EDGE = "changed 'Test 1 [org.htmlunit.TopLevelWindow]' - 'Test 2 [org.htmlunit.TopLevelWindow]'; " + + "changed '(null)' - 'Test 1 [org.htmlunit.TopLevelWindow]'; ", + FF = "changed 'Test 1 [org.htmlunit.TopLevelWindow]' - 'Test 2 [org.htmlunit.TopLevelWindow]'; " + + "changed '(null)' - 'Test 1 [org.htmlunit.TopLevelWindow]'; ", + FF_ESR = "changed 'Test 1 [org.htmlunit.TopLevelWindow]' - 'Test 2 [org.htmlunit.TopLevelWindow]'; " + + "changed '(null)' - 'Test 1 [org.htmlunit.TopLevelWindow]'; ") public void eventOrder() throws Exception { - final String firstHtml - = "\n" + final String firstHtml = DOCTYPE_HTML + + "\n" + "Test 1\n" + "\n" + "\n" + " " + " \n"; final String workerJs = "onmessage = function(e) {\n" @@ -55,7 +53,7 @@ private void test(final String className) throws Exception { // normalize FF output + " clsName = clsName.replace('{\\n [native code]\\n}', '{ [native code] }');\n" + " workerResult += clsName;\n" - + " } catch(e) {workerResult = 'exception'}\n" + + " } catch(e) {workerResult = e.name}\n" + " postMessage(workerResult);\n" + "}\n"; @@ -69,7 +67,7 @@ private void test(final String className) throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void abstractList() throws Exception { test("AbstractList"); } @@ -78,7 +76,7 @@ public void abstractList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void abstractRange() throws Exception { test("AbstractRange"); } @@ -87,7 +85,7 @@ public void abstractRange() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void abstractWorker() throws Exception { test("AbstractWorker"); } @@ -98,7 +96,7 @@ public void abstractWorker() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void activeXObject() throws Exception { test("ActiveXObject"); } @@ -107,7 +105,7 @@ public void activeXObject() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ambientLightSensor() throws Exception { test("AmbientLightSensor"); } @@ -116,7 +114,7 @@ public void ambientLightSensor() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ambientLightSensorReading() throws Exception { test("AmbientLightSensorReading"); } @@ -127,7 +125,7 @@ public void ambientLightSensorReading() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void analyserNode() throws Exception { test("AnalyserNode"); } @@ -136,7 +134,7 @@ public void analyserNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void angle_instanced_arrays() throws Exception { test("ANGLE_instanced_arrays"); } @@ -145,7 +143,7 @@ public void angle_instanced_arrays() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animation() throws Exception { test("Animation"); } @@ -154,7 +152,7 @@ public void animation() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationEffectReadOnly() throws Exception { test("AnimationEffectReadOnly"); } @@ -163,7 +161,7 @@ public void animationEffectReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationEffectTiming() throws Exception { test("AnimationEffectTiming"); } @@ -172,7 +170,7 @@ public void animationEffectTiming() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationEffectTimingProperties() throws Exception { test("AnimationEffectTimingProperties"); } @@ -181,7 +179,7 @@ public void animationEffectTimingProperties() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationEffectTimingReadOnly() throws Exception { test("AnimationEffectTimingReadOnly"); } @@ -190,7 +188,7 @@ public void animationEffectTimingReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationEvent() throws Exception { test("AnimationEvent"); } @@ -199,7 +197,7 @@ public void animationEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationPlaybackEvent() throws Exception { test("AnimationPlaybackEvent"); } @@ -208,7 +206,7 @@ public void animationPlaybackEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationPlayer() throws Exception { test("AnimationPlayer"); } @@ -217,7 +215,7 @@ public void animationPlayer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationTimeline() throws Exception { test("AnimationTimeline"); } @@ -226,7 +224,7 @@ public void animationTimeline() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void appBannerPromptResult() throws Exception { test("AppBannerPromptResult"); } @@ -237,7 +235,7 @@ public void appBannerPromptResult() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void applicationCache() throws Exception { test("ApplicationCache"); } @@ -246,7 +244,7 @@ public void applicationCache() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void applicationCacheErrorEvent() throws Exception { test("ApplicationCacheErrorEvent"); } @@ -255,7 +253,7 @@ public void applicationCacheErrorEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void apps_mgmt() throws Exception { test("Apps.mgmt"); } @@ -297,7 +295,7 @@ public void arrayBuffer() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void arrayBufferView() throws Exception { test("ArrayBufferView"); } @@ -308,7 +306,7 @@ public void arrayBufferView() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void arrayBufferViewBase() throws Exception { test("ArrayBufferViewBase"); } @@ -317,7 +315,7 @@ public void arrayBufferViewBase() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void asyncFunction() throws Exception { test("AsyncFunction"); } @@ -337,7 +335,7 @@ public void atomics() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void attr() throws Exception { test("Attr"); } @@ -346,7 +344,7 @@ public void attr() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void audio() throws Exception { test("Audio"); } @@ -355,7 +353,7 @@ public void audio() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void audioBuffer() throws Exception { test("AudioBuffer"); } @@ -364,7 +362,7 @@ public void audioBuffer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void audioBufferSourceNode() throws Exception { test("AudioBufferSourceNode"); } @@ -373,7 +371,7 @@ public void audioBufferSourceNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void audioChannelManager() throws Exception { test("AudioChannelManager"); } @@ -382,7 +380,7 @@ public void audioChannelManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void audioContext() throws Exception { test("AudioContext"); } @@ -391,7 +389,7 @@ public void audioContext() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void audioDestinationNode() throws Exception { test("AudioDestinationNode"); } @@ -400,7 +398,7 @@ public void audioDestinationNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void audioListener() throws Exception { test("AudioListener"); } @@ -409,7 +407,7 @@ public void audioListener() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void audioNode() throws Exception { test("AudioNode"); } @@ -420,7 +418,7 @@ public void audioNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void audioParam() throws Exception { test("AudioParam"); } @@ -429,7 +427,7 @@ public void audioParam() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void audioProcessingEvent() throws Exception { test("AudioProcessingEvent"); } @@ -438,7 +436,7 @@ public void audioProcessingEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void audioScheduledSourceNode() throws Exception { test("AudioScheduledSourceNode"); } @@ -447,7 +445,7 @@ public void audioScheduledSourceNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void autocompleteErrorEvent() throws Exception { test("AutocompleteErrorEvent"); } @@ -456,7 +454,7 @@ public void autocompleteErrorEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void barProp() throws Exception { test("BarProp"); } @@ -465,7 +463,7 @@ public void barProp() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void baseAudioContext() throws Exception { test("BaseAudioContext"); } @@ -474,7 +472,7 @@ public void baseAudioContext() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void batteryManager() throws Exception { test("BatteryManager"); } @@ -483,7 +481,7 @@ public void batteryManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void beforeInstallPrompt() throws Exception { test("BeforeInstallPrompt"); } @@ -492,7 +490,7 @@ public void beforeInstallPrompt() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void beforeInstallPromptEvent() throws Exception { test("BeforeInstallPromptEvent"); } @@ -503,7 +501,7 @@ public void beforeInstallPromptEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void beforeUnloadEvent() throws Exception { test("BeforeUnloadEvent"); } @@ -512,7 +510,16 @@ public void beforeUnloadEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("function BigInt() { [native code] }") + public void bigInt() throws Exception { + test("BigInt"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("ReferenceError") public void biquadFilterNode() throws Exception { test("BiquadFilterNode"); } @@ -530,7 +537,7 @@ public void blob() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void blobBuilder() throws Exception { test("BlobBuilder"); } @@ -539,7 +546,7 @@ public void blobBuilder() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void blobEvent() throws Exception { test("BlobEvent"); } @@ -548,7 +555,7 @@ public void blobEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetooth() throws Exception { test("Bluetooth"); } @@ -557,7 +564,7 @@ public void bluetooth() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothAdapter() throws Exception { test("BluetoothAdapter"); } @@ -566,7 +573,7 @@ public void bluetoothAdapter() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothAdvertisingData() throws Exception { test("BluetoothAdvertisingData"); } @@ -575,7 +582,7 @@ public void bluetoothAdvertisingData() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothCharacteristicProperties() throws Exception { test("BluetoothCharacteristicProperties"); } @@ -584,7 +591,7 @@ public void bluetoothCharacteristicProperties() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothDevice() throws Exception { test("BluetoothDevice"); } @@ -593,7 +600,7 @@ public void bluetoothDevice() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothDeviceEvent() throws Exception { test("BluetoothDeviceEvent"); } @@ -602,7 +609,7 @@ public void bluetoothDeviceEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothGATTRemoteServer() throws Exception { test("BluetoothGATTRemoteServer"); } @@ -611,7 +618,7 @@ public void bluetoothGATTRemoteServer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothGATTService() throws Exception { test("BluetoothGATTService"); } @@ -620,7 +627,7 @@ public void bluetoothGATTService() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothManager() throws Exception { test("BluetoothManager"); } @@ -629,7 +636,7 @@ public void bluetoothManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothRemoteGATTCharacteristic() throws Exception { test("BluetoothRemoteGATTCharacteristic"); } @@ -638,7 +645,7 @@ public void bluetoothRemoteGATTCharacteristic() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothRemoteGATTServer() throws Exception { test("BluetoothRemoteGATTServer"); } @@ -647,7 +654,7 @@ public void bluetoothRemoteGATTServer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothStatusChangedEvent() throws Exception { test("BluetoothStatusChangedEvent"); } @@ -656,7 +663,7 @@ public void bluetoothStatusChangedEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void body() throws Exception { test("Body"); } @@ -665,7 +672,7 @@ public void body() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void boxObject() throws Exception { test("BoxObject"); } @@ -683,7 +690,7 @@ public void broadcastChannel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void budgetService() throws Exception { test("BudgetService"); } @@ -692,7 +699,7 @@ public void budgetService() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void budgetState() throws Exception { test("BudgetState"); } @@ -701,7 +708,7 @@ public void budgetState() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bufferSource() throws Exception { test("BufferSource"); } @@ -710,7 +717,7 @@ public void bufferSource() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void byteString() throws Exception { test("ByteString"); } @@ -737,7 +744,7 @@ public void cacheStorage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void callEvent() throws Exception { test("CallEvent"); } @@ -746,7 +753,7 @@ public void callEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cameraCapabilities() throws Exception { test("CameraCapabilities"); } @@ -755,7 +762,7 @@ public void cameraCapabilities() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cameraControl() throws Exception { test("CameraControl"); } @@ -764,7 +771,7 @@ public void cameraControl() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cameraManager() throws Exception { test("CameraManager"); } @@ -773,7 +780,7 @@ public void cameraManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void canvasCaptureMediaStream() throws Exception { test("CanvasCaptureMediaStream"); } @@ -782,7 +789,7 @@ public void canvasCaptureMediaStream() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void canvasCaptureMediaStreamTrack() throws Exception { test("CanvasCaptureMediaStreamTrack"); } @@ -800,7 +807,7 @@ public void canvasGradient() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void canvasImageSource() throws Exception { test("CanvasImageSource"); } @@ -820,7 +827,7 @@ public void canvasPattern() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void canvasRenderingContext2D() throws Exception { test("CanvasRenderingContext2D"); } @@ -829,7 +836,7 @@ public void canvasRenderingContext2D() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void caretPosition() throws Exception { test("CaretPosition"); } @@ -840,7 +847,7 @@ public void caretPosition() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cdataSection() throws Exception { test("CDATASection"); } @@ -851,7 +858,7 @@ public void cdataSection() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void channelMergerNode() throws Exception { test("ChannelMergerNode"); } @@ -860,7 +867,7 @@ public void channelMergerNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void channelSplitterNode() throws Exception { test("ChannelSplitterNode"); } @@ -869,7 +876,7 @@ public void channelSplitterNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void characterData() throws Exception { test("CharacterData"); } @@ -880,7 +887,7 @@ public void characterData() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void characterDataImpl() throws Exception { test("CharacterDataImpl"); } @@ -889,7 +896,7 @@ public void characterDataImpl() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void childNode() throws Exception { test("ChildNode"); } @@ -898,7 +905,7 @@ public void childNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void chromeWorker() throws Exception { test("ChromeWorker"); } @@ -907,36 +914,16 @@ public void chromeWorker() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void client() throws Exception { test("Client"); } - /** - * Test {@link org.htmlunit.javascript.host.ClientRect}. - * - * @throws Exception if an error occurs - */ - @Test - @Alerts("exception") - public void clientRect() throws Exception { - test("ClientRect"); - } - - /** - * @throws Exception if an error occurs - */ - @Test - @Alerts("exception") - public void clientRectList() throws Exception { - test("ClientRectList"); - } - /** * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void clients() throws Exception { test("Clients"); } @@ -945,7 +932,7 @@ public void clients() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void clipboardData() throws Exception { test("ClipboardData"); } @@ -954,7 +941,7 @@ public void clipboardData() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void clipboardEvent() throws Exception { test("ClipboardEvent"); } @@ -974,7 +961,7 @@ public void closeEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void comment() throws Exception { test("Comment"); } @@ -983,7 +970,7 @@ public void comment() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void compositionEvent() throws Exception { test("CompositionEvent"); } @@ -994,7 +981,7 @@ public void compositionEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void computedCSSStyleDeclaration() throws Exception { test("ComputedCSSStyleDeclaration"); } @@ -1003,7 +990,7 @@ public void computedCSSStyleDeclaration() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void connection() throws Exception { test(HttpHeader.CONNECTION); } @@ -1014,7 +1001,7 @@ public void connection() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void console() throws Exception { test("Console"); } @@ -1023,7 +1010,7 @@ public void console() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void constantSourceNode() throws Exception { test("ConstantSourceNode"); } @@ -1032,7 +1019,7 @@ public void constantSourceNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void constrainBoolean() throws Exception { test("ConstrainBoolean"); } @@ -1041,7 +1028,7 @@ public void constrainBoolean() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void constrainDOMString() throws Exception { test("ConstrainDOMString"); } @@ -1050,7 +1037,7 @@ public void constrainDOMString() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void constrainDouble() throws Exception { test("ConstrainDouble"); } @@ -1059,7 +1046,7 @@ public void constrainDouble() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void constrainLong() throws Exception { test("ConstrainLong"); } @@ -1068,7 +1055,7 @@ public void constrainLong() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void contactManager() throws Exception { test("ContactManager"); } @@ -1077,7 +1064,7 @@ public void contactManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void convolverNode() throws Exception { test("ConvolverNode"); } @@ -1088,7 +1075,7 @@ public void convolverNode() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void coordinates() throws Exception { test("Coordinates"); } @@ -1097,7 +1084,7 @@ public void coordinates() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void credential() throws Exception { test("Credential"); } @@ -1106,7 +1093,7 @@ public void credential() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void credentialsContainer() throws Exception { test("CredentialsContainer"); } @@ -1133,7 +1120,7 @@ public void cryptoKey() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void css() throws Exception { test("CSS"); } @@ -1144,7 +1131,7 @@ public void css() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void css2Properties() throws Exception { test("CSS2Properties"); } @@ -1155,7 +1142,7 @@ public void css2Properties() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssPageDescriptors() throws Exception { test("CSSPageDescriptors"); } @@ -1164,7 +1151,7 @@ public void cssPageDescriptors() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssCharsetRule() throws Exception { test("CSSCharsetRule"); } @@ -1173,7 +1160,7 @@ public void cssCharsetRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssConditionRule() throws Exception { test("CSSConditionRule"); } @@ -1182,7 +1169,7 @@ public void cssConditionRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssCounterStyleRule() throws Exception { test("CSSCounterStyleRule"); } @@ -1193,7 +1180,7 @@ public void cssCounterStyleRule() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssFontFaceRule() throws Exception { test("CSSFontFaceRule"); } @@ -1202,7 +1189,7 @@ public void cssFontFaceRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssGroupingRule() throws Exception { test("CSSGroupingRule"); } @@ -1213,7 +1200,7 @@ public void cssGroupingRule() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssImportRule() throws Exception { test("CSSImportRule"); } @@ -1222,7 +1209,7 @@ public void cssImportRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssKeyframeRule() throws Exception { test("CSSKeyframeRule"); } @@ -1231,7 +1218,7 @@ public void cssKeyframeRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssKeyframesRule() throws Exception { test("CSSKeyframesRule"); } @@ -1240,7 +1227,7 @@ public void cssKeyframesRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssMatrix() throws Exception { test("CSSMatrix"); } @@ -1251,7 +1238,7 @@ public void cssMatrix() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssMediaRule() throws Exception { test("CSSMediaRule"); } @@ -1260,7 +1247,7 @@ public void cssMediaRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssNamespaceRule() throws Exception { test("CSSNamespaceRule"); } @@ -1269,7 +1256,7 @@ public void cssNamespaceRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssPageRule() throws Exception { test("CSSPageRule"); } @@ -1280,7 +1267,7 @@ public void cssPageRule() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssPrimitiveValue() throws Exception { test("CSSPrimitiveValue"); } @@ -1291,7 +1278,7 @@ public void cssPrimitiveValue() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssRule() throws Exception { test("CSSRule"); } @@ -1302,7 +1289,7 @@ public void cssRule() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssRuleList() throws Exception { test("CSSRuleList"); } @@ -1313,7 +1300,7 @@ public void cssRuleList() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssStyleDeclaration() throws Exception { test("CSSStyleDeclaration"); } @@ -1324,7 +1311,7 @@ public void cssStyleDeclaration() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssStyleRule() throws Exception { test("CSSStyleRule"); } @@ -1335,7 +1322,7 @@ public void cssStyleRule() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssStyleSheet() throws Exception { test("CSSStyleSheet"); } @@ -1344,7 +1331,7 @@ public void cssStyleSheet() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssSupportsRule() throws Exception { test("CSSSupportsRule"); } @@ -1353,7 +1340,7 @@ public void cssSupportsRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssUnknownRule() throws Exception { test("CSSUnknownRule"); } @@ -1364,7 +1351,7 @@ public void cssUnknownRule() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssValue() throws Exception { test("CSSValue"); } @@ -1373,7 +1360,7 @@ public void cssValue() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssValueList() throws Exception { test("CSSValueList"); } @@ -1382,7 +1369,7 @@ public void cssValueList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssViewportRule() throws Exception { test("CSSViewportRule"); } @@ -1391,7 +1378,7 @@ public void cssViewportRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void customElementRegistry() throws Exception { test("CustomElementRegistry"); } @@ -1409,7 +1396,7 @@ public void customEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dataStore() throws Exception { test("DataStore"); } @@ -1418,7 +1405,7 @@ public void dataStore() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dataStoreChangeEvent() throws Exception { test("DataStoreChangeEvent"); } @@ -1427,7 +1414,7 @@ public void dataStoreChangeEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dataStoreCursor() throws Exception { test("DataStoreCursor"); } @@ -1436,7 +1423,7 @@ public void dataStoreCursor() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dataStoreTask() throws Exception { test("DataStoreTask"); } @@ -1445,7 +1432,7 @@ public void dataStoreTask() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dataTransfer() throws Exception { test("DataTransfer"); } @@ -1454,7 +1441,7 @@ public void dataTransfer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dataTransferItem() throws Exception { test("DataTransferItem"); } @@ -1463,7 +1450,7 @@ public void dataTransferItem() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dataTransferItemList() throws Exception { test("DataTransferItemList"); } @@ -1519,7 +1506,7 @@ public void dedicatedWorkerGlobalScope() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void delayNode() throws Exception { test("DelayNode"); } @@ -1528,7 +1515,7 @@ public void delayNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceAcceleration() throws Exception { test("DeviceAcceleration"); } @@ -1537,7 +1524,7 @@ public void deviceAcceleration() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceLightEvent() throws Exception { test("DeviceLightEvent"); } @@ -1546,7 +1533,7 @@ public void deviceLightEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceMotionEvent() throws Exception { test("DeviceMotionEvent"); } @@ -1555,7 +1542,7 @@ public void deviceMotionEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceOrientationEvent() throws Exception { test("DeviceOrientationEvent"); } @@ -1564,7 +1551,7 @@ public void deviceOrientationEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceProximityEvent() throws Exception { test("DeviceProximityEvent"); } @@ -1573,7 +1560,7 @@ public void deviceProximityEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceRotationRate() throws Exception { test("DeviceRotationRate"); } @@ -1582,7 +1569,7 @@ public void deviceRotationRate() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceStorage() throws Exception { test("DeviceStorage"); } @@ -1591,7 +1578,7 @@ public void deviceStorage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceStorageChangeEvent() throws Exception { test("DeviceStorageChangeEvent"); } @@ -1600,7 +1587,7 @@ public void deviceStorageChangeEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void directoryEntry() throws Exception { test("DirectoryEntry"); } @@ -1609,7 +1596,7 @@ public void directoryEntry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void directoryEntrySync() throws Exception { test("DirectoryEntrySync"); } @@ -1618,7 +1605,7 @@ public void directoryEntrySync() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void directoryReader() throws Exception { test("DirectoryReader"); } @@ -1627,7 +1614,7 @@ public void directoryReader() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void directoryReaderSync() throws Exception { test("DirectoryReaderSync"); } @@ -1638,7 +1625,7 @@ public void directoryReaderSync() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void document() throws Exception { test("Document"); } @@ -1649,7 +1636,7 @@ public void document() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void documentFragment() throws Exception { test("DocumentFragment"); } @@ -1658,7 +1645,7 @@ public void documentFragment() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void documentOrShadowRoot() throws Exception { test("DocumentOrShadowRoot"); } @@ -1667,7 +1654,7 @@ public void documentOrShadowRoot() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void documentTimeline() throws Exception { test("DocumentTimeline"); } @@ -1676,7 +1663,7 @@ public void documentTimeline() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void documentTouch() throws Exception { test("DocumentTouch"); } @@ -1687,7 +1674,7 @@ public void documentTouch() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void documentType() throws Exception { test("DocumentType"); } @@ -1696,7 +1683,7 @@ public void documentType() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domApplication() throws Exception { test("DOMApplication"); } @@ -1705,7 +1692,7 @@ public void domApplication() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domApplicationsManager() throws Exception { test("DOMApplicationsManager"); } @@ -1714,7 +1701,7 @@ public void domApplicationsManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domApplicationsRegistry() throws Exception { test("DOMApplicationsRegistry"); } @@ -1723,7 +1710,7 @@ public void domApplicationsRegistry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domConfiguration() throws Exception { test("DOMConfiguration"); } @@ -1734,7 +1721,7 @@ public void domConfiguration() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domCursor() throws Exception { test("DOMCursor"); } @@ -1743,7 +1730,7 @@ public void domCursor() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domError() throws Exception { test("DOMError"); } @@ -1752,7 +1739,7 @@ public void domError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domErrorHandler() throws Exception { test("DOMErrorHandler"); } @@ -1772,7 +1759,7 @@ public void domException() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domHighResTimeStamp() throws Exception { test("DOMHighResTimeStamp"); } @@ -1783,7 +1770,7 @@ public void domHighResTimeStamp() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domImplementation() throws Exception { test("DOMImplementation"); } @@ -1792,7 +1779,7 @@ public void domImplementation() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domImplementationList() throws Exception { test("DOMImplementationList"); } @@ -1801,7 +1788,7 @@ public void domImplementationList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domImplementationRegistry() throws Exception { test("DOMImplementationRegistry"); } @@ -1810,7 +1797,7 @@ public void domImplementationRegistry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domImplementationSource() throws Exception { test("DOMImplementationSource"); } @@ -1819,7 +1806,7 @@ public void domImplementationSource() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domLocator() throws Exception { test("DOMLocator"); } @@ -1846,7 +1833,7 @@ public void domMatrixReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domObject() throws Exception { test("DOMObject"); } @@ -1857,7 +1844,7 @@ public void domObject() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domParser() throws Exception { test("DOMParser"); } @@ -1881,7 +1868,7 @@ public void domPointReadOnly() throws Exception { } /** - * Test {@link org.htmlunit.javascript.host.ClientRect}. + * Test {@link org.htmlunit.javascript.host.DOMRect}. * * @throws Exception if an error occurs */ @@ -1895,7 +1882,7 @@ public void domRect() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domRectList() throws Exception { test("DOMRectList"); } @@ -1913,7 +1900,7 @@ public void domRectReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domRequest() throws Exception { test("DOMRequest"); } @@ -1922,7 +1909,7 @@ public void domRequest() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domSettableTokenList() throws Exception { test("DOMSettableTokenList"); } @@ -1931,7 +1918,7 @@ public void domSettableTokenList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domString() throws Exception { test("DOMString"); } @@ -1951,7 +1938,7 @@ public void domStringList() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domStringMap() throws Exception { test("DOMStringMap"); } @@ -1960,7 +1947,7 @@ public void domStringMap() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domTimeStamp() throws Exception { test("DOMTimeStamp"); } @@ -1971,7 +1958,7 @@ public void domTimeStamp() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domTokenList() throws Exception { test("DOMTokenList"); } @@ -1980,7 +1967,7 @@ public void domTokenList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domUserData() throws Exception { test("DOMUserData"); } @@ -1989,7 +1976,7 @@ public void domUserData() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void doubleRange() throws Exception { test("DoubleRange"); } @@ -1998,7 +1985,7 @@ public void doubleRange() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dragEvent() throws Exception { test("DragEvent"); } @@ -2007,7 +1994,7 @@ public void dragEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dynamicsCompressorNode() throws Exception { test("DynamicsCompressorNode"); } @@ -2018,7 +2005,7 @@ public void dynamicsCompressorNode() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void element() throws Exception { test("Element"); } @@ -2027,7 +2014,7 @@ public void element() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void elementTraversal() throws Exception { test("ElementTraversal"); } @@ -2054,7 +2041,7 @@ public void encodeURIComponent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void entity() throws Exception { test("Entity"); } @@ -2063,7 +2050,7 @@ public void entity() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void entityReference() throws Exception { test("EntityReference"); } @@ -2072,7 +2059,7 @@ public void entityReference() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void entry() throws Exception { test("Entry"); } @@ -2081,7 +2068,7 @@ public void entry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void entrySync() throws Exception { test("EntrySync"); } @@ -2092,7 +2079,7 @@ public void entrySync() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void enumerator() throws Exception { test("Enumerator"); } @@ -2157,7 +2144,7 @@ public void event() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void eventListener() throws Exception { test("EventListener"); } @@ -2166,7 +2153,7 @@ public void eventListener() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void eventNode() throws Exception { test("EventNode"); } @@ -2193,7 +2180,7 @@ public void eventTarget() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_blend_minmax() throws Exception { test("EXT_blend_minmax"); } @@ -2202,7 +2189,7 @@ public void ext_blend_minmax() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_color_buffer_float() throws Exception { test("EXT_color_buffer_float"); } @@ -2211,7 +2198,7 @@ public void ext_color_buffer_float() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_color_buffer_half_float() throws Exception { test("EXT_color_buffer_half_float"); } @@ -2220,7 +2207,7 @@ public void ext_color_buffer_half_float() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_disjoint_timer_query() throws Exception { test("EXT_disjoint_timer_query"); } @@ -2229,7 +2216,7 @@ public void ext_disjoint_timer_query() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_frag_depth() throws Exception { test("EXT_frag_depth"); } @@ -2238,7 +2225,7 @@ public void ext_frag_depth() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_shader_texture_lod() throws Exception { test("EXT_shader_texture_lod"); } @@ -2247,7 +2234,7 @@ public void ext_shader_texture_lod() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_sRGB() throws Exception { test("EXT_sRGB"); } @@ -2256,7 +2243,7 @@ public void ext_sRGB() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_texture_filter_anisotropic() throws Exception { test("EXT_texture_filter_anisotropic"); } @@ -2265,7 +2252,7 @@ public void ext_texture_filter_anisotropic() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void extendableEvent() throws Exception { test("ExtendableEvent"); } @@ -2274,7 +2261,7 @@ public void extendableEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void extendableMessageEvent() throws Exception { test("ExtendableMessageEvent"); } @@ -2285,7 +2272,7 @@ public void extendableMessageEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void external() throws Exception { test("External"); } @@ -2294,7 +2281,7 @@ public void external() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void federatedCredential() throws Exception { test("FederatedCredential"); } @@ -2303,7 +2290,7 @@ public void federatedCredential() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fetchEvent() throws Exception { test("FetchEvent"); } @@ -2321,7 +2308,7 @@ public void file() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileEntry() throws Exception { test("FileEntry"); } @@ -2330,7 +2317,7 @@ public void fileEntry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileEntrySync() throws Exception { test("FileEntrySync"); } @@ -2339,7 +2326,7 @@ public void fileEntrySync() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileError() throws Exception { test("FileError"); } @@ -2348,7 +2335,7 @@ public void fileError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileException() throws Exception { test("FileException"); } @@ -2357,7 +2344,7 @@ public void fileException() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileHandle() throws Exception { test("FileHandle"); } @@ -2385,7 +2372,7 @@ public void fileReader() throws Exception { */ @Test @Alerts("function FileReaderSync() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", EDGE = "exception", FF = "exception", FF_ESR = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", EDGE = "ReferenceError", FF = "ReferenceError", FF_ESR = "ReferenceError") public void fileReaderSync() throws Exception { test("FileReaderSync"); } @@ -2394,7 +2381,7 @@ public void fileReaderSync() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileRequest() throws Exception { test("FileRequest"); } @@ -2403,7 +2390,7 @@ public void fileRequest() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileSystem() throws Exception { test("FileSystem"); } @@ -2412,7 +2399,7 @@ public void fileSystem() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileSystemDirectoryEntry() throws Exception { test("FileSystemDirectoryEntry"); } @@ -2421,7 +2408,7 @@ public void fileSystemDirectoryEntry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileSystemDirectoryReader() throws Exception { test("FileSystemDirectoryReader"); } @@ -2430,7 +2417,7 @@ public void fileSystemDirectoryReader() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileSystemEntry() throws Exception { test("FileSystemEntry"); } @@ -2439,7 +2426,7 @@ public void fileSystemEntry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileSystemFileEntry() throws Exception { test("FileSystemFileEntry"); } @@ -2448,7 +2435,7 @@ public void fileSystemFileEntry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileSystemFlags() throws Exception { test("FileSystemFlags"); } @@ -2457,7 +2444,7 @@ public void fileSystemFlags() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileSystemSync() throws Exception { test("FileSystemSync"); } @@ -2488,7 +2475,7 @@ public void float64Array() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fMRadio() throws Exception { test("FMRadio"); } @@ -2497,7 +2484,7 @@ public void fMRadio() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void focusEvent() throws Exception { test("FocusEvent"); } @@ -2515,7 +2502,7 @@ public void fontFace() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function FontFaceSet() { [native code] }", FF_ESR = "function FontFaceSet() { [native code] }") public void fontFaceSet() throws Exception { @@ -2526,7 +2513,7 @@ public void fontFaceSet() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void formChild() throws Exception { test("FormChild"); } @@ -2546,7 +2533,7 @@ public void formData() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void formField() throws Exception { test("FormField"); } @@ -2564,7 +2551,7 @@ public void function() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void gainNode() throws Exception { test("GainNode"); } @@ -2573,7 +2560,7 @@ public void gainNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void gamepad() throws Exception { test("Gamepad"); } @@ -2582,7 +2569,7 @@ public void gamepad() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void gamepadButton() throws Exception { test("GamepadButton"); } @@ -2591,7 +2578,7 @@ public void gamepadButton() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void gamepadEvent() throws Exception { test("GamepadEvent"); } @@ -2600,7 +2587,7 @@ public void gamepadEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void generator() throws Exception { test("Generator"); } @@ -2609,7 +2596,7 @@ public void generator() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void generatorFunction() throws Exception { test("GeneratorFunction"); } @@ -2620,7 +2607,7 @@ public void generatorFunction() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void geolocation() throws Exception { test("Geolocation"); } @@ -2631,7 +2618,7 @@ public void geolocation() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void geolocationCoordinates() throws Exception { test("GeolocationCoordinates"); } @@ -2642,7 +2629,7 @@ public void geolocationCoordinates() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void geolocationPosition() throws Exception { test("GeolocationPosition"); } @@ -2653,7 +2640,7 @@ public void geolocationPosition() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void geolocationPositionError() throws Exception { test("GeolocationPositionError"); } @@ -2662,7 +2649,7 @@ public void geolocationPositionError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void gestureEvent() throws Exception { test("GestureEvent"); } @@ -2671,7 +2658,7 @@ public void gestureEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void globalEventHandlers() throws Exception { test("GlobalEventHandlers"); } @@ -2680,7 +2667,7 @@ public void globalEventHandlers() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void globalFetch() throws Exception { test("GlobalFetch"); } @@ -2691,7 +2678,7 @@ public void globalFetch() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void hashChangeEvent() throws Exception { test("HashChangeEvent"); } @@ -2711,7 +2698,7 @@ public void headers() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void history() throws Exception { test("History"); } @@ -2720,7 +2707,7 @@ public void history() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void hMDVRDevice() throws Exception { test("HMDVRDevice"); } @@ -2731,7 +2718,7 @@ public void hMDVRDevice() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlAllCollection() throws Exception { test("HTMLAllCollection"); } @@ -2742,7 +2729,7 @@ public void htmlAllCollection() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlAnchorElement() throws Exception { test("HTMLAnchorElement"); } @@ -2753,7 +2740,7 @@ public void htmlAnchorElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlAppletElement() throws Exception { test("HTMLAppletElement"); } @@ -2764,7 +2751,7 @@ public void htmlAppletElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlAreaElement() throws Exception { test("HTMLAreaElement"); } @@ -2775,7 +2762,7 @@ public void htmlAreaElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlAudioElement() throws Exception { test("HTMLAudioElement"); } @@ -2786,7 +2773,7 @@ public void htmlAudioElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlBaseElement() throws Exception { test("HTMLBaseElement"); } @@ -2797,7 +2784,7 @@ public void htmlBaseElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlBaseFontElement() throws Exception { test("HTMLBaseFontElement"); } @@ -2808,7 +2795,7 @@ public void htmlBaseFontElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlBGSoundElement() throws Exception { test("HTMLBGSoundElement"); } @@ -2819,7 +2806,7 @@ public void htmlBGSoundElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlBlockElement() throws Exception { test("HTMLBlockElement"); } @@ -2830,7 +2817,7 @@ public void htmlBlockElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlBlockQuoteElement() throws Exception { test("HTMLBlockQuoteElement"); } @@ -2841,7 +2828,7 @@ public void htmlBlockQuoteElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlBodyElement() throws Exception { test("HTMLBodyElement"); } @@ -2852,7 +2839,7 @@ public void htmlBodyElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlBRElement() throws Exception { test("HTMLBRElement"); } @@ -2863,7 +2850,7 @@ public void htmlBRElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlButtonElement() throws Exception { test("HTMLButtonElement"); } @@ -2874,7 +2861,7 @@ public void htmlButtonElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlCanvasElement() throws Exception { test("HTMLCanvasElement"); } @@ -2885,7 +2872,7 @@ public void htmlCanvasElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlCollection() throws Exception { test("HTMLCollection"); } @@ -2896,7 +2883,7 @@ public void htmlCollection() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlCommentElement() throws Exception { test("HTMLCommentElement"); } @@ -2905,7 +2892,7 @@ public void htmlCommentElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlContentElement() throws Exception { test("HTMLContentElement"); } @@ -2914,7 +2901,7 @@ public void htmlContentElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDataElement() throws Exception { test("HTMLDataElement"); } @@ -2925,7 +2912,7 @@ public void htmlDataElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDataListElement() throws Exception { test("HTMLDataListElement"); } @@ -2936,7 +2923,7 @@ public void htmlDataListElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDDElement() throws Exception { test("HTMLDDElement"); } @@ -2947,7 +2934,7 @@ public void htmlDDElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDefinitionDescriptionElement() throws Exception { test("HTMLDefinitionDescriptionElement"); } @@ -2958,7 +2945,7 @@ public void htmlDefinitionDescriptionElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDefinitionTermElement() throws Exception { test("HTMLDefinitionTermElement"); } @@ -2969,7 +2956,7 @@ public void htmlDefinitionTermElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDetailsElement() throws Exception { test("HTMLDetailsElement"); } @@ -2980,7 +2967,7 @@ public void htmlDetailsElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDialogElement() throws Exception { test("HTMLDialogElement"); } @@ -2991,7 +2978,7 @@ public void htmlDialogElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDirectoryElement() throws Exception { test("HTMLDirectoryElement"); } @@ -3002,7 +2989,7 @@ public void htmlDirectoryElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDivElement() throws Exception { test("HTMLDivElement"); } @@ -3013,7 +3000,7 @@ public void htmlDivElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDListElement() throws Exception { test("HTMLDListElement"); } @@ -3024,7 +3011,7 @@ public void htmlDListElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDocument() throws Exception { test("HTMLDocument"); } @@ -3035,7 +3022,7 @@ public void htmlDocument() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDTElement() throws Exception { test("HTMLDTElement"); } @@ -3046,7 +3033,7 @@ public void htmlDTElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlElement() throws Exception { test("HTMLElement"); } @@ -3057,7 +3044,7 @@ public void htmlElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlEmbedElement() throws Exception { test("HTMLEmbedElement"); } @@ -3068,7 +3055,7 @@ public void htmlEmbedElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlFieldSetElement() throws Exception { test("HTMLFieldSetElement"); } @@ -3079,7 +3066,7 @@ public void htmlFieldSetElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlFontElement() throws Exception { test("HTMLFontElement"); } @@ -3088,7 +3075,7 @@ public void htmlFontElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlFormControlsCollection() throws Exception { test("HTMLFormControlsCollection"); } @@ -3099,7 +3086,7 @@ public void htmlFormControlsCollection() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlFormElement() throws Exception { test("HTMLFormElement"); } @@ -3110,7 +3097,7 @@ public void htmlFormElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlFrameElement() throws Exception { test("HTMLFrameElement"); } @@ -3121,7 +3108,7 @@ public void htmlFrameElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlFrameSetElement() throws Exception { test("HTMLFrameSetElement"); } @@ -3132,7 +3119,7 @@ public void htmlFrameSetElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlGenericElement() throws Exception { test("HTMLGenericElement"); } @@ -3143,7 +3130,7 @@ public void htmlGenericElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlHeadElement() throws Exception { test("HTMLHeadElement"); } @@ -3154,7 +3141,7 @@ public void htmlHeadElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlHeadingElement() throws Exception { test("HTMLHeadingElement"); } @@ -3165,7 +3152,7 @@ public void htmlHeadingElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlHRElement() throws Exception { test("HTMLHRElement"); } @@ -3176,7 +3163,7 @@ public void htmlHRElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlHtmlElement() throws Exception { test("HTMLHtmlElement"); } @@ -3185,7 +3172,7 @@ public void htmlHtmlElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlHyperlinkElementUtils() throws Exception { test("HTMLHyperlinkElementUtils"); } @@ -3196,7 +3183,7 @@ public void htmlHyperlinkElementUtils() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlIFrameElement() throws Exception { test("HTMLIFrameElement"); } @@ -3207,7 +3194,7 @@ public void htmlIFrameElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlImageElement() throws Exception { test("HTMLImageElement"); } @@ -3218,7 +3205,7 @@ public void htmlImageElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlInlineQuotationElement() throws Exception { test("HTMLInlineQuotationElement"); } @@ -3229,7 +3216,7 @@ public void htmlInlineQuotationElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlInputElement() throws Exception { test("HTMLInputElement"); } @@ -3240,7 +3227,7 @@ public void htmlInputElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlIsIndexElement() throws Exception { test("HTMLIsIndexElement"); } @@ -3249,7 +3236,7 @@ public void htmlIsIndexElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlKeygenElement() throws Exception { test("HTMLKeygenElement"); } @@ -3260,7 +3247,7 @@ public void htmlKeygenElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlLabelElement() throws Exception { test("HTMLLabelElement"); } @@ -3271,7 +3258,7 @@ public void htmlLabelElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlLegendElement() throws Exception { test("HTMLLegendElement"); } @@ -3282,7 +3269,7 @@ public void htmlLegendElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlLIElement() throws Exception { test("HTMLLIElement"); } @@ -3293,7 +3280,7 @@ public void htmlLIElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlLinkElement() throws Exception { test("HTMLLinkElement"); } @@ -3304,7 +3291,7 @@ public void htmlLinkElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlListElement() throws Exception { test("HTMLListElement"); } @@ -3315,7 +3302,7 @@ public void htmlListElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlMapElement() throws Exception { test("HTMLMapElement"); } @@ -3326,7 +3313,7 @@ public void htmlMapElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlMarqueeElement() throws Exception { test("HTMLMarqueeElement"); } @@ -3337,7 +3324,7 @@ public void htmlMarqueeElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlMediaElement() throws Exception { test("HTMLMediaElement"); } @@ -3348,7 +3335,7 @@ public void htmlMediaElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlMenuElement() throws Exception { test("HTMLMenuElement"); } @@ -3357,7 +3344,7 @@ public void htmlMenuElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlMenuItemElement() throws Exception { test("HTMLMenuItemElement"); } @@ -3368,7 +3355,7 @@ public void htmlMenuItemElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlMetaElement() throws Exception { test("HTMLMetaElement"); } @@ -3379,7 +3366,7 @@ public void htmlMetaElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlMeterElement() throws Exception { test("HTMLMeterElement"); } @@ -3390,7 +3377,7 @@ public void htmlMeterElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlModElement() throws Exception { test("HTMLModElement"); } @@ -3401,7 +3388,7 @@ public void htmlModElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlNextIdElement() throws Exception { test("HTMLNextIdElement"); } @@ -3410,7 +3397,7 @@ public void htmlNextIdElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlNoShowElement() throws Exception { test("HTMLNoShowElement"); } @@ -3421,7 +3408,7 @@ public void htmlNoShowElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlObjectElement() throws Exception { test("HTMLObjectElement"); } @@ -3432,7 +3419,7 @@ public void htmlObjectElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlOListElement() throws Exception { test("HTMLOListElement"); } @@ -3443,7 +3430,7 @@ public void htmlOListElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlOptGroupElement() throws Exception { test("HTMLOptGroupElement"); } @@ -3454,7 +3441,7 @@ public void htmlOptGroupElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlOptionElement() throws Exception { test("HTMLOptionElement"); } @@ -3465,7 +3452,7 @@ public void htmlOptionElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlOptionsCollection() throws Exception { test("HTMLOptionsCollection"); } @@ -3476,7 +3463,7 @@ public void htmlOptionsCollection() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlOutputElement() throws Exception { test("HTMLOutputElement"); } @@ -3487,7 +3474,7 @@ public void htmlOutputElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlParagraphElement() throws Exception { test("HTMLParagraphElement"); } @@ -3498,7 +3485,7 @@ public void htmlParagraphElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlParamElement() throws Exception { test("HTMLParamElement"); } @@ -3509,7 +3496,7 @@ public void htmlParamElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlPhraseElement() throws Exception { test("HTMLPhraseElement"); } @@ -3518,7 +3505,7 @@ public void htmlPhraseElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlPictureElement() throws Exception { test("HTMLPictureElement"); } @@ -3529,7 +3516,7 @@ public void htmlPictureElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlPreElement() throws Exception { test("HTMLPreElement"); } @@ -3540,7 +3527,7 @@ public void htmlPreElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlProgressElement() throws Exception { test("HTMLProgressElement"); } @@ -3551,7 +3538,7 @@ public void htmlProgressElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlQuoteElement() throws Exception { test("HTMLQuoteElement"); } @@ -3562,7 +3549,7 @@ public void htmlQuoteElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlScriptElement() throws Exception { test("HTMLScriptElement"); } @@ -3573,7 +3560,7 @@ public void htmlScriptElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlSelectElement() throws Exception { test("HTMLSelectElement"); } @@ -3584,7 +3571,7 @@ public void htmlSelectElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlShadowElement() throws Exception { test("HTMLShadowElement"); } @@ -3593,7 +3580,7 @@ public void htmlShadowElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlSlotElement() throws Exception { test("HTMLSlotElement"); } @@ -3604,7 +3591,7 @@ public void htmlSlotElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlSourceElement() throws Exception { test("HTMLSourceElement"); } @@ -3615,7 +3602,7 @@ public void htmlSourceElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlSpanElement() throws Exception { test("HTMLSpanElement"); } @@ -3626,7 +3613,7 @@ public void htmlSpanElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlStyleElement() throws Exception { test("HTMLStyleElement"); } @@ -3637,7 +3624,7 @@ public void htmlStyleElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTableCaptionElement() throws Exception { test("HTMLTableCaptionElement"); } @@ -3648,7 +3635,7 @@ public void htmlTableCaptionElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTableCellElement() throws Exception { test("HTMLTableCellElement"); } @@ -3659,7 +3646,7 @@ public void htmlTableCellElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTableColElement() throws Exception { test("HTMLTableColElement"); } @@ -3670,7 +3657,7 @@ public void htmlTableColElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTableComponent() throws Exception { test("HTMLTableComponent"); } @@ -3681,7 +3668,7 @@ public void htmlTableComponent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTableDataCellElement() throws Exception { test("HTMLTableDataCellElement"); } @@ -3692,7 +3679,7 @@ public void htmlTableDataCellElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTableElement() throws Exception { test("HTMLTableElement"); } @@ -3703,7 +3690,7 @@ public void htmlTableElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTableHeaderCellElement() throws Exception { test("HTMLTableHeaderCellElement"); } @@ -3714,7 +3701,7 @@ public void htmlTableHeaderCellElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTableRowElement() throws Exception { test("HTMLTableRowElement"); } @@ -3725,7 +3712,7 @@ public void htmlTableRowElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTableSectionElement() throws Exception { test("HTMLTableSectionElement"); } @@ -3734,7 +3721,7 @@ public void htmlTableSectionElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTemplateElement() throws Exception { test("HTMLTemplateElement"); } @@ -3745,7 +3732,7 @@ public void htmlTemplateElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTextAreaElement() throws Exception { test("HTMLTextAreaElement"); } @@ -3754,7 +3741,7 @@ public void htmlTextAreaElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTextElement() throws Exception { test("HTMLTextElement"); } @@ -3765,7 +3752,7 @@ public void htmlTextElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTimeElement() throws Exception { test("HTMLTimeElement"); } @@ -3776,7 +3763,7 @@ public void htmlTimeElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTitleElement() throws Exception { test("HTMLTitleElement"); } @@ -3787,7 +3774,7 @@ public void htmlTitleElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTrackElement() throws Exception { test("HTMLTrackElement"); } @@ -3798,7 +3785,7 @@ public void htmlTrackElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlUListElement() throws Exception { test("HTMLUListElement"); } @@ -3809,7 +3796,7 @@ public void htmlUListElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlUnknownElement() throws Exception { test("HTMLUnknownElement"); } @@ -3820,7 +3807,7 @@ public void htmlUnknownElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlVideoElement() throws Exception { test("HTMLVideoElement"); } @@ -3829,7 +3816,7 @@ public void htmlVideoElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlWBRElement() throws Exception { test("HTMLWBRElement"); } @@ -3847,7 +3834,7 @@ public void idbCursor() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbCursorSync() throws Exception { test("IDBCursorSync"); } @@ -3874,7 +3861,7 @@ public void idbDatabase() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbDatabaseException() throws Exception { test("IDBDatabaseException"); } @@ -3883,7 +3870,7 @@ public void idbDatabaseException() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbDatabaseSync() throws Exception { test("IDBDatabaseSync"); } @@ -3892,7 +3879,7 @@ public void idbDatabaseSync() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbEnvironment() throws Exception { test("IDBEnvironment"); } @@ -3901,7 +3888,7 @@ public void idbEnvironment() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbEnvironmentSync() throws Exception { test("IDBEnvironmentSync"); } @@ -3919,7 +3906,7 @@ public void idbFactory() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbFactorySync() throws Exception { test("IDBFactorySync"); } @@ -3937,7 +3924,7 @@ public void idbIndex() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbIndexSync() throws Exception { test("IDBIndexSync"); } @@ -3955,7 +3942,7 @@ public void idbKeyRange() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbLocaleAwareKeyRange() throws Exception { test("IDBLocaleAwareKeyRange"); } @@ -3964,7 +3951,7 @@ public void idbLocaleAwareKeyRange() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbMutableFile() throws Exception { test("IDBMutableFile"); } @@ -3982,7 +3969,7 @@ public void idbObjectStore() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbObjectStoreSync() throws Exception { test("IDBObjectStoreSync"); } @@ -4018,7 +4005,7 @@ public void idbTransaction() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbTransactionSync() throws Exception { test("IDBTransactionSync"); } @@ -4036,7 +4023,7 @@ public void idbVersionChangeEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbVersionChangeRequest() throws Exception { test("IDBVersionChangeRequest"); } @@ -4045,7 +4032,7 @@ public void idbVersionChangeRequest() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void identityManager() throws Exception { test("IdentityManager"); } @@ -4054,7 +4041,7 @@ public void identityManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idleDeadline() throws Exception { test("IdleDeadline"); } @@ -4063,7 +4050,7 @@ public void idleDeadline() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void iirFilterNode() throws Exception { test("IIRFilterNode"); } @@ -4074,7 +4061,7 @@ public void iirFilterNode() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void image() throws Exception { test("Image"); } @@ -4092,7 +4079,7 @@ public void imageBitmap() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void imageBitmapFactories() throws Exception { test("ImageBitmapFactories"); } @@ -4119,7 +4106,7 @@ public void imageData() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void index() throws Exception { test("Index"); } @@ -4128,7 +4115,7 @@ public void index() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void indexedDB() throws Exception { test("IndexedDB"); } @@ -4146,7 +4133,7 @@ public void infinity() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void inputDeviceCapabilities() throws Exception { test("InputDeviceCapabilities"); } @@ -4155,7 +4142,7 @@ public void inputDeviceCapabilities() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void inputEvent() throws Exception { test("InputEvent"); } @@ -4164,7 +4151,7 @@ public void inputEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void inputMethodContext() throws Exception { test("InputMethodContext"); } @@ -4173,7 +4160,7 @@ public void inputMethodContext() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void installEvent() throws Exception { test("InstallEvent"); } @@ -4182,7 +4169,7 @@ public void installEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void installTrigger() throws Exception { test("InstallTrigger"); } @@ -4191,7 +4178,7 @@ public void installTrigger() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void installTriggerImpl() throws Exception { test("InstallTriggerImpl"); } @@ -4233,7 +4220,7 @@ public void int8Array() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function InternalError() { [native code] }", FF_ESR = "function InternalError() { [native code] }") @HtmlUnitNYI(CHROME = "function InternalError() { [native code] }", @@ -4246,7 +4233,7 @@ public void internalError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void intersectionObserver() throws Exception { test("IntersectionObserver"); } @@ -4255,7 +4242,7 @@ public void intersectionObserver() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void intersectionObserverEntry() throws Exception { test("IntersectionObserverEntry"); } @@ -4321,7 +4308,7 @@ public void isNaN() throws Exception { */ @Test @Alerts(DEFAULT = "function Iterator() { [native code] }", - FF_ESR = "exception") + FF_ESR = "ReferenceError") public void iterator() throws Exception { test("Iterator"); } @@ -4341,7 +4328,7 @@ public void json() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void keyboardEvent() throws Exception { test("KeyboardEvent"); } @@ -4350,7 +4337,7 @@ public void keyboardEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void keyframeEffect() throws Exception { test("KeyframeEffect"); } @@ -4359,7 +4346,7 @@ public void keyframeEffect() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void keyframeEffectReadOnly() throws Exception { test("KeyframeEffectReadOnly"); } @@ -4368,7 +4355,7 @@ public void keyframeEffectReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n() throws Exception { test("L10n"); } @@ -4377,7 +4364,7 @@ public void l10n() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_formatValue() throws Exception { test("L10n.formatValue"); } @@ -4386,7 +4373,7 @@ public void l10n_formatValue() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_get() throws Exception { test("L10n.get"); } @@ -4395,7 +4382,7 @@ public void l10n_get() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_language_code() throws Exception { test("L10n.language.code"); } @@ -4404,7 +4391,7 @@ public void l10n_language_code() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_language_direction() throws Exception { test("L10n.language.direction"); } @@ -4413,7 +4400,7 @@ public void l10n_language_direction() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_once() throws Exception { test("L10n.once"); } @@ -4422,7 +4409,7 @@ public void l10n_once() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_ready() throws Exception { test("L10n.ready"); } @@ -4431,7 +4418,7 @@ public void l10n_ready() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_readyState() throws Exception { test("L10n.readyState"); } @@ -4440,7 +4427,7 @@ public void l10n_readyState() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_setAttributes() throws Exception { test("L10n.setAttributes"); } @@ -4449,7 +4436,7 @@ public void l10n_setAttributes() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void linkStyle() throws Exception { test("LinkStyle"); } @@ -4458,7 +4445,7 @@ public void linkStyle() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void localFileSystem() throws Exception { test("LocalFileSystem"); } @@ -4467,7 +4454,7 @@ public void localFileSystem() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void localFileSystemSync() throws Exception { test("LocalFileSystemSync"); } @@ -4478,7 +4465,7 @@ public void localFileSystemSync() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void localMediaStream() throws Exception { test("LocalMediaStream"); } @@ -4489,7 +4476,7 @@ public void localMediaStream() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void location() throws Exception { test("Location"); } @@ -4498,7 +4485,7 @@ public void location() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void lockedFile() throws Exception { test("LockedFile"); } @@ -4507,7 +4494,7 @@ public void lockedFile() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void longRange() throws Exception { test("LongRange"); } @@ -4534,7 +4521,7 @@ public void math() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaDeviceInfo() throws Exception { test("MediaDeviceInfo"); } @@ -4543,7 +4530,7 @@ public void mediaDeviceInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaDevices() throws Exception { test("MediaDevices"); } @@ -4552,7 +4539,7 @@ public void mediaDevices() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaElementAudioSourceNode() throws Exception { test("MediaElementAudioSourceNode"); } @@ -4561,7 +4548,7 @@ public void mediaElementAudioSourceNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaEncryptedEvent() throws Exception { test("MediaEncryptedEvent"); } @@ -4570,7 +4557,7 @@ public void mediaEncryptedEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaError() throws Exception { test("MediaError"); } @@ -4579,7 +4566,7 @@ public void mediaError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaKeyError() throws Exception { test("MediaKeyError"); } @@ -4588,7 +4575,7 @@ public void mediaKeyError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaKeyEvent() throws Exception { test("MediaKeyEvent"); } @@ -4597,7 +4584,7 @@ public void mediaKeyEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaKeyMessageEvent() throws Exception { test("MediaKeyMessageEvent"); } @@ -4606,7 +4593,7 @@ public void mediaKeyMessageEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaKeys() throws Exception { test("MediaKeys"); } @@ -4615,7 +4602,7 @@ public void mediaKeys() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaKeySession() throws Exception { test("MediaKeySession"); } @@ -4624,7 +4611,7 @@ public void mediaKeySession() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaKeyStatusMap() throws Exception { test("MediaKeyStatusMap"); } @@ -4633,7 +4620,7 @@ public void mediaKeyStatusMap() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaKeySystemAccess() throws Exception { test("MediaKeySystemAccess"); } @@ -4642,7 +4629,7 @@ public void mediaKeySystemAccess() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaKeySystemConfiguration() throws Exception { test("MediaKeySystemConfiguration"); } @@ -4653,7 +4640,7 @@ public void mediaKeySystemConfiguration() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaList() throws Exception { test("MediaList"); } @@ -4662,7 +4649,7 @@ public void mediaList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaQueryList() throws Exception { test("MediaQueryList"); } @@ -4671,7 +4658,7 @@ public void mediaQueryList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaQueryListEvent() throws Exception { test("MediaQueryListEvent"); } @@ -4680,7 +4667,7 @@ public void mediaQueryListEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaQueryListListener() throws Exception { test("MediaQueryListListener"); } @@ -4689,7 +4676,7 @@ public void mediaQueryListListener() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaRecorder() throws Exception { test("MediaRecorder"); } @@ -4699,8 +4686,8 @@ public void mediaRecorder() throws Exception { */ @Test @Alerts(DEFAULT = "function MediaSource() { [native code] }", - FF = "exception", - FF_ESR = "exception") + FF = "ReferenceError", + FF_ESR = "ReferenceError") public void mediaSource() throws Exception { test("MediaSource"); } @@ -4709,7 +4696,7 @@ public void mediaSource() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaStream() throws Exception { test("MediaStream"); } @@ -4718,7 +4705,7 @@ public void mediaStream() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaStreamAudioDestinationNode() throws Exception { test("MediaStreamAudioDestinationNode"); } @@ -4727,7 +4714,7 @@ public void mediaStreamAudioDestinationNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaStreamAudioSourceNode() throws Exception { test("MediaStreamAudioSourceNode"); } @@ -4736,7 +4723,7 @@ public void mediaStreamAudioSourceNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaStreamConstraints() throws Exception { test("MediaStreamConstraints"); } @@ -4745,7 +4732,7 @@ public void mediaStreamConstraints() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaStreamEvent() throws Exception { test("MediaStreamEvent"); } @@ -4754,7 +4741,7 @@ public void mediaStreamEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaStreamTrack() throws Exception { test("MediaStreamTrack"); } @@ -4763,7 +4750,7 @@ public void mediaStreamTrack() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaStreamTrackEvent() throws Exception { test("MediaStreamTrackEvent"); } @@ -4772,7 +4759,7 @@ public void mediaStreamTrackEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaTrackConstraints() throws Exception { test("MediaTrackConstraints"); } @@ -4781,7 +4768,7 @@ public void mediaTrackConstraints() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaTrackSettings() throws Exception { test("MediaTrackSettings"); } @@ -4790,7 +4777,7 @@ public void mediaTrackSettings() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaTrackSupportedConstraints() throws Exception { test("MediaTrackSupportedConstraints"); } @@ -4832,7 +4819,7 @@ public void messagePort() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void metadata() throws Exception { test("Metadata"); } @@ -4841,7 +4828,7 @@ public void metadata() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void midiAccess() throws Exception { test("MIDIAccess"); } @@ -4850,7 +4837,7 @@ public void midiAccess() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void midiConnectionEvent() throws Exception { test("MIDIConnectionEvent"); } @@ -4859,7 +4846,7 @@ public void midiConnectionEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void midiInput() throws Exception { test("MIDIInput"); } @@ -4868,7 +4855,7 @@ public void midiInput() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void midiInputMap() throws Exception { test("MIDIInputMap"); } @@ -4877,7 +4864,7 @@ public void midiInputMap() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void midiMessageEvent() throws Exception { test("MIDIMessageEvent"); } @@ -4886,7 +4873,7 @@ public void midiMessageEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void midiOutput() throws Exception { test("MIDIOutput"); } @@ -4895,7 +4882,7 @@ public void midiOutput() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void midiOutputMap() throws Exception { test("MIDIOutputMap"); } @@ -4904,7 +4891,7 @@ public void midiOutputMap() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void midiPort() throws Exception { test("MIDIPort"); } @@ -4915,7 +4902,7 @@ public void midiPort() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mimeType() throws Exception { test("MimeType"); } @@ -4926,7 +4913,7 @@ public void mimeType() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mimeTypeArray() throws Exception { test("MimeTypeArray"); } @@ -4937,7 +4924,7 @@ public void mimeTypeArray() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mouseEvent() throws Exception { test("MouseEvent"); } @@ -4946,7 +4933,7 @@ public void mouseEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mouseScrollEvent() throws Exception { test("MouseScrollEvent"); } @@ -4955,7 +4942,7 @@ public void mouseScrollEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mouseWheelEvent() throws Exception { test("MouseWheelEvent"); } @@ -4964,7 +4951,7 @@ public void mouseWheelEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozActivity() throws Exception { test("MozActivity"); } @@ -4973,7 +4960,7 @@ public void mozActivity() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozActivityOptions() throws Exception { test("MozActivityOptions"); } @@ -4982,7 +4969,7 @@ public void mozActivityOptions() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozActivityRequestHandler() throws Exception { test("MozActivityRequestHandler"); } @@ -4991,7 +4978,7 @@ public void mozActivityRequestHandler() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozAlarmsManager() throws Exception { test("MozAlarmsManager"); } @@ -5000,7 +4987,7 @@ public void mozAlarmsManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozContact() throws Exception { test("MozContact"); } @@ -5009,7 +4996,7 @@ public void mozContact() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozContactChangeEvent() throws Exception { test("MozContactChangeEvent"); } @@ -5018,7 +5005,7 @@ public void mozContactChangeEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozCSSKeyframesRule() throws Exception { test("MozCSSKeyframesRule"); } @@ -5027,7 +5014,7 @@ public void mozCSSKeyframesRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozIccManager() throws Exception { test("MozIccManager"); } @@ -5036,7 +5023,7 @@ public void mozIccManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMmsEvent() throws Exception { test("MozMmsEvent"); } @@ -5045,7 +5032,7 @@ public void mozMmsEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMmsMessage() throws Exception { test("MozMmsMessage"); } @@ -5054,7 +5041,7 @@ public void mozMmsMessage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileCellInfo() throws Exception { test("MozMobileCellInfo"); } @@ -5063,7 +5050,7 @@ public void mozMobileCellInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileCFInfo() throws Exception { test("MozMobileCFInfo"); } @@ -5072,7 +5059,7 @@ public void mozMobileCFInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileConnection() throws Exception { test("MozMobileConnection"); } @@ -5081,7 +5068,7 @@ public void mozMobileConnection() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileConnectionInfo() throws Exception { test("MozMobileConnectionInfo"); } @@ -5090,7 +5077,7 @@ public void mozMobileConnectionInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileICCInfo() throws Exception { test("MozMobileICCInfo"); } @@ -5099,7 +5086,7 @@ public void mozMobileICCInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileMessageManager() throws Exception { test("MozMobileMessageManager"); } @@ -5108,7 +5095,7 @@ public void mozMobileMessageManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileMessageThread() throws Exception { test("MozMobileMessageThread"); } @@ -5117,7 +5104,7 @@ public void mozMobileMessageThread() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileNetworkInfo() throws Exception { test("MozMobileNetworkInfo"); } @@ -5126,7 +5113,7 @@ public void mozMobileNetworkInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNDEFRecord() throws Exception { test("MozNDEFRecord"); } @@ -5135,7 +5122,7 @@ public void mozNDEFRecord() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNetworkStats() throws Exception { test("MozNetworkStats"); } @@ -5144,7 +5131,7 @@ public void mozNetworkStats() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNetworkStatsData() throws Exception { test("MozNetworkStatsData"); } @@ -5153,7 +5140,7 @@ public void mozNetworkStatsData() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNetworkStatsManager() throws Exception { test("MozNetworkStatsManager"); } @@ -5162,7 +5149,7 @@ public void mozNetworkStatsManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNFC() throws Exception { test("MozNFC"); } @@ -5171,7 +5158,7 @@ public void mozNFC() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNFCPeer() throws Exception { test("MozNFCPeer"); } @@ -5180,7 +5167,7 @@ public void mozNFCPeer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNFCTag() throws Exception { test("MozNFCTag"); } @@ -5189,7 +5176,7 @@ public void mozNFCTag() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozPowerManager() throws Exception { test("MozPowerManager"); } @@ -5198,7 +5185,7 @@ public void mozPowerManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozRTCIceCandidate() throws Exception { test("mozRTCIceCandidate"); } @@ -5207,7 +5194,7 @@ public void mozRTCIceCandidate() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozRTCPeerConnection() throws Exception { test("mozRTCPeerConnection"); } @@ -5216,7 +5203,7 @@ public void mozRTCPeerConnection() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozRTCSessionDescription() throws Exception { test("mozRTCSessionDescription"); } @@ -5225,7 +5212,7 @@ public void mozRTCSessionDescription() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSettingsEvent() throws Exception { test("MozSettingsEvent"); } @@ -5234,7 +5221,7 @@ public void mozSettingsEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSmsEvent() throws Exception { test("MozSmsEvent"); } @@ -5243,7 +5230,7 @@ public void mozSmsEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSmsFilter() throws Exception { test("MozSmsFilter"); } @@ -5252,7 +5239,7 @@ public void mozSmsFilter() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSmsManager() throws Exception { test("MozSmsManager"); } @@ -5261,7 +5248,7 @@ public void mozSmsManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSmsMessage() throws Exception { test("MozSmsMessage"); } @@ -5270,7 +5257,7 @@ public void mozSmsMessage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSmsSegmentInfo() throws Exception { test("MozSmsSegmentInfo"); } @@ -5279,7 +5266,7 @@ public void mozSmsSegmentInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSocial() throws Exception { test("MozSocial"); } @@ -5288,7 +5275,7 @@ public void mozSocial() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozTimeManager() throws Exception { test("MozTimeManager"); } @@ -5297,7 +5284,7 @@ public void mozTimeManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozVoicemail() throws Exception { test("MozVoicemail"); } @@ -5306,7 +5293,7 @@ public void mozVoicemail() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozVoicemailEvent() throws Exception { test("MozVoicemailEvent"); } @@ -5315,7 +5302,7 @@ public void mozVoicemailEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozVoicemailStatus() throws Exception { test("MozVoicemailStatus"); } @@ -5324,7 +5311,7 @@ public void mozVoicemailStatus() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozWifiConnectionInfoEvent() throws Exception { test("MozWifiConnectionInfoEvent"); } @@ -5333,7 +5320,7 @@ public void mozWifiConnectionInfoEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozWifiP2pGroupOwner() throws Exception { test("MozWifiP2pGroupOwner"); } @@ -5342,7 +5329,7 @@ public void mozWifiP2pGroupOwner() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozWifiP2pManager() throws Exception { test("MozWifiP2pManager"); } @@ -5351,7 +5338,7 @@ public void mozWifiP2pManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozWifiStatusChangeEvent() throws Exception { test("MozWifiStatusChangeEvent"); } @@ -5362,7 +5349,7 @@ public void mozWifiStatusChangeEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void msCurrentStyleCSSProperties() throws Exception { test("MSCurrentStyleCSSProperties"); } @@ -5371,7 +5358,7 @@ public void msCurrentStyleCSSProperties() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void msGestureEvent() throws Exception { test("MSGestureEvent"); } @@ -5382,7 +5369,7 @@ public void msGestureEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void msStyleCSSProperties() throws Exception { test("MSStyleCSSProperties"); } @@ -5393,7 +5380,7 @@ public void msStyleCSSProperties() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mutationEvent() throws Exception { test("MutationEvent"); } @@ -5402,7 +5389,7 @@ public void mutationEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mutationObserver() throws Exception { test("MutationObserver"); } @@ -5411,7 +5398,7 @@ public void mutationObserver() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mutationRecord() throws Exception { test("MutationRecord"); } @@ -5422,7 +5409,7 @@ public void mutationRecord() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void namedNodeMap() throws Exception { test("NamedNodeMap"); } @@ -5431,7 +5418,7 @@ public void namedNodeMap() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void nameList() throws Exception { test("NameList"); } @@ -5442,7 +5429,7 @@ public void nameList() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void namespace() throws Exception { test("Namespace"); } @@ -5453,7 +5440,7 @@ public void namespace() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void namespaceCollection() throws Exception { test("NamespaceCollection"); } @@ -5473,7 +5460,7 @@ public void naN() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void nativeXPathNSResolver() throws Exception { test("NativeXPathNSResolver"); } @@ -5484,7 +5471,7 @@ public void nativeXPathNSResolver() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigator() throws Exception { test("Navigator"); } @@ -5493,7 +5480,7 @@ public void navigator() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorConcurrentHardware() throws Exception { test("NavigatorConcurrentHardware"); } @@ -5502,7 +5489,7 @@ public void navigatorConcurrentHardware() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorGeolocation() throws Exception { test("NavigatorGeolocation"); } @@ -5511,7 +5498,7 @@ public void navigatorGeolocation() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorID() throws Exception { test("NavigatorID"); } @@ -5520,7 +5507,7 @@ public void navigatorID() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorLanguage() throws Exception { test("NavigatorLanguage"); } @@ -5529,7 +5516,7 @@ public void navigatorLanguage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorOnLine() throws Exception { test("NavigatorOnLine"); } @@ -5538,7 +5525,7 @@ public void navigatorOnLine() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorPlugins() throws Exception { test("NavigatorPlugins"); } @@ -5547,7 +5534,7 @@ public void navigatorPlugins() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorStorage() throws Exception { test("NavigatorStorage"); } @@ -5559,8 +5546,8 @@ public void navigatorStorage() throws Exception { */ @Test @Alerts(DEFAULT = "function NetworkInformation() { [native code] }", - FF = "exception", - FF_ESR = "exception") + FF = "ReferenceError", + FF_ESR = "ReferenceError") public void networkInformation() throws Exception { test("NetworkInformation"); } @@ -5571,7 +5558,7 @@ public void networkInformation() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void node() throws Exception { test("Node"); } @@ -5582,7 +5569,7 @@ public void node() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void nodeFilter() throws Exception { test("NodeFilter"); } @@ -5591,7 +5578,7 @@ public void nodeFilter() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void nodeIterator() throws Exception { test("NodeIterator"); } @@ -5602,7 +5589,7 @@ public void nodeIterator() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void nodeList() throws Exception { test("NodeList"); } @@ -5611,7 +5598,7 @@ public void nodeList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void nonDocumentTypeChildNode() throws Exception { test("NonDocumentTypeChildNode"); } @@ -5620,7 +5607,7 @@ public void nonDocumentTypeChildNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void notation() throws Exception { test("Notation"); } @@ -5640,7 +5627,7 @@ public void notification() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void notificationEvent() throws Exception { test("NotificationEvent"); } @@ -5649,7 +5636,7 @@ public void notificationEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void notifyAudioAvailableEvent() throws Exception { test("NotifyAudioAvailableEvent"); } @@ -5676,7 +5663,7 @@ public void object() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_element_index_uint() throws Exception { test("OES_element_index_uint"); } @@ -5685,7 +5672,7 @@ public void oes_element_index_uint() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_standard_derivatives() throws Exception { test("OES_standard_derivatives"); } @@ -5694,7 +5681,7 @@ public void oes_standard_derivatives() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_texture_float() throws Exception { test("OES_texture_float"); } @@ -5703,7 +5690,7 @@ public void oes_texture_float() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_texture_float_linear() throws Exception { test("OES_texture_float_linear"); } @@ -5712,7 +5699,7 @@ public void oes_texture_float_linear() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_texture_half_float() throws Exception { test("OES_texture_half_float"); } @@ -5721,7 +5708,7 @@ public void oes_texture_half_float() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_texture_half_float_linear() throws Exception { test("OES_texture_half_float_linear"); } @@ -5730,7 +5717,7 @@ public void oes_texture_half_float_linear() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_vertex_array_object() throws Exception { test("OES_vertex_array_object"); } @@ -5739,7 +5726,7 @@ public void oes_vertex_array_object() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void offlineAudioCompletionEvent() throws Exception { test("OfflineAudioCompletionEvent"); } @@ -5748,7 +5735,7 @@ public void offlineAudioCompletionEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void offlineAudioContext() throws Exception { test("OfflineAudioContext"); } @@ -5759,7 +5746,7 @@ public void offlineAudioContext() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void offlineResourceList() throws Exception { test("OfflineResourceList"); } @@ -5769,7 +5756,7 @@ public void offlineResourceList() throws Exception { */ @Test @Alerts("function OffscreenCanvas() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", EDGE = "exception", FF = "exception", FF_ESR = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", EDGE = "ReferenceError", FF = "ReferenceError", FF_ESR = "ReferenceError") public void offscreenCanvas() throws Exception { test("OffscreenCanvas"); } @@ -5780,7 +5767,7 @@ public void offscreenCanvas() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void option() throws Exception { test("Option"); } @@ -5789,7 +5776,7 @@ public void option() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oscillatorNode() throws Exception { test("OscillatorNode"); } @@ -5798,7 +5785,7 @@ public void oscillatorNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void overflowEvent() throws Exception { test("OverflowEvent"); } @@ -5807,7 +5794,7 @@ public void overflowEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void pageTransitionEvent() throws Exception { test("PageTransitionEvent"); } @@ -5816,7 +5803,7 @@ public void pageTransitionEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void pannerNode() throws Exception { test("PannerNode"); } @@ -5825,7 +5812,7 @@ public void pannerNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void parallelArray() throws Exception { test("ParallelArray"); } @@ -5834,7 +5821,7 @@ public void parallelArray() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void parentNode() throws Exception { test("ParentNode"); } @@ -5861,7 +5848,7 @@ public void parseInt() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void passwordCredential() throws Exception { test("PasswordCredential"); } @@ -5881,7 +5868,7 @@ public void path2D() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void paymentAddress() throws Exception { test("PaymentAddress"); } @@ -5890,7 +5877,7 @@ public void paymentAddress() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void paymentRequest() throws Exception { test("PaymentRequest"); } @@ -5899,7 +5886,7 @@ public void paymentRequest() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void paymentResponse() throws Exception { test("PaymentResponse"); } @@ -5926,7 +5913,7 @@ public void performanceEntry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void performanceFrameTiming() throws Exception { test("PerformanceFrameTiming"); } @@ -5953,7 +5940,7 @@ public void performanceMeasure() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void performanceNavigation() throws Exception { test("PerformanceNavigation"); } @@ -5962,7 +5949,7 @@ public void performanceNavigation() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void performanceNavigationTiming() throws Exception { test("PerformanceNavigationTiming"); } @@ -5998,7 +5985,7 @@ public void performanceResourceTiming() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void performanceTiming() throws Exception { test("PerformanceTiming"); } @@ -6007,7 +5994,7 @@ public void performanceTiming() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void periodicSyncEvent() throws Exception { test("PeriodicSyncEvent"); } @@ -6017,8 +6004,8 @@ public void periodicSyncEvent() throws Exception { */ @Test @Alerts(DEFAULT = "function PeriodicSyncManager() { [native code] }", - FF = "exception", - FF_ESR = "exception") + FF = "ReferenceError", + FF_ESR = "ReferenceError") public void periodicSyncManager() throws Exception { test("PeriodicSyncManager"); } @@ -6027,7 +6014,7 @@ public void periodicSyncManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void periodicSyncRegistration() throws Exception { test("PeriodicSyncRegistration"); } @@ -6036,7 +6023,7 @@ public void periodicSyncRegistration() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void periodicWave() throws Exception { test("PeriodicWave"); } @@ -6046,7 +6033,7 @@ public void periodicWave() throws Exception { */ @Test @Alerts(DEFAULT = "function Permissions() { [native code] }", - FF_ESR = "exception") + FF_ESR = "ReferenceError") public void permissions() throws Exception { test("Permissions"); } @@ -6055,7 +6042,7 @@ public void permissions() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void permissionSettings() throws Exception { test("PermissionSettings"); } @@ -6065,7 +6052,7 @@ public void permissionSettings() throws Exception { */ @Test @Alerts(DEFAULT = "function PermissionStatus() { [native code] }", - FF_ESR = "exception") + FF_ESR = "ReferenceError") public void permissionStatus() throws Exception { test("PermissionStatus"); } @@ -6076,7 +6063,7 @@ public void permissionStatus() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void plugin() throws Exception { test("Plugin"); } @@ -6087,7 +6074,7 @@ public void plugin() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void pluginArray() throws Exception { test("PluginArray"); } @@ -6096,7 +6083,7 @@ public void pluginArray() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void point() throws Exception { test("Point"); } @@ -6107,7 +6094,7 @@ public void point() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void pointerEvent() throws Exception { test("PointerEvent"); } @@ -6116,7 +6103,7 @@ public void pointerEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void popStateEvent() throws Exception { test("PopStateEvent"); } @@ -6125,7 +6112,7 @@ public void popStateEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void popup() throws Exception { test("Popup"); } @@ -6134,7 +6121,7 @@ public void popup() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void portCollection() throws Exception { test("PortCollection"); } @@ -6145,7 +6132,7 @@ public void portCollection() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void position() throws Exception { test("Position"); } @@ -6154,7 +6141,7 @@ public void position() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void positionError() throws Exception { test("PositionError"); } @@ -6163,7 +6150,7 @@ public void positionError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void positionOptions() throws Exception { test("PositionOptions"); } @@ -6172,7 +6159,7 @@ public void positionOptions() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void positionSensorVRDevice() throws Exception { test("PositionSensorVRDevice"); } @@ -6181,7 +6168,7 @@ public void positionSensorVRDevice() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void powerManager() throws Exception { test("PowerManager"); } @@ -6190,7 +6177,7 @@ public void powerManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void presentation() throws Exception { test("Presentation"); } @@ -6199,7 +6186,7 @@ public void presentation() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void presentationAvailability() throws Exception { test("PresentationAvailability"); } @@ -6208,7 +6195,7 @@ public void presentationAvailability() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void presentationConnection() throws Exception { test("PresentationConnection"); } @@ -6217,7 +6204,7 @@ public void presentationConnection() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void presentationConnectionAvailableEvent() throws Exception { test("PresentationConnectionAvailableEvent"); } @@ -6226,7 +6213,7 @@ public void presentationConnectionAvailableEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void presentationConnectionClosedEvent() throws Exception { test("PresentationConnectionClosedEvent"); } @@ -6235,7 +6222,7 @@ public void presentationConnectionClosedEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void presentationConnectionCloseEvent() throws Exception { test("PresentationConnectionCloseEvent"); } @@ -6244,7 +6231,7 @@ public void presentationConnectionCloseEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void presentationConnectionList() throws Exception { test("PresentationConnectionList"); } @@ -6253,7 +6240,7 @@ public void presentationConnectionList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void presentationReceiver() throws Exception { test("PresentationReceiver"); } @@ -6262,7 +6249,7 @@ public void presentationReceiver() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void presentationRequest() throws Exception { test("PresentationRequest"); } @@ -6273,7 +6260,7 @@ public void presentationRequest() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void processingInstruction() throws Exception { test("ProcessingInstruction"); } @@ -6300,7 +6287,7 @@ public void promise() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void promiseRejection() throws Exception { test("PromiseRejection"); } @@ -6318,7 +6305,7 @@ public void promiseRejectionEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void promiseResolver() throws Exception { test("PromiseResolver"); } @@ -6336,7 +6323,7 @@ public void proxy() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void pushEvent() throws Exception { test("PushEvent"); } @@ -6346,7 +6333,7 @@ public void pushEvent() throws Exception { */ @Test @Alerts(DEFAULT = "function PushManager() { [native code] }", - FF_ESR = "exception") + FF_ESR = "ReferenceError") public void pushManager() throws Exception { test("PushManager"); } @@ -6355,7 +6342,7 @@ public void pushManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void pushMessageData() throws Exception { test("PushMessageData"); } @@ -6364,7 +6351,7 @@ public void pushMessageData() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void pushRegistrationManager() throws Exception { test("PushRegistrationManager"); } @@ -6374,7 +6361,7 @@ public void pushRegistrationManager() throws Exception { */ @Test @Alerts(DEFAULT = "function PushSubscription() { [native code] }", - FF_ESR = "exception") + FF_ESR = "ReferenceError") public void pushSubscription() throws Exception { test("PushSubscription"); } @@ -6384,7 +6371,7 @@ public void pushSubscription() throws Exception { */ @Test @Alerts(DEFAULT = "function PushSubscriptionOptions() { [native code] }", - FF_ESR = "exception") + FF_ESR = "ReferenceError") public void pushSubscriptionOptions() throws Exception { test("PushSubscriptionOptions"); } @@ -6393,7 +6380,7 @@ public void pushSubscriptionOptions() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void radioNodeList() throws Exception { test("RadioNodeList"); } @@ -6402,7 +6389,7 @@ public void radioNodeList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void randomSource() throws Exception { test("RandomSource"); } @@ -6413,7 +6400,7 @@ public void randomSource() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void range() throws Exception { test("Range"); } @@ -6431,7 +6418,7 @@ public void rangeError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void readableByteStream() throws Exception { test("ReadableByteStream"); } @@ -6476,7 +6463,7 @@ public void regExp() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void remotePlayback() throws Exception { test("RemotePlayback"); } @@ -6485,7 +6472,7 @@ public void remotePlayback() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void renderingContext() throws Exception { test("RenderingContext"); } @@ -6514,7 +6501,7 @@ public void response() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rowContainer() throws Exception { test("RowContainer"); } @@ -6523,7 +6510,7 @@ public void rowContainer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcCertificate() throws Exception { test("RTCCertificate"); } @@ -6532,7 +6519,7 @@ public void rtcCertificate() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcConfiguration() throws Exception { test("RTCConfiguration"); } @@ -6542,9 +6529,9 @@ public void rtcConfiguration() throws Exception { */ @Test @Alerts(DEFAULT = "function RTCDataChannel() { [native code] }", - FF = "exception", - FF_ESR = "exception") - @HtmlUnitNYI(CHROME = "exception", EDGE = "exception") + FF = "ReferenceError", + FF_ESR = "ReferenceError") + @HtmlUnitNYI(CHROME = "ReferenceError", EDGE = "ReferenceError") public void rtcDataChannel() throws Exception { test("RTCDataChannel"); } @@ -6553,7 +6540,7 @@ public void rtcDataChannel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcDataChannelEvent() throws Exception { test("RTCDataChannelEvent"); } @@ -6562,7 +6549,7 @@ public void rtcDataChannelEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcIceCandidate() throws Exception { test("RTCIceCandidate"); } @@ -6571,7 +6558,7 @@ public void rtcIceCandidate() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcIceServer() throws Exception { test("RTCIceServer"); } @@ -6580,7 +6567,7 @@ public void rtcIceServer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcIdentityAssertion() throws Exception { test("RTCIdentityAssertion"); } @@ -6589,7 +6576,7 @@ public void rtcIdentityAssertion() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcIdentityErrorEvent() throws Exception { test("RTCIdentityErrorEvent"); } @@ -6598,7 +6585,7 @@ public void rtcIdentityErrorEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcIdentityEvent() throws Exception { test("RTCIdentityEvent"); } @@ -6607,7 +6594,7 @@ public void rtcIdentityEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcPeerConnection() throws Exception { test("RTCPeerConnection"); } @@ -6616,7 +6603,7 @@ public void rtcPeerConnection() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcPeerConnectionIceEvent() throws Exception { test("RTCPeerConnectionIceEvent"); } @@ -6625,7 +6612,7 @@ public void rtcPeerConnectionIceEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcSctpTransport() throws Exception { test("RTCSctpTransport"); } @@ -6634,7 +6621,7 @@ public void rtcSctpTransport() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcSessionDescription() throws Exception { test("RTCSessionDescription"); } @@ -6643,7 +6630,7 @@ public void rtcSessionDescription() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcSessionDescriptionCallback() throws Exception { test("RTCSessionDescriptionCallback"); } @@ -6652,7 +6639,7 @@ public void rtcSessionDescriptionCallback() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcStatsReport() throws Exception { test("RTCStatsReport"); } @@ -6663,7 +6650,7 @@ public void rtcStatsReport() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void screen() throws Exception { test("Screen"); } @@ -6672,7 +6659,7 @@ public void screen() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void screenOrientation() throws Exception { test("ScreenOrientation"); } @@ -6681,7 +6668,7 @@ public void screenOrientation() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void scriptProcessorNode() throws Exception { test("ScriptProcessorNode"); } @@ -6691,8 +6678,8 @@ public void scriptProcessorNode() throws Exception { */ @Test @Alerts(DEFAULT = "function SecurityPolicyViolationEvent() { [native code] }", - FF = "exception", - FF_ESR = "exception") + FF = "ReferenceError", + FF_ESR = "ReferenceError") public void securityPolicyViolationEvent() throws Exception { test("SecurityPolicyViolationEvent"); } @@ -6703,7 +6690,7 @@ public void securityPolicyViolationEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void selection() throws Exception { test("Selection"); } @@ -6712,9 +6699,9 @@ public void selection() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function ServiceWorker() { [native code] }") - @HtmlUnitNYI(FF = "exception") + @HtmlUnitNYI(FF = "ReferenceError") public void serviceWorker() throws Exception { test("ServiceWorker"); } @@ -6723,9 +6710,9 @@ public void serviceWorker() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function ServiceWorkerContainer() { [native code] }") - @HtmlUnitNYI(FF = "exception") + @HtmlUnitNYI(FF = "ReferenceError") public void serviceWorkerContainer() throws Exception { test("ServiceWorkerContainer"); } @@ -6734,7 +6721,7 @@ public void serviceWorkerContainer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void serviceWorkerGlobalScope() throws Exception { test("ServiceWorkerGlobalScope"); } @@ -6743,7 +6730,7 @@ public void serviceWorkerGlobalScope() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void serviceWorkerMessageEvent() throws Exception { test("ServiceWorkerMessageEvent"); } @@ -6753,7 +6740,7 @@ public void serviceWorkerMessageEvent() throws Exception { */ @Test @Alerts(DEFAULT = "function ServiceWorkerRegistration() { [native code] }", - FF_ESR = "exception") + FF_ESR = "ReferenceError") public void serviceWorkerRegistration() throws Exception { test("ServiceWorkerRegistration"); } @@ -6762,7 +6749,7 @@ public void serviceWorkerRegistration() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void serviceWorkerState() throws Exception { test("ServiceWorkerState"); } @@ -6780,7 +6767,7 @@ public void set() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void settingsLock() throws Exception { test("SettingsLock"); } @@ -6789,7 +6776,7 @@ public void settingsLock() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void settingsManager() throws Exception { test("SettingsManager"); } @@ -6800,7 +6787,7 @@ public void settingsManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void shadowRoot() throws Exception { test("ShadowRoot"); } @@ -6809,7 +6796,7 @@ public void shadowRoot() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void sharedArrayBuffer() throws Exception { test("SharedArrayBuffer"); } @@ -6818,7 +6805,7 @@ public void sharedArrayBuffer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void sharedKeyframeList() throws Exception { test("SharedKeyframeList"); } @@ -6829,7 +6816,7 @@ public void sharedKeyframeList() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void sharedWorker() throws Exception { test("SharedWorker"); } @@ -6838,7 +6825,7 @@ public void sharedWorker() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void sharedWorkerGlobalScope() throws Exception { test("SharedWorkerGlobalScope"); } @@ -6847,7 +6834,7 @@ public void sharedWorkerGlobalScope() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd() throws Exception { test("SIMD"); } @@ -6856,7 +6843,7 @@ public void simd() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool16x8() throws Exception { test("SIMD.Bool16x8"); } @@ -6865,7 +6852,7 @@ public void simd_Bool16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool32x4() throws Exception { test("SIMD.Bool32x4"); } @@ -6874,7 +6861,7 @@ public void simd_Bool32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool64x2() throws Exception { test("SIMD.Bool64x2"); } @@ -6883,7 +6870,7 @@ public void simd_Bool64x2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool8x16() throws Exception { test("SIMD.Bool8x16"); } @@ -6892,7 +6879,7 @@ public void simd_Bool8x16() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_float32x4() throws Exception { test("SIMD.float32x4"); } @@ -6901,7 +6888,7 @@ public void simd_float32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Float32x4() throws Exception { test("SIMD.Float32x4"); } @@ -6910,7 +6897,7 @@ public void simd_Float32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_float64x2() throws Exception { test("SIMD.float64x2"); } @@ -6919,7 +6906,7 @@ public void simd_float64x2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Float64x2() throws Exception { test("SIMD.Float64x2"); } @@ -6928,7 +6915,7 @@ public void simd_Float64x2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_int16x8() throws Exception { test("SIMD.int16x8"); } @@ -6937,7 +6924,7 @@ public void simd_int16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Int16x8() throws Exception { test("SIMD.Int16x8"); } @@ -6946,7 +6933,7 @@ public void simd_Int16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_int32x4() throws Exception { test("SIMD.int32x4"); } @@ -6955,7 +6942,7 @@ public void simd_int32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Int32x4() throws Exception { test("SIMD.Int32x4"); } @@ -6964,7 +6951,7 @@ public void simd_Int32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_int8x16() throws Exception { test("SIMD.int8x16"); } @@ -6973,7 +6960,7 @@ public void simd_int8x16() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Int8x16() throws Exception { test("SIMD.Int8x16"); } @@ -6982,7 +6969,7 @@ public void simd_Int8x16() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Uint16x8() throws Exception { test("SIMD.Uint16x8"); } @@ -6991,7 +6978,7 @@ public void simd_Uint16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Uint32x4() throws Exception { test("SIMD.Uint32x4"); } @@ -7000,7 +6987,7 @@ public void simd_Uint32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Uint8x16() throws Exception { test("SIMD.Uint8x16"); } @@ -7011,7 +6998,7 @@ public void simd_Uint8x16() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simpleArray() throws Exception { test("SimpleArray"); } @@ -7020,7 +7007,7 @@ public void simpleArray() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void siteBoundCredential() throws Exception { test("SiteBoundCredential"); } @@ -7030,8 +7017,8 @@ public void siteBoundCredential() throws Exception { */ @Test @Alerts(DEFAULT = "function SourceBuffer() { [native code] }", - FF = "exception", - FF_ESR = "exception") + FF = "ReferenceError", + FF_ESR = "ReferenceError") public void sourceBuffer() throws Exception { test("SourceBuffer"); } @@ -7041,8 +7028,8 @@ public void sourceBuffer() throws Exception { */ @Test @Alerts(DEFAULT = "function SourceBufferList() { [native code] }", - FF = "exception", - FF_ESR = "exception") + FF = "ReferenceError", + FF_ESR = "ReferenceError") public void sourceBufferList() throws Exception { test("SourceBufferList"); } @@ -7051,7 +7038,7 @@ public void sourceBufferList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechGrammar() throws Exception { test("SpeechGrammar"); } @@ -7060,7 +7047,7 @@ public void speechGrammar() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechGrammarList() throws Exception { test("SpeechGrammarList"); } @@ -7069,7 +7056,7 @@ public void speechGrammarList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognition() throws Exception { test("SpeechRecognition"); } @@ -7078,7 +7065,7 @@ public void speechRecognition() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognitionAlternative() throws Exception { test("SpeechRecognitionAlternative"); } @@ -7087,7 +7074,7 @@ public void speechRecognitionAlternative() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognitionError() throws Exception { test("SpeechRecognitionError"); } @@ -7096,7 +7083,7 @@ public void speechRecognitionError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognitionErrorEvent() throws Exception { test("SpeechRecognitionErrorEvent"); } @@ -7105,7 +7092,7 @@ public void speechRecognitionErrorEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognitionEvent() throws Exception { test("SpeechRecognitionEvent"); } @@ -7114,7 +7101,7 @@ public void speechRecognitionEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognitionResult() throws Exception { test("SpeechRecognitionResult"); } @@ -7123,7 +7110,7 @@ public void speechRecognitionResult() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognitionResultList() throws Exception { test("SpeechRecognitionResultList"); } @@ -7132,7 +7119,7 @@ public void speechRecognitionResultList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechSynthesis() throws Exception { test("SpeechSynthesis"); } @@ -7141,7 +7128,7 @@ public void speechSynthesis() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechSynthesisErrorEvent() throws Exception { test("SpeechSynthesisErrorEvent"); } @@ -7150,7 +7137,7 @@ public void speechSynthesisErrorEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechSynthesisEvent() throws Exception { test("SpeechSynthesisEvent"); } @@ -7159,7 +7146,7 @@ public void speechSynthesisEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechSynthesisUtterance() throws Exception { test("SpeechSynthesisUtterance"); } @@ -7168,7 +7155,7 @@ public void speechSynthesisUtterance() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechSynthesisVoice() throws Exception { test("SpeechSynthesisVoice"); } @@ -7177,7 +7164,7 @@ public void speechSynthesisVoice() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void staticNodeList() throws Exception { test("StaticNodeList"); } @@ -7186,7 +7173,7 @@ public void staticNodeList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void stereoPannerNode() throws Exception { test("StereoPannerNode"); } @@ -7197,7 +7184,7 @@ public void stereoPannerNode() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void stopIteration() throws Exception { test("StopIteration"); } @@ -7208,7 +7195,7 @@ public void stopIteration() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void storage() throws Exception { test("Storage"); } @@ -7217,7 +7204,7 @@ public void storage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void storageEstimate() throws Exception { test("StorageEstimate"); } @@ -7226,7 +7213,7 @@ public void storageEstimate() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void storageEvent() throws Exception { test("StorageEvent"); } @@ -7244,7 +7231,7 @@ public void storageManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void storageQuota() throws Exception { test("StorageQuota"); } @@ -7262,7 +7249,7 @@ public void string() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void styleMedia() throws Exception { test("StyleMedia"); } @@ -7271,7 +7258,7 @@ public void styleMedia() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void styleSheet() throws Exception { test("StyleSheet"); } @@ -7282,7 +7269,7 @@ public void styleSheet() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void styleSheetList() throws Exception { test("StyleSheetList"); } @@ -7291,7 +7278,7 @@ public void styleSheetList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void submitEvent() throws Exception { test("SubmitEvent"); } @@ -7311,7 +7298,7 @@ public void subtleCrypto() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAElement() throws Exception { test("SVGAElement"); } @@ -7320,7 +7307,7 @@ public void svgAElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAltGlyphElement() throws Exception { test("SVGAltGlyphElement"); } @@ -7331,7 +7318,7 @@ public void svgAltGlyphElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAngle() throws Exception { test("SVGAngle"); } @@ -7340,7 +7327,7 @@ public void svgAngle() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimateColorElement() throws Exception { test("SVGAnimateColorElement"); } @@ -7349,7 +7336,7 @@ public void svgAnimateColorElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedAngle() throws Exception { test("SVGAnimatedAngle"); } @@ -7358,7 +7345,7 @@ public void svgAnimatedAngle() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedBoolean() throws Exception { test("SVGAnimatedBoolean"); } @@ -7367,7 +7354,7 @@ public void svgAnimatedBoolean() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedEnumeration() throws Exception { test("SVGAnimatedEnumeration"); } @@ -7376,7 +7363,7 @@ public void svgAnimatedEnumeration() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedInteger() throws Exception { test("SVGAnimatedInteger"); } @@ -7385,7 +7372,7 @@ public void svgAnimatedInteger() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedLength() throws Exception { test("SVGAnimatedLength"); } @@ -7394,7 +7381,7 @@ public void svgAnimatedLength() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedLengthList() throws Exception { test("SVGAnimatedLengthList"); } @@ -7403,7 +7390,7 @@ public void svgAnimatedLengthList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedNumber() throws Exception { test("SVGAnimatedNumber"); } @@ -7412,7 +7399,7 @@ public void svgAnimatedNumber() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedNumberList() throws Exception { test("SVGAnimatedNumberList"); } @@ -7421,7 +7408,7 @@ public void svgAnimatedNumberList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedPoints() throws Exception { test("SVGAnimatedPoints"); } @@ -7430,7 +7417,7 @@ public void svgAnimatedPoints() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedPreserveAspectRatio() throws Exception { test("SVGAnimatedPreserveAspectRatio"); } @@ -7439,7 +7426,7 @@ public void svgAnimatedPreserveAspectRatio() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedRect() throws Exception { test("SVGAnimatedRect"); } @@ -7448,7 +7435,7 @@ public void svgAnimatedRect() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedString() throws Exception { test("SVGAnimatedString"); } @@ -7457,7 +7444,7 @@ public void svgAnimatedString() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedTransformList() throws Exception { test("SVGAnimatedTransformList"); } @@ -7468,7 +7455,7 @@ public void svgAnimatedTransformList() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimateElement() throws Exception { test("SVGAnimateElement"); } @@ -7479,7 +7466,7 @@ public void svgAnimateElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimateMotionElement() throws Exception { test("SVGAnimateMotionElement"); } @@ -7490,7 +7477,7 @@ public void svgAnimateMotionElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimateTransformElement() throws Exception { test("SVGAnimateTransformElement"); } @@ -7499,7 +7486,7 @@ public void svgAnimateTransformElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimationElement() throws Exception { test("SVGAnimationElement"); } @@ -7510,7 +7497,7 @@ public void svgAnimationElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgCircleElement() throws Exception { test("SVGCircleElement"); } @@ -7521,7 +7508,7 @@ public void svgCircleElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgClipPathElement() throws Exception { test("SVGClipPathElement"); } @@ -7530,7 +7517,7 @@ public void svgClipPathElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgComponentTransferFunctionElement() throws Exception { test("SVGComponentTransferFunctionElement"); } @@ -7539,7 +7526,7 @@ public void svgComponentTransferFunctionElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgCursorElement() throws Exception { test("SVGCursorElement"); } @@ -7550,7 +7537,7 @@ public void svgCursorElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgDefsElement() throws Exception { test("SVGDefsElement"); } @@ -7561,7 +7548,7 @@ public void svgDefsElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgDescElement() throws Exception { test("SVGDescElement"); } @@ -7570,7 +7557,7 @@ public void svgDescElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgDiscardElement() throws Exception { test("SVGDiscardElement"); } @@ -7579,7 +7566,7 @@ public void svgDiscardElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgDocument() throws Exception { test("SVGDocument"); } @@ -7590,7 +7577,7 @@ public void svgDocument() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgElement() throws Exception { test("SVGElement"); } @@ -7601,7 +7588,7 @@ public void svgElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgEllipseElement() throws Exception { test("SVGEllipseElement"); } @@ -7610,7 +7597,7 @@ public void svgEllipseElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgEvent() throws Exception { test("SVGEvent"); } @@ -7621,7 +7608,7 @@ public void svgEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEBlendElement() throws Exception { test("SVGFEBlendElement"); } @@ -7632,7 +7619,7 @@ public void svgFEBlendElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEColorMatrixElement() throws Exception { test("SVGFEColorMatrixElement"); } @@ -7643,7 +7630,7 @@ public void svgFEColorMatrixElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEComponentTransferElement() throws Exception { test("SVGFEComponentTransferElement"); } @@ -7654,7 +7641,7 @@ public void svgFEComponentTransferElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFECompositeElement() throws Exception { test("SVGFECompositeElement"); } @@ -7665,7 +7652,7 @@ public void svgFECompositeElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEConvolveMatrixElement() throws Exception { test("SVGFEConvolveMatrixElement"); } @@ -7676,7 +7663,7 @@ public void svgFEConvolveMatrixElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEDiffuseLightingElement() throws Exception { test("SVGFEDiffuseLightingElement"); } @@ -7687,7 +7674,7 @@ public void svgFEDiffuseLightingElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEDisplacementMapElement() throws Exception { test("SVGFEDisplacementMapElement"); } @@ -7698,7 +7685,7 @@ public void svgFEDisplacementMapElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEDistantLightElement() throws Exception { test("SVGFEDistantLightElement"); } @@ -7707,7 +7694,7 @@ public void svgFEDistantLightElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEDropShadowElement() throws Exception { test("SVGFEDropShadowElement"); } @@ -7718,7 +7705,7 @@ public void svgFEDropShadowElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEFloodElement() throws Exception { test("SVGFEFloodElement"); } @@ -7729,7 +7716,7 @@ public void svgFEFloodElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEFuncAElement() throws Exception { test("SVGFEFuncAElement"); } @@ -7740,7 +7727,7 @@ public void svgFEFuncAElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEFuncBElement() throws Exception { test("SVGFEFuncBElement"); } @@ -7751,7 +7738,7 @@ public void svgFEFuncBElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEFuncGElement() throws Exception { test("SVGFEFuncGElement"); } @@ -7762,7 +7749,7 @@ public void svgFEFuncGElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEFuncRElement() throws Exception { test("SVGFEFuncRElement"); } @@ -7773,7 +7760,7 @@ public void svgFEFuncRElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEGaussianBlurElement() throws Exception { test("SVGFEGaussianBlurElement"); } @@ -7784,7 +7771,7 @@ public void svgFEGaussianBlurElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEImageElement() throws Exception { test("SVGFEImageElement"); } @@ -7795,7 +7782,7 @@ public void svgFEImageElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEMergeElement() throws Exception { test("SVGFEMergeElement"); } @@ -7806,7 +7793,7 @@ public void svgFEMergeElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEMergeNodeElement() throws Exception { test("SVGFEMergeNodeElement"); } @@ -7817,7 +7804,7 @@ public void svgFEMergeNodeElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEMorphologyElement() throws Exception { test("SVGFEMorphologyElement"); } @@ -7828,7 +7815,7 @@ public void svgFEMorphologyElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEOffsetElement() throws Exception { test("SVGFEOffsetElement"); } @@ -7839,7 +7826,7 @@ public void svgFEOffsetElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFEPointLightElement() throws Exception { test("SVGFEPointLightElement"); } @@ -7850,7 +7837,7 @@ public void svgFEPointLightElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFESpecularLightingElement() throws Exception { test("SVGFESpecularLightingElement"); } @@ -7861,7 +7848,7 @@ public void svgFESpecularLightingElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFESpotLightElement() throws Exception { test("SVGFESpotLightElement"); } @@ -7872,7 +7859,7 @@ public void svgFESpotLightElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFETileElement() throws Exception { test("SVGFETileElement"); } @@ -7883,7 +7870,7 @@ public void svgFETileElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFETurbulenceElement() throws Exception { test("SVGFETurbulenceElement"); } @@ -7894,7 +7881,7 @@ public void svgFETurbulenceElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFilterElement() throws Exception { test("SVGFilterElement"); } @@ -7903,7 +7890,7 @@ public void svgFilterElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFontElement() throws Exception { test("SVGFontElement"); } @@ -7912,7 +7899,7 @@ public void svgFontElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFontFaceElement() throws Exception { test("SVGFontFaceElement"); } @@ -7921,7 +7908,7 @@ public void svgFontFaceElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFontFaceFormatElement() throws Exception { test("SVGFontFaceFormatElement"); } @@ -7930,7 +7917,7 @@ public void svgFontFaceFormatElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFontFaceNameElement() throws Exception { test("SVGFontFaceNameElement"); } @@ -7939,7 +7926,7 @@ public void svgFontFaceNameElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFontFaceSrcElement() throws Exception { test("SVGFontFaceSrcElement"); } @@ -7948,7 +7935,7 @@ public void svgFontFaceSrcElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFontFaceUriElement() throws Exception { test("SVGFontFaceUriElement"); } @@ -7959,7 +7946,7 @@ public void svgFontFaceUriElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgForeignObjectElement() throws Exception { test("SVGForeignObjectElement"); } @@ -7970,7 +7957,7 @@ public void svgForeignObjectElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgGElement() throws Exception { test("SVGGElement"); } @@ -7979,7 +7966,7 @@ public void svgGElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgGeometryElement() throws Exception { test("SVGGeometryElement"); } @@ -7988,7 +7975,7 @@ public void svgGeometryElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgGlyphElement() throws Exception { test("SVGGlyphElement"); } @@ -7997,7 +7984,7 @@ public void svgGlyphElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgGradientElement() throws Exception { test("SVGGradientElement"); } @@ -8006,7 +7993,7 @@ public void svgGradientElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgGraphicsElement() throws Exception { test("SVGGraphicsElement"); } @@ -8015,7 +8002,7 @@ public void svgGraphicsElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgHKernElement() throws Exception { test("SVGHKernElement"); } @@ -8026,7 +8013,7 @@ public void svgHKernElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgImageElement() throws Exception { test("SVGImageElement"); } @@ -8035,7 +8022,7 @@ public void svgImageElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgLength() throws Exception { test("SVGLength"); } @@ -8044,7 +8031,7 @@ public void svgLength() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgLengthList() throws Exception { test("SVGLengthList"); } @@ -8055,7 +8042,7 @@ public void svgLengthList() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgLinearGradientElement() throws Exception { test("SVGLinearGradientElement"); } @@ -8066,7 +8053,7 @@ public void svgLinearGradientElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgLineElement() throws Exception { test("SVGLineElement"); } @@ -8077,7 +8064,7 @@ public void svgLineElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgMarkerElement() throws Exception { test("SVGMarkerElement"); } @@ -8088,7 +8075,7 @@ public void svgMarkerElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgMaskElement() throws Exception { test("SVGMaskElement"); } @@ -8099,7 +8086,7 @@ public void svgMaskElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgMatrix() throws Exception { test("SVGMatrix"); } @@ -8110,7 +8097,7 @@ public void svgMatrix() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgMetadataElement() throws Exception { test("SVGMetadataElement"); } @@ -8119,7 +8106,7 @@ public void svgMetadataElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgMissingGlyphElement() throws Exception { test("SVGMissingGlyphElement"); } @@ -8130,7 +8117,7 @@ public void svgMissingGlyphElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgMPathElement() throws Exception { test("SVGMPathElement"); } @@ -8139,7 +8126,7 @@ public void svgMPathElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgNumber() throws Exception { test("SVGNumber"); } @@ -8148,7 +8135,7 @@ public void svgNumber() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgNumberList() throws Exception { test("SVGNumberList"); } @@ -8159,7 +8146,7 @@ public void svgNumberList() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathElement() throws Exception { test("SVGPathElement"); } @@ -8168,7 +8155,7 @@ public void svgPathElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSeg() throws Exception { test("SVGPathSeg"); } @@ -8177,7 +8164,7 @@ public void svgPathSeg() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegArcAbs() throws Exception { test("SVGPathSegArcAbs"); } @@ -8186,7 +8173,7 @@ public void svgPathSegArcAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegArcRel() throws Exception { test("SVGPathSegArcRel"); } @@ -8195,7 +8182,7 @@ public void svgPathSegArcRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegClosePath() throws Exception { test("SVGPathSegClosePath"); } @@ -8204,7 +8191,7 @@ public void svgPathSegClosePath() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoCubicAbs() throws Exception { test("SVGPathSegCurvetoCubicAbs"); } @@ -8213,7 +8200,7 @@ public void svgPathSegCurvetoCubicAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoCubicRel() throws Exception { test("SVGPathSegCurvetoCubicRel"); } @@ -8222,7 +8209,7 @@ public void svgPathSegCurvetoCubicRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoCubicSmoothAbs() throws Exception { test("SVGPathSegCurvetoCubicSmoothAbs"); } @@ -8231,7 +8218,7 @@ public void svgPathSegCurvetoCubicSmoothAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoCubicSmoothRel() throws Exception { test("SVGPathSegCurvetoCubicSmoothRel"); } @@ -8240,7 +8227,7 @@ public void svgPathSegCurvetoCubicSmoothRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoQuadraticAbs() throws Exception { test("SVGPathSegCurvetoQuadraticAbs"); } @@ -8249,7 +8236,7 @@ public void svgPathSegCurvetoQuadraticAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoQuadraticRel() throws Exception { test("SVGPathSegCurvetoQuadraticRel"); } @@ -8258,7 +8245,7 @@ public void svgPathSegCurvetoQuadraticRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoQuadraticSmoothAbs() throws Exception { test("SVGPathSegCurvetoQuadraticSmoothAbs"); } @@ -8267,7 +8254,7 @@ public void svgPathSegCurvetoQuadraticSmoothAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoQuadraticSmoothRel() throws Exception { test("SVGPathSegCurvetoQuadraticSmoothRel"); } @@ -8276,7 +8263,7 @@ public void svgPathSegCurvetoQuadraticSmoothRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegLinetoAbs() throws Exception { test("SVGPathSegLinetoAbs"); } @@ -8285,7 +8272,7 @@ public void svgPathSegLinetoAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegLinetoHorizontalAbs() throws Exception { test("SVGPathSegLinetoHorizontalAbs"); } @@ -8294,7 +8281,7 @@ public void svgPathSegLinetoHorizontalAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegLinetoHorizontalRel() throws Exception { test("SVGPathSegLinetoHorizontalRel"); } @@ -8303,7 +8290,7 @@ public void svgPathSegLinetoHorizontalRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegLinetoRel() throws Exception { test("SVGPathSegLinetoRel"); } @@ -8312,7 +8299,7 @@ public void svgPathSegLinetoRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegLinetoVerticalAbs() throws Exception { test("SVGPathSegLinetoVerticalAbs"); } @@ -8321,7 +8308,7 @@ public void svgPathSegLinetoVerticalAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegLinetoVerticalRel() throws Exception { test("SVGPathSegLinetoVerticalRel"); } @@ -8330,7 +8317,7 @@ public void svgPathSegLinetoVerticalRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegList() throws Exception { test("SVGPathSegList"); } @@ -8339,7 +8326,7 @@ public void svgPathSegList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegMovetoAbs() throws Exception { test("SVGPathSegMovetoAbs"); } @@ -8348,7 +8335,7 @@ public void svgPathSegMovetoAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegMovetoRel() throws Exception { test("SVGPathSegMovetoRel"); } @@ -8359,7 +8346,7 @@ public void svgPathSegMovetoRel() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPatternElement() throws Exception { test("SVGPatternElement"); } @@ -8368,7 +8355,7 @@ public void svgPatternElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPoint() throws Exception { test("SVGPoint"); } @@ -8377,7 +8364,7 @@ public void svgPoint() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPointList() throws Exception { test("SVGPointList"); } @@ -8388,7 +8375,7 @@ public void svgPointList() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPolygonElement() throws Exception { test("SVGPolygonElement"); } @@ -8399,7 +8386,7 @@ public void svgPolygonElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPolylineElement() throws Exception { test("SVGPolylineElement"); } @@ -8408,7 +8395,7 @@ public void svgPolylineElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPreserveAspectRatio() throws Exception { test("SVGPreserveAspectRatio"); } @@ -8419,7 +8406,7 @@ public void svgPreserveAspectRatio() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgRadialGradientElement() throws Exception { test("SVGRadialGradientElement"); } @@ -8430,7 +8417,7 @@ public void svgRadialGradientElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgRect() throws Exception { test("SVGRect"); } @@ -8441,7 +8428,7 @@ public void svgRect() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgRectElement() throws Exception { test("SVGRectElement"); } @@ -8450,7 +8437,7 @@ public void svgRectElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgRenderingIntent() throws Exception { test("SVGRenderingIntent"); } @@ -8461,7 +8448,7 @@ public void svgRenderingIntent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgScriptElement() throws Exception { test("SVGScriptElement"); } @@ -8472,7 +8459,7 @@ public void svgScriptElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgSetElement() throws Exception { test("SVGSetElement"); } @@ -8483,7 +8470,7 @@ public void svgSetElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgStopElement() throws Exception { test("SVGStopElement"); } @@ -8492,7 +8479,7 @@ public void svgStopElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgStringList() throws Exception { test("SVGStringList"); } @@ -8501,7 +8488,7 @@ public void svgStringList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgStylable() throws Exception { test("SVGStylable"); } @@ -8512,7 +8499,7 @@ public void svgStylable() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgStyleElement() throws Exception { test("SVGStyleElement"); } @@ -8523,7 +8510,7 @@ public void svgStyleElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgSVGElement() throws Exception { test("SVGSVGElement"); } @@ -8534,7 +8521,7 @@ public void svgSVGElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgSwitchElement() throws Exception { test("SVGSwitchElement"); } @@ -8545,7 +8532,7 @@ public void svgSwitchElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgSymbolElement() throws Exception { test("SVGSymbolElement"); } @@ -8554,7 +8541,7 @@ public void svgSymbolElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTests() throws Exception { test("SVGTests"); } @@ -8563,7 +8550,7 @@ public void svgTests() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTextContentElement() throws Exception { test("SVGTextContentElement"); } @@ -8574,7 +8561,7 @@ public void svgTextContentElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTextElement() throws Exception { test("SVGTextElement"); } @@ -8585,7 +8572,7 @@ public void svgTextElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTextPathElement() throws Exception { test("SVGTextPathElement"); } @@ -8594,7 +8581,7 @@ public void svgTextPathElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTextPositioningElement() throws Exception { test("SVGTextPositioningElement"); } @@ -8605,7 +8592,7 @@ public void svgTextPositioningElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTitleElement() throws Exception { test("SVGTitleElement"); } @@ -8614,7 +8601,7 @@ public void svgTitleElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTransform() throws Exception { test("SVGTransform"); } @@ -8623,7 +8610,7 @@ public void svgTransform() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTransformable() throws Exception { test("SVGTransformable"); } @@ -8632,7 +8619,7 @@ public void svgTransformable() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTransformList() throws Exception { test("SVGTransformList"); } @@ -8641,7 +8628,7 @@ public void svgTransformList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTRefElement() throws Exception { test("SVGTRefElement"); } @@ -8652,7 +8639,7 @@ public void svgTRefElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTSpanElement() throws Exception { test("SVGTSpanElement"); } @@ -8661,7 +8648,7 @@ public void svgTSpanElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgUnitTypes() throws Exception { test("SVGUnitTypes"); } @@ -8672,7 +8659,7 @@ public void svgUnitTypes() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgUseElement() throws Exception { test("SVGUseElement"); } @@ -8683,7 +8670,7 @@ public void svgUseElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgViewElement() throws Exception { test("SVGViewElement"); } @@ -8692,7 +8679,7 @@ public void svgViewElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgViewSpec() throws Exception { test("SVGViewSpec"); } @@ -8701,7 +8688,7 @@ public void svgViewSpec() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgVKernElement() throws Exception { test("SVGVKernElement"); } @@ -8710,7 +8697,7 @@ public void svgVKernElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgZoomEvent() throws Exception { test("SVGZoomEvent"); } @@ -8728,7 +8715,7 @@ public void symbol() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void syncEvent() throws Exception { test("SyncEvent"); } @@ -8738,8 +8725,8 @@ public void syncEvent() throws Exception { */ @Test @Alerts(DEFAULT = "function SyncManager() { [native code] }", - FF = "exception", - FF_ESR = "exception") + FF = "ReferenceError", + FF_ESR = "ReferenceError") public void syncManager() throws Exception { test("SyncManager"); } @@ -8748,7 +8735,7 @@ public void syncManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void syncRegistration() throws Exception { test("SyncRegistration"); } @@ -8766,7 +8753,7 @@ public void syntaxError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void tcpServerSocket() throws Exception { test("TCPServerSocket"); } @@ -8775,7 +8762,7 @@ public void tcpServerSocket() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void tcpSocket() throws Exception { test("TCPSocket"); } @@ -8784,7 +8771,7 @@ public void tcpSocket() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void telephony() throws Exception { test("Telephony"); } @@ -8793,7 +8780,7 @@ public void telephony() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void telephonyCall() throws Exception { test("TelephonyCall"); } @@ -8802,7 +8789,7 @@ public void telephonyCall() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void telephonyCallGroup() throws Exception { test("TelephonyCallGroup"); } @@ -8813,7 +8800,7 @@ public void telephonyCallGroup() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void text() throws Exception { test("Text"); } @@ -8840,7 +8827,7 @@ public void textEncoder() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void textEvent() throws Exception { test("TextEvent"); } @@ -8860,7 +8847,7 @@ public void textMetrics() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void textRange() throws Exception { test("TextRange"); } @@ -8869,7 +8856,7 @@ public void textRange() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void textTrack() throws Exception { test("TextTrack"); } @@ -8878,7 +8865,7 @@ public void textTrack() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void textTrackCue() throws Exception { test("TextTrackCue"); } @@ -8887,7 +8874,7 @@ public void textTrackCue() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void textTrackCueList() throws Exception { test("TextTrackCueList"); } @@ -8896,7 +8883,7 @@ public void textTrackCueList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void textTrackList() throws Exception { test("TextTrackList"); } @@ -8905,7 +8892,7 @@ public void textTrackList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void timeEvent() throws Exception { test("TimeEvent"); } @@ -8914,7 +8901,7 @@ public void timeEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void timeRanges() throws Exception { test("TimeRanges"); } @@ -8923,7 +8910,7 @@ public void timeRanges() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void touch() throws Exception { test("Touch"); } @@ -8932,7 +8919,7 @@ public void touch() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void touchEvent() throws Exception { test("TouchEvent"); } @@ -8941,7 +8928,7 @@ public void touchEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void touchList() throws Exception { test("TouchList"); } @@ -8950,7 +8937,7 @@ public void touchList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void trackDefault() throws Exception { test("TrackDefault"); } @@ -8959,7 +8946,7 @@ public void trackDefault() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void trackDefaultList() throws Exception { test("TrackDefaultList"); } @@ -8968,7 +8955,7 @@ public void trackDefaultList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void trackEvent() throws Exception { test("TrackEvent"); } @@ -8977,7 +8964,7 @@ public void trackEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void transferable() throws Exception { test("Transferable"); } @@ -8986,7 +8973,7 @@ public void transferable() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void transitionEvent() throws Exception { test("TransitionEvent"); } @@ -8997,7 +8984,7 @@ public void transitionEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void treeWalker() throws Exception { test("TreeWalker"); } @@ -9006,7 +8993,7 @@ public void treeWalker() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void typedArray() throws Exception { test("TypedArray"); } @@ -9024,7 +9011,7 @@ public void typeError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void typeInfo() throws Exception { test("TypeInfo"); } @@ -9033,7 +9020,7 @@ public void typeInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void uDPSocket() throws Exception { test("UDPSocket"); } @@ -9044,7 +9031,7 @@ public void uDPSocket() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void uiEvent() throws Exception { test("UIEvent"); } @@ -9115,7 +9102,7 @@ public void unescape() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void uneval() throws Exception { test("uneval"); } @@ -9153,7 +9140,7 @@ public void urlSearchParams() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void urlUtils() throws Exception { test("URLUtils"); } @@ -9162,7 +9149,7 @@ public void urlUtils() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void urlUtilsReadOnly() throws Exception { test("URLUtilsReadOnly"); } @@ -9171,7 +9158,7 @@ public void urlUtilsReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void userDataHandler() throws Exception { test("UserDataHandler"); } @@ -9180,7 +9167,7 @@ public void userDataHandler() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void userProximityEvent() throws Exception { test("UserProximityEvent"); } @@ -9189,7 +9176,7 @@ public void userProximityEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void uSVString() throws Exception { test("USVString"); } @@ -9198,7 +9185,7 @@ public void uSVString() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void validityState() throws Exception { test("ValidityState"); } @@ -9207,7 +9194,7 @@ public void validityState() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void videoPlaybackQuality() throws Exception { test("VideoPlaybackQuality"); } @@ -9216,7 +9203,7 @@ public void videoPlaybackQuality() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrDevice() throws Exception { test("VRDevice"); } @@ -9225,7 +9212,7 @@ public void vrDevice() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrDisplay() throws Exception { test("VRDisplay"); } @@ -9234,7 +9221,7 @@ public void vrDisplay() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrDisplayCapabilities() throws Exception { test("VRDisplayCapabilities"); } @@ -9243,7 +9230,7 @@ public void vrDisplayCapabilities() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrEyeParameters() throws Exception { test("VREyeParameters"); } @@ -9252,7 +9239,7 @@ public void vrEyeParameters() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrFieldOfView() throws Exception { test("VRFieldOfView"); } @@ -9261,7 +9248,7 @@ public void vrFieldOfView() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrFieldOfViewReadOnly() throws Exception { test("VRFieldOfViewReadOnly"); } @@ -9270,7 +9257,7 @@ public void vrFieldOfViewReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrLayer() throws Exception { test("VRLayer"); } @@ -9279,7 +9266,7 @@ public void vrLayer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrPose() throws Exception { test("VRPose"); } @@ -9288,7 +9275,7 @@ public void vrPose() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrPositionState() throws Exception { test("VRPositionState"); } @@ -9297,7 +9284,7 @@ public void vrPositionState() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrStageParameters() throws Exception { test("VRStageParameters"); } @@ -9306,7 +9293,7 @@ public void vrStageParameters() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vTTCue() throws Exception { test("VTTCue"); } @@ -9315,7 +9302,7 @@ public void vTTCue() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void waveShaperNode() throws Exception { test("WaveShaperNode"); } @@ -9342,7 +9329,7 @@ public void weakSet() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL() throws Exception { test("WebGL"); } @@ -9351,7 +9338,7 @@ public void webGL() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_color_buffer_float() throws Exception { test("WEBGL_color_buffer_float"); } @@ -9360,7 +9347,7 @@ public void webGL_color_buffer_float() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_compressed_texture_atc() throws Exception { test("WEBGL_compressed_texture_atc"); } @@ -9369,7 +9356,7 @@ public void webGL_compressed_texture_atc() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_compressed_texture_es3() throws Exception { test("WEBGL_compressed_texture_es3"); } @@ -9378,7 +9365,7 @@ public void webGL_compressed_texture_es3() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void wEBGL_compressed_texture_etc() throws Exception { test("WEBGL_compressed_texture_etc"); } @@ -9387,7 +9374,7 @@ public void wEBGL_compressed_texture_etc() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_compressed_texture_etc1() throws Exception { test("WEBGL_compressed_texture_etc1"); } @@ -9396,7 +9383,7 @@ public void webGL_compressed_texture_etc1() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_compressed_texture_pvrtc() throws Exception { test("WEBGL_compressed_texture_pvrtc"); } @@ -9405,7 +9392,7 @@ public void webGL_compressed_texture_pvrtc() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_compressed_texture_s3tc() throws Exception { test("WEBGL_compressed_texture_s3tc"); } @@ -9414,7 +9401,7 @@ public void webGL_compressed_texture_s3tc() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_debug_renderer_info() throws Exception { test("WEBGL_debug_renderer_info"); } @@ -9423,7 +9410,7 @@ public void webGL_debug_renderer_info() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_debug_shaders() throws Exception { test("WEBGL_debug_shaders"); } @@ -9432,7 +9419,7 @@ public void webGL_debug_shaders() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_depth_texture() throws Exception { test("WEBGL_depth_texture"); } @@ -9441,7 +9428,7 @@ public void webGL_depth_texture() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_draw_buffers() throws Exception { test("WEBGL_draw_buffers"); } @@ -9450,7 +9437,7 @@ public void webGL_draw_buffers() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_lose_context() throws Exception { test("WEBGL_lose_context"); } @@ -9585,7 +9572,7 @@ public void webGLTexture() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGLTimerQueryEXT() throws Exception { test("WebGLTimerQueryEXT"); } @@ -9621,7 +9608,7 @@ public void webGLVertexArrayObject() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGLVertexArrayObjectOES() throws Exception { test("WebGLVertexArrayObjectOES"); } @@ -9630,7 +9617,7 @@ public void webGLVertexArrayObjectOES() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webKitAnimationEvent() throws Exception { test("WebKitAnimationEvent"); } @@ -9639,7 +9626,7 @@ public void webKitAnimationEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitAudioContext() throws Exception { test("webkitAudioContext"); } @@ -9648,7 +9635,7 @@ public void webkitAudioContext() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webKitCSSMatrix() throws Exception { test("WebKitCSSMatrix"); } @@ -9657,7 +9644,7 @@ public void webKitCSSMatrix() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBCursor() throws Exception { test("webkitIDBCursor"); } @@ -9666,7 +9653,7 @@ public void webkitIDBCursor() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBDatabase() throws Exception { test("webkitIDBDatabase"); } @@ -9675,7 +9662,7 @@ public void webkitIDBDatabase() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBFactory() throws Exception { test("webkitIDBFactory"); } @@ -9684,7 +9671,7 @@ public void webkitIDBFactory() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBIndex() throws Exception { test("webkitIDBIndex"); } @@ -9693,7 +9680,7 @@ public void webkitIDBIndex() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBKeyRange() throws Exception { test("webkitIDBKeyRange"); } @@ -9702,7 +9689,7 @@ public void webkitIDBKeyRange() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBObjectStore() throws Exception { test("webkitIDBObjectStore"); } @@ -9711,7 +9698,7 @@ public void webkitIDBObjectStore() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBRequest() throws Exception { test("webkitIDBRequest"); } @@ -9720,7 +9707,7 @@ public void webkitIDBRequest() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBTransaction() throws Exception { test("webkitIDBTransaction"); } @@ -9729,7 +9716,7 @@ public void webkitIDBTransaction() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitMediaStream() throws Exception { test("webkitMediaStream"); } @@ -9738,7 +9725,7 @@ public void webkitMediaStream() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webKitMutationObserver() throws Exception { test("WebKitMutationObserver"); } @@ -9747,7 +9734,7 @@ public void webKitMutationObserver() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitOfflineAudioContext() throws Exception { test("webkitOfflineAudioContext"); } @@ -9756,7 +9743,7 @@ public void webkitOfflineAudioContext() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitRTCPeerConnection() throws Exception { test("webkitRTCPeerConnection"); } @@ -9765,7 +9752,7 @@ public void webkitRTCPeerConnection() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitRTCSessionDescription() throws Exception { test("webkitRTCSessionDescription"); } @@ -9774,7 +9761,7 @@ public void webkitRTCSessionDescription() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitSpeechGrammar() throws Exception { test("webkitSpeechGrammar"); } @@ -9783,7 +9770,7 @@ public void webkitSpeechGrammar() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitSpeechGrammarList() throws Exception { test("webkitSpeechGrammarList"); } @@ -9792,7 +9779,7 @@ public void webkitSpeechGrammarList() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitSpeechRecognition() throws Exception { test("webkitSpeechRecognition"); } @@ -9801,7 +9788,7 @@ public void webkitSpeechRecognition() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitSpeechRecognitionError() throws Exception { test("webkitSpeechRecognitionError"); } @@ -9810,7 +9797,7 @@ public void webkitSpeechRecognitionError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitSpeechRecognitionEvent() throws Exception { test("webkitSpeechRecognitionEvent"); } @@ -9819,7 +9806,7 @@ public void webkitSpeechRecognitionEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webKitTransitionEvent() throws Exception { test("WebKitTransitionEvent"); } @@ -9828,7 +9815,7 @@ public void webKitTransitionEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitURL() throws Exception { test("webkitURL"); } @@ -9837,7 +9824,7 @@ public void webkitURL() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webSMS() throws Exception { test("WebSMS"); } @@ -9857,7 +9844,7 @@ public void webSocket() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webSockets() throws Exception { test("WebSockets"); } @@ -9866,7 +9853,7 @@ public void webSockets() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webVTT() throws Exception { test("WebVTT"); } @@ -9875,7 +9862,7 @@ public void webVTT() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void wheelEvent() throws Exception { test("WheelEvent"); } @@ -9884,7 +9871,7 @@ public void wheelEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void wifiManager() throws Exception { test("WifiManager"); } @@ -9895,7 +9882,7 @@ public void wifiManager() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void window() throws Exception { test("Window"); } @@ -9904,7 +9891,7 @@ public void window() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowBase64() throws Exception { test("WindowBase64"); } @@ -9913,7 +9900,7 @@ public void windowBase64() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowClient() throws Exception { test("WindowClient"); } @@ -9922,7 +9909,7 @@ public void windowClient() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowEventHandlers() throws Exception { test("WindowEventHandlers"); } @@ -9931,7 +9918,7 @@ public void windowEventHandlers() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowEventHandlers_onbeforeprint() throws Exception { test("WindowEventHandlers.onbeforeprint"); } @@ -9940,7 +9927,7 @@ public void windowEventHandlers_onbeforeprint() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowOrWorkerGlobalScope() throws Exception { test("WindowOrWorkerGlobalScope"); } @@ -9949,7 +9936,7 @@ public void windowOrWorkerGlobalScope() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowProperties() throws Exception { test("WindowProperties"); } @@ -9958,7 +9945,7 @@ public void windowProperties() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowTimers() throws Exception { test("WindowTimers"); } @@ -10005,7 +9992,7 @@ public void workerNavigator() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xDomainRequest() throws Exception { test("XDomainRequest"); } @@ -10016,7 +10003,7 @@ public void xDomainRequest() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xmlDocument() throws Exception { test("XMLDocument"); } @@ -10045,7 +10032,7 @@ public void xmlHttpRequestEventTarget() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xmlHttpRequestProgressEvent() throws Exception { test("XMLHttpRequestProgressEvent"); } @@ -10065,7 +10052,7 @@ public void xmlHttpRequestUpload() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xmlSerializer() throws Exception { test("XMLSerializer"); } @@ -10076,7 +10063,7 @@ public void xmlSerializer() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xPathEvaluator() throws Exception { test("XPathEvaluator"); } @@ -10085,7 +10072,7 @@ public void xPathEvaluator() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xPathExpression() throws Exception { test("XPathExpression"); } @@ -10096,7 +10083,7 @@ public void xPathExpression() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xPathNSResolver() throws Exception { test("XPathNSResolver"); } @@ -10107,7 +10094,7 @@ public void xPathNSResolver() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xPathResult() throws Exception { test("XPathResult"); } @@ -10116,7 +10103,7 @@ public void xPathResult() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xsltemplate() throws Exception { test("XSLTemplate"); } @@ -10127,7 +10114,7 @@ public void xsltemplate() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xsltProcessor() throws Exception { test("XSLTProcessor"); } diff --git a/src/test/java/org/htmlunit/general/DedicatedWorkerGlobalScopeConstantsTest.java b/src/test/java/org/htmlunit/general/DedicatedWorkerGlobalScopeConstantsTest.java index 5d929df73ec..6419cd19f90 100644 --- a/src/test/java/org/htmlunit/general/DedicatedWorkerGlobalScopeConstantsTest.java +++ b/src/test/java/org/htmlunit/general/DedicatedWorkerGlobalScopeConstantsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ import java.util.Collection; import java.util.Collections; import java.util.Comparator; +import java.util.HashMap; import java.util.List; import java.util.Set; @@ -29,21 +30,17 @@ import org.htmlunit.javascript.configuration.ClassConfiguration; import org.htmlunit.javascript.configuration.ClassConfiguration.ConstantInfo; import org.htmlunit.javascript.configuration.WorkerJavaScriptConfiguration; -import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserParameterizedRunner.Default; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.htmlunit.util.MimeType; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized.Parameter; -import org.junit.runners.Parameterized.Parameters; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; /** * Tests that constants class are correct. * * @author Ronald Brill */ -@RunWith(BrowserParameterizedRunner.class) public class DedicatedWorkerGlobalScopeConstantsTest extends WebDriverTestCase { /** @@ -51,36 +48,33 @@ public class DedicatedWorkerGlobalScopeConstantsTest extends WebDriverTestCase { * @return the parameterized data * @throws Exception if an error occurs */ - @Parameters - public static Collection data() throws Exception { - final List list = new ArrayList<>(); - final Set strings = TestCaseTest.getAllConfiguredJsClassNames(); - for (final String host : strings) { + public static Collection data() throws Exception { + final List list = new ArrayList<>(); + final Set classNames = TestCaseTest.getAllConfiguredJsClassNames(); + final ArrayList classNamesSorted = new ArrayList<>(classNames); + Collections.sort(classNamesSorted); + + for (final String host : classNamesSorted) { if (!"Audio".equals(host)) { - list.add(new Object[] {host}); + list.add(Arguments.of(host)); } } return list; } - /** - * The parent element name. - */ - @Parameter - public String host_; - /** * The default test. * @throws Exception if an error occurs */ - @Test - @Default - public void test() throws Exception { - test(host_, getExpectedString(host_)); + @ParameterizedTest(name = "_{0}") + @MethodSource("data") + void test(final String host) throws Exception { + test(host, getExpectedString(host)); } private void test(final String className, final String[] expectedAlerts) throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + + "" + "\n"; final String workerJs = "onmessage = function(e) {\n" + " var workerResult = '';\n" + " try {\n" + " workerResult += typeof " + className + ";\n" - + " } catch(e) {workerResult = 'exception'}\n" + + " } catch(e) {workerResult = e.name}\n" + " postMessage(workerResult);\n" + "}\n"; @@ -252,7 +250,7 @@ public void applicationCacheErrorEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void apps_mgmt() throws Exception { test("Apps.mgmt"); } @@ -505,6 +503,15 @@ public void beforeUnloadEvent() throws Exception { test("BeforeUnloadEvent"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("function") + public void bigInt() throws Exception { + test("BigInt"); + } + /** * @throws Exception if the test fails */ @@ -909,26 +916,6 @@ public void client() throws Exception { test("Client"); } - /** - * Test {@link org.htmlunit.javascript.host.ClientRect}. - * - * @throws Exception if an error occurs - */ - @Test - @Alerts("undefined") - public void clientRect() throws Exception { - test("ClientRect"); - } - - /** - * @throws Exception if an error occurs - */ - @Test - @Alerts("undefined") - public void clientRectList() throws Exception { - test("ClientRectList"); - } - /** * @throws Exception if the test fails */ @@ -1878,7 +1865,7 @@ public void domPointReadOnly() throws Exception { } /** - * Test {@link org.htmlunit.javascript.host.ClientRect}. + * Test {@link org.htmlunit.javascript.host.DOMRect}. * * @throws Exception if an error occurs */ @@ -4374,7 +4361,7 @@ public void l10n() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_formatValue() throws Exception { test("L10n.formatValue"); } @@ -4383,7 +4370,7 @@ public void l10n_formatValue() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_get() throws Exception { test("L10n.get"); } @@ -4392,7 +4379,7 @@ public void l10n_get() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_language_code() throws Exception { test("L10n.language.code"); } @@ -4401,7 +4388,7 @@ public void l10n_language_code() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_language_direction() throws Exception { test("L10n.language.direction"); } @@ -4410,7 +4397,7 @@ public void l10n_language_direction() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_once() throws Exception { test("L10n.once"); } @@ -4419,7 +4406,7 @@ public void l10n_once() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_ready() throws Exception { test("L10n.ready"); } @@ -4428,7 +4415,7 @@ public void l10n_ready() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_readyState() throws Exception { test("L10n.readyState"); } @@ -4437,7 +4424,7 @@ public void l10n_readyState() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_setAttributes() throws Exception { test("L10n.setAttributes"); } @@ -6853,7 +6840,7 @@ public void simd() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool16x8() throws Exception { test("SIMD.Bool16x8"); } @@ -6862,7 +6849,7 @@ public void simd_Bool16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool32x4() throws Exception { test("SIMD.Bool32x4"); } @@ -6871,7 +6858,7 @@ public void simd_Bool32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool64x2() throws Exception { test("SIMD.Bool64x2"); } @@ -6880,7 +6867,7 @@ public void simd_Bool64x2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool8x16() throws Exception { test("SIMD.Bool8x16"); } @@ -6889,7 +6876,7 @@ public void simd_Bool8x16() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_float32x4() throws Exception { test("SIMD.float32x4"); } @@ -6898,7 +6885,7 @@ public void simd_float32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Float32x4() throws Exception { test("SIMD.Float32x4"); } @@ -6907,7 +6894,7 @@ public void simd_Float32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_float64x2() throws Exception { test("SIMD.float64x2"); } @@ -6916,7 +6903,7 @@ public void simd_float64x2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Float64x2() throws Exception { test("SIMD.Float64x2"); } @@ -6925,7 +6912,7 @@ public void simd_Float64x2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_int16x8() throws Exception { test("SIMD.int16x8"); } @@ -6934,7 +6921,7 @@ public void simd_int16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Int16x8() throws Exception { test("SIMD.Int16x8"); } @@ -6943,7 +6930,7 @@ public void simd_Int16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_int32x4() throws Exception { test("SIMD.int32x4"); } @@ -6952,7 +6939,7 @@ public void simd_int32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Int32x4() throws Exception { test("SIMD.Int32x4"); } @@ -6961,7 +6948,7 @@ public void simd_Int32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_int8x16() throws Exception { test("SIMD.int8x16"); } @@ -6970,7 +6957,7 @@ public void simd_int8x16() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Int8x16() throws Exception { test("SIMD.Int8x16"); } @@ -6979,7 +6966,7 @@ public void simd_Int8x16() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Uint16x8() throws Exception { test("SIMD.Uint16x8"); } @@ -6988,7 +6975,7 @@ public void simd_Uint16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Uint32x4() throws Exception { test("SIMD.Uint32x4"); } @@ -6997,7 +6984,7 @@ public void simd_Uint32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Uint8x16() throws Exception { test("SIMD.Uint8x16"); } @@ -9928,7 +9915,7 @@ public void windowEventHandlers() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowEventHandlers_onbeforeprint() throws Exception { test("WindowEventHandlers.onbeforeprint"); } diff --git a/src/test/java/org/htmlunit/general/ElementChildNodesTest.java b/src/test/java/org/htmlunit/general/ElementChildNodesTest.java index a2b95e9b4fd..aeb8cc81e2f 100644 --- a/src/test/java/org/htmlunit/general/ElementChildNodesTest.java +++ b/src/test/java/org/htmlunit/general/ElementChildNodesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,9 @@ package org.htmlunit.general; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; +import org.junit.jupiter.api.Test; /** * Tests the result of {@code element.childNodes.length}. @@ -28,11 +27,11 @@ * @author Marc Guillemot * @author Frank Danek */ -@RunWith(BrowserRunner.class) public class ElementChildNodesTest extends WebDriverTestCase { private static String test(final String tagName) { - return "\n" + return DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -116,7 +116,8 @@ private void test(final String tagName) throws Exception { } private static String headElementClosesItself(final String tagName) { - return "\n" + return DOCTYPE_HTML + + "\n" + "<" + tagName + " id='outer'><" + tagName + ">\n" + "\n" + "\n" @@ -73,7 +67,7 @@ private void test(final String className) throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void abstractList() throws Exception { test("AbstractList"); } @@ -91,7 +85,7 @@ public void abstractRange() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void abstractWorker() throws Exception { test("AbstractWorker"); } @@ -102,7 +96,7 @@ public void abstractWorker() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void activeXObject() throws Exception { test("ActiveXObject"); } @@ -111,7 +105,7 @@ public void activeXObject() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ambientLightSensor() throws Exception { test("AmbientLightSensor"); } @@ -120,7 +114,7 @@ public void ambientLightSensor() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ambientLightSensorReading() throws Exception { test("AmbientLightSensorReading"); } @@ -140,7 +134,7 @@ public void analyserNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void angle_instanced_arrays() throws Exception { test("ANGLE_instanced_arrays"); } @@ -158,7 +152,7 @@ public void animation() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationEffectReadOnly() throws Exception { test("AnimationEffectReadOnly"); } @@ -167,7 +161,7 @@ public void animationEffectReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationEffectTiming() throws Exception { test("AnimationEffectTiming"); } @@ -176,7 +170,7 @@ public void animationEffectTiming() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationEffectTimingProperties() throws Exception { test("AnimationEffectTimingProperties"); } @@ -185,7 +179,7 @@ public void animationEffectTimingProperties() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationEffectTimingReadOnly() throws Exception { test("AnimationEffectTimingReadOnly"); } @@ -206,7 +200,7 @@ public void animationEvent() throws Exception { */ @Test @Alerts("function AnimationPlaybackEvent() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", EDGE = "exception", FF = "exception", FF_ESR = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", EDGE = "ReferenceError", FF = "ReferenceError", FF_ESR = "ReferenceError") public void animationPlaybackEvent() throws Exception { test("AnimationPlaybackEvent"); } @@ -215,7 +209,7 @@ public void animationPlaybackEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void animationPlayer() throws Exception { test("AnimationPlayer"); } @@ -225,7 +219,7 @@ public void animationPlayer() throws Exception { */ @Test @Alerts("function AnimationTimeline() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", EDGE = "exception", FF = "exception", FF_ESR = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", EDGE = "ReferenceError", FF = "ReferenceError", FF_ESR = "ReferenceError") public void animationTimeline() throws Exception { test("AnimationTimeline"); } @@ -234,7 +228,7 @@ public void animationTimeline() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void appBannerPromptResult() throws Exception { test("AppBannerPromptResult"); } @@ -245,7 +239,7 @@ public void appBannerPromptResult() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void applicationCache() throws Exception { test("ApplicationCache"); } @@ -254,7 +248,7 @@ public void applicationCache() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void applicationCacheErrorEvent() throws Exception { test("ApplicationCacheErrorEvent"); } @@ -263,7 +257,7 @@ public void applicationCacheErrorEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void apps_mgmt() throws Exception { test("Apps.mgmt"); } @@ -305,7 +299,7 @@ public void arrayBuffer() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void arrayBufferView() throws Exception { test("ArrayBufferView"); } @@ -316,7 +310,7 @@ public void arrayBufferView() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void arrayBufferViewBase() throws Exception { test("ArrayBufferViewBase"); } @@ -325,7 +319,7 @@ public void arrayBufferViewBase() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void asyncFunction() throws Exception { test("AsyncFunction"); } @@ -383,7 +377,7 @@ public void audioBufferSourceNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void audioChannelManager() throws Exception { test("AudioChannelManager"); } @@ -457,7 +451,7 @@ public void audioScheduledSourceNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void autocompleteErrorEvent() throws Exception { test("AutocompleteErrorEvent"); } @@ -484,7 +478,7 @@ public void baseAudioContext() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function BatteryManager() { [native code] }", EDGE = "function BatteryManager() { [native code] }") public void batteryManager() throws Exception { @@ -495,7 +489,7 @@ public void batteryManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void beforeInstallPrompt() throws Exception { test("BeforeInstallPrompt"); } @@ -504,7 +498,7 @@ public void beforeInstallPrompt() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function BeforeInstallPromptEvent() { [native code] }", EDGE = "function BeforeInstallPromptEvent() { [native code] }") public void beforeInstallPromptEvent() throws Exception { @@ -522,6 +516,15 @@ public void beforeUnloadEvent() throws Exception { test("BeforeUnloadEvent"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("function BigInt() { [native code] }") + public void bigInt() throws Exception { + test("BigInt"); + } + /** * @throws Exception if the test fails */ @@ -544,7 +547,7 @@ public void blob() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void blobBuilder() throws Exception { test("BlobBuilder"); } @@ -562,10 +565,10 @@ public void blobEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function Bluetooth() { [native code] }", EDGE = "function Bluetooth() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", EDGE = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", EDGE = "ReferenceError") public void bluetooth() throws Exception { test("Bluetooth"); } @@ -574,7 +577,7 @@ public void bluetooth() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothAdapter() throws Exception { test("BluetoothAdapter"); } @@ -583,7 +586,7 @@ public void bluetoothAdapter() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothAdvertisingData() throws Exception { test("BluetoothAdvertisingData"); } @@ -592,10 +595,10 @@ public void bluetoothAdvertisingData() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function BluetoothCharacteristicProperties() { [native code] }", EDGE = "function BluetoothCharacteristicProperties() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", EDGE = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", EDGE = "ReferenceError") public void bluetoothCharacteristicProperties() throws Exception { test("BluetoothCharacteristicProperties"); } @@ -604,10 +607,10 @@ public void bluetoothCharacteristicProperties() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function BluetoothDevice() { [native code] }", EDGE = "function BluetoothDevice() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", EDGE = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", EDGE = "ReferenceError") public void bluetoothDevice() throws Exception { test("BluetoothDevice"); } @@ -616,7 +619,7 @@ public void bluetoothDevice() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothDeviceEvent() throws Exception { test("BluetoothDeviceEvent"); } @@ -625,7 +628,7 @@ public void bluetoothDeviceEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothGATTRemoteServer() throws Exception { test("BluetoothGATTRemoteServer"); } @@ -634,7 +637,7 @@ public void bluetoothGATTRemoteServer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothGATTService() throws Exception { test("BluetoothGATTService"); } @@ -643,7 +646,7 @@ public void bluetoothGATTService() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothManager() throws Exception { test("BluetoothManager"); } @@ -652,10 +655,10 @@ public void bluetoothManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function BluetoothRemoteGATTCharacteristic() { [native code] }", EDGE = "function BluetoothRemoteGATTCharacteristic() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", EDGE = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", EDGE = "ReferenceError") public void bluetoothRemoteGATTCharacteristic() throws Exception { test("BluetoothRemoteGATTCharacteristic"); } @@ -664,10 +667,10 @@ public void bluetoothRemoteGATTCharacteristic() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function BluetoothRemoteGATTServer() { [native code] }", EDGE = "function BluetoothRemoteGATTServer() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", EDGE = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", EDGE = "ReferenceError") public void bluetoothRemoteGATTServer() throws Exception { test("BluetoothRemoteGATTServer"); } @@ -676,7 +679,7 @@ public void bluetoothRemoteGATTServer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bluetoothStatusChangedEvent() throws Exception { test("BluetoothStatusChangedEvent"); } @@ -685,7 +688,7 @@ public void bluetoothStatusChangedEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void body() throws Exception { test("Body"); } @@ -694,7 +697,7 @@ public void body() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void boxObject() throws Exception { test("BoxObject"); } @@ -712,7 +715,7 @@ public void broadcastChannel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void budgetService() throws Exception { test("BudgetService"); } @@ -721,7 +724,7 @@ public void budgetService() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void budgetState() throws Exception { test("BudgetState"); } @@ -730,7 +733,7 @@ public void budgetState() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void bufferSource() throws Exception { test("BufferSource"); } @@ -739,7 +742,7 @@ public void bufferSource() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void byteString() throws Exception { test("ByteString"); } @@ -766,7 +769,7 @@ public void cacheStorage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void callEvent() throws Exception { test("CallEvent"); } @@ -775,7 +778,7 @@ public void callEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cameraCapabilities() throws Exception { test("CameraCapabilities"); } @@ -784,7 +787,7 @@ public void cameraCapabilities() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cameraControl() throws Exception { test("CameraControl"); } @@ -793,7 +796,7 @@ public void cameraControl() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cameraManager() throws Exception { test("CameraManager"); } @@ -802,7 +805,7 @@ public void cameraManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function CanvasCaptureMediaStream() { [native code] }", FF_ESR = "function CanvasCaptureMediaStream() { [native code] }") public void canvasCaptureMediaStream() throws Exception { @@ -813,7 +816,7 @@ public void canvasCaptureMediaStream() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function CanvasCaptureMediaStreamTrack() { [native code] }", EDGE = "function CanvasCaptureMediaStreamTrack() { [native code] }") public void canvasCaptureMediaStreamTrack() throws Exception { @@ -833,7 +836,7 @@ public void canvasGradient() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void canvasImageSource() throws Exception { test("CanvasImageSource"); } @@ -915,7 +918,7 @@ public void characterData() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void characterDataImpl() throws Exception { test("CharacterDataImpl"); } @@ -924,7 +927,7 @@ public void characterDataImpl() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void childNode() throws Exception { test("ChildNode"); } @@ -933,7 +936,7 @@ public void childNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void chromeWorker() throws Exception { test("ChromeWorker"); } @@ -942,38 +945,16 @@ public void chromeWorker() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void client() throws Exception { test("Client"); } - /** - * Test {@link org.htmlunit.javascript.host.ClientRect}. - * - * @throws Exception if an error occurs - */ - @Test - @Alerts("exception") - public void clientRect() throws Exception { - test("ClientRect"); - } - - /** - * Test {@link org.htmlunit.javascript.host.ClientRectList}. - * - * @throws Exception if an error occurs - */ - @Test - @Alerts("exception") - public void clientRectList() throws Exception { - test("ClientRectList"); - } - /** * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void clients() throws Exception { test("Clients"); } @@ -982,7 +963,7 @@ public void clients() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void clipboardData() throws Exception { test("ClipboardData"); } @@ -1031,7 +1012,7 @@ public void compositionEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void computedCSSStyleDeclaration() throws Exception { test("ComputedCSSStyleDeclaration"); } @@ -1040,7 +1021,7 @@ public void computedCSSStyleDeclaration() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void connection() throws Exception { test(HttpHeader.CONNECTION); } @@ -1051,7 +1032,7 @@ public void connection() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void console() throws Exception { test("Console"); } @@ -1069,7 +1050,7 @@ public void constantSourceNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void constrainBoolean() throws Exception { test("ConstrainBoolean"); } @@ -1078,7 +1059,7 @@ public void constrainBoolean() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void constrainDOMString() throws Exception { test("ConstrainDOMString"); } @@ -1087,7 +1068,7 @@ public void constrainDOMString() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void constrainDouble() throws Exception { test("ConstrainDouble"); } @@ -1096,7 +1077,7 @@ public void constrainDouble() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void constrainLong() throws Exception { test("ConstrainLong"); } @@ -1105,7 +1086,7 @@ public void constrainLong() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void contactManager() throws Exception { test("ContactManager"); } @@ -1125,7 +1106,7 @@ public void convolverNode() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void coordinates() throws Exception { test("Coordinates"); } @@ -1181,7 +1162,7 @@ public void css() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function CSS2Properties() { [native code] }", FF_ESR = "function CSS2Properties() { [native code] }") public void css2Properties() throws Exception { @@ -1194,9 +1175,9 @@ public void css2Properties() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function CSSPageDescriptors() { [native code] }") - @HtmlUnitNYI(FF = "exception") + @HtmlUnitNYI(FF = "ReferenceError") public void cssPageDescriptors() throws Exception { test("CSSPageDescriptors"); } @@ -1205,7 +1186,7 @@ public void cssPageDescriptors() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssCharsetRule() throws Exception { test("CSSCharsetRule"); } @@ -1281,7 +1262,7 @@ public void cssKeyframesRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssMatrix() throws Exception { test("CSSMatrix"); } @@ -1323,7 +1304,7 @@ public void cssPageRule() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssPrimitiveValue() throws Exception { test("CSSPrimitiveValue"); } @@ -1368,7 +1349,6 @@ public void cssStyleDeclaration() throws Exception { */ @Test @Alerts("function CSSStyleRule() { [native code] }") - @AlertsStandards("function CSSStyleRule() { [native code] }") public void cssStyleRule() throws Exception { test("CSSStyleRule"); } @@ -1397,7 +1377,7 @@ public void cssSupportsRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssUnknownRule() throws Exception { test("CSSUnknownRule"); } @@ -1408,7 +1388,7 @@ public void cssUnknownRule() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssValue() throws Exception { test("CSSValue"); } @@ -1417,7 +1397,7 @@ public void cssValue() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssValueList() throws Exception { test("CSSValueList"); } @@ -1426,7 +1406,7 @@ public void cssValueList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void cssViewportRule() throws Exception { test("CSSViewportRule"); } @@ -1453,7 +1433,7 @@ public void customEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dataStore() throws Exception { test("DataStore"); } @@ -1462,7 +1442,7 @@ public void dataStore() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dataStoreChangeEvent() throws Exception { test("DataStoreChangeEvent"); } @@ -1471,7 +1451,7 @@ public void dataStoreChangeEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dataStoreCursor() throws Exception { test("DataStoreCursor"); } @@ -1480,7 +1460,7 @@ public void dataStoreCursor() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dataStoreTask() throws Exception { test("DataStoreTask"); } @@ -1554,7 +1534,7 @@ public void decodeURIComponent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void dedicatedWorkerGlobalScope() throws Exception { test("DedicatedWorkerGlobalScope"); } @@ -1572,7 +1552,7 @@ public void delayNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceAcceleration() throws Exception { test("DeviceAcceleration"); } @@ -1581,7 +1561,7 @@ public void deviceAcceleration() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceLightEvent() throws Exception { test("DeviceLightEvent"); } @@ -1608,7 +1588,7 @@ public void deviceOrientationEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceProximityEvent() throws Exception { test("DeviceProximityEvent"); } @@ -1617,7 +1597,7 @@ public void deviceProximityEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceRotationRate() throws Exception { test("DeviceRotationRate"); } @@ -1626,7 +1606,7 @@ public void deviceRotationRate() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceStorage() throws Exception { test("DeviceStorage"); } @@ -1635,7 +1615,7 @@ public void deviceStorage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void deviceStorageChangeEvent() throws Exception { test("DeviceStorageChangeEvent"); } @@ -1644,7 +1624,7 @@ public void deviceStorageChangeEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void directoryEntry() throws Exception { test("DirectoryEntry"); } @@ -1653,7 +1633,7 @@ public void directoryEntry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void directoryEntrySync() throws Exception { test("DirectoryEntrySync"); } @@ -1662,7 +1642,7 @@ public void directoryEntrySync() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void directoryReader() throws Exception { test("DirectoryReader"); } @@ -1671,7 +1651,7 @@ public void directoryReader() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void directoryReaderSync() throws Exception { test("DirectoryReaderSync"); } @@ -1702,7 +1682,7 @@ public void documentFragment() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void documentOrShadowRoot() throws Exception { test("DocumentOrShadowRoot"); } @@ -1712,7 +1692,7 @@ public void documentOrShadowRoot() throws Exception { */ @Test @Alerts("function DocumentTimeline() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", EDGE = "exception", FF = "exception", FF_ESR = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", EDGE = "ReferenceError", FF = "ReferenceError", FF_ESR = "ReferenceError") public void documentTimeline() throws Exception { test("DocumentTimeline"); } @@ -1721,7 +1701,7 @@ public void documentTimeline() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void documentTouch() throws Exception { test("DocumentTouch"); } @@ -1741,7 +1721,7 @@ public void documentType() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domApplication() throws Exception { test("DOMApplication"); } @@ -1750,7 +1730,7 @@ public void domApplication() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domApplicationsManager() throws Exception { test("DOMApplicationsManager"); } @@ -1759,7 +1739,7 @@ public void domApplicationsManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domApplicationsRegistry() throws Exception { test("DOMApplicationsRegistry"); } @@ -1768,7 +1748,7 @@ public void domApplicationsRegistry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domConfiguration() throws Exception { test("DOMConfiguration"); } @@ -1779,7 +1759,7 @@ public void domConfiguration() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domCursor() throws Exception { test("DOMCursor"); } @@ -1789,8 +1769,8 @@ public void domCursor() throws Exception { */ @Test @Alerts(DEFAULT = "function DOMError() { [native code] }", - FF = "exception", - FF_ESR = "exception") + FF = "ReferenceError", + FF_ESR = "ReferenceError") public void domError() throws Exception { test("DOMError"); } @@ -1799,7 +1779,7 @@ public void domError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domErrorHandler() throws Exception { test("DOMErrorHandler"); } @@ -1819,7 +1799,7 @@ public void domException() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domHighResTimeStamp() throws Exception { test("DOMHighResTimeStamp"); } @@ -1839,7 +1819,7 @@ public void domImplementation() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domImplementationList() throws Exception { test("DOMImplementationList"); } @@ -1848,7 +1828,7 @@ public void domImplementationList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domImplementationRegistry() throws Exception { test("DOMImplementationRegistry"); } @@ -1857,7 +1837,7 @@ public void domImplementationRegistry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domImplementationSource() throws Exception { test("DOMImplementationSource"); } @@ -1866,7 +1846,7 @@ public void domImplementationSource() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domLocator() throws Exception { test("DOMLocator"); } @@ -1893,7 +1873,7 @@ public void domMatrixReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domObject() throws Exception { test("DOMObject"); } @@ -1928,7 +1908,7 @@ public void domPointReadOnly() throws Exception { } /** - * Test {@link org.htmlunit.javascript.host.ClientRect}. + * Test {@link org.htmlunit.javascript.host.DOMRect}. * * @throws Exception if an error occurs */ @@ -1960,7 +1940,7 @@ public void domRectReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domRequest() throws Exception { test("DOMRequest"); } @@ -1969,7 +1949,7 @@ public void domRequest() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domSettableTokenList() throws Exception { test("DOMSettableTokenList"); } @@ -1978,7 +1958,7 @@ public void domSettableTokenList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domString() throws Exception { test("DOMString"); } @@ -2007,7 +1987,7 @@ public void domStringMap() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domTimeStamp() throws Exception { test("DOMTimeStamp"); } @@ -2027,7 +2007,7 @@ public void domTokenList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void domUserData() throws Exception { test("DOMUserData"); } @@ -2036,7 +2016,7 @@ public void domUserData() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void doubleRange() throws Exception { test("DoubleRange"); } @@ -2074,7 +2054,7 @@ public void element() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void elementTraversal() throws Exception { test("ElementTraversal"); } @@ -2101,7 +2081,7 @@ public void encodeURIComponent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void entity() throws Exception { test("Entity"); } @@ -2110,7 +2090,7 @@ public void entity() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void entityReference() throws Exception { test("EntityReference"); } @@ -2119,7 +2099,7 @@ public void entityReference() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void entry() throws Exception { test("Entry"); } @@ -2128,7 +2108,7 @@ public void entry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void entrySync() throws Exception { test("EntrySync"); } @@ -2139,7 +2119,7 @@ public void entrySync() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void enumerator() throws Exception { test("Enumerator"); } @@ -2204,7 +2184,7 @@ public void event() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void eventListener() throws Exception { test("EventListener"); } @@ -2213,7 +2193,7 @@ public void eventListener() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void eventNode() throws Exception { test("EventNode"); } @@ -2240,7 +2220,7 @@ public void eventTarget() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_blend_minmax() throws Exception { test("EXT_blend_minmax"); } @@ -2249,7 +2229,7 @@ public void ext_blend_minmax() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_color_buffer_float() throws Exception { test("EXT_color_buffer_float"); } @@ -2258,7 +2238,7 @@ public void ext_color_buffer_float() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_color_buffer_half_float() throws Exception { test("EXT_color_buffer_half_float"); } @@ -2267,7 +2247,7 @@ public void ext_color_buffer_half_float() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_disjoint_timer_query() throws Exception { test("EXT_disjoint_timer_query"); } @@ -2276,7 +2256,7 @@ public void ext_disjoint_timer_query() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_frag_depth() throws Exception { test("EXT_frag_depth"); } @@ -2285,7 +2265,7 @@ public void ext_frag_depth() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_shader_texture_lod() throws Exception { test("EXT_shader_texture_lod"); } @@ -2294,7 +2274,7 @@ public void ext_shader_texture_lod() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_sRGB() throws Exception { test("EXT_sRGB"); } @@ -2303,7 +2283,7 @@ public void ext_sRGB() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void ext_texture_filter_anisotropic() throws Exception { test("EXT_texture_filter_anisotropic"); } @@ -2312,7 +2292,7 @@ public void ext_texture_filter_anisotropic() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void extendableEvent() throws Exception { test("ExtendableEvent"); } @@ -2321,7 +2301,7 @@ public void extendableEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void extendableMessageEvent() throws Exception { test("ExtendableMessageEvent"); } @@ -2332,7 +2312,7 @@ public void extendableMessageEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function External() { [native code] }", EDGE = "function External() { [native code] }") public void external() throws Exception { @@ -2343,7 +2323,7 @@ public void external() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function FederatedCredential() { [native code] }", EDGE = "function FederatedCredential() { [native code] }") public void federatedCredential() throws Exception { @@ -2354,7 +2334,7 @@ public void federatedCredential() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fetchEvent() throws Exception { test("FetchEvent"); } @@ -2372,7 +2352,7 @@ public void file() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileEntry() throws Exception { test("FileEntry"); } @@ -2381,7 +2361,7 @@ public void fileEntry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileEntrySync() throws Exception { test("FileEntrySync"); } @@ -2390,7 +2370,7 @@ public void fileEntrySync() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileError() throws Exception { test("FileError"); } @@ -2399,7 +2379,7 @@ public void fileError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileException() throws Exception { test("FileException"); } @@ -2408,7 +2388,7 @@ public void fileException() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileHandle() throws Exception { test("FileHandle"); } @@ -2435,7 +2415,7 @@ public void fileReader() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileReaderSync() throws Exception { test("FileReaderSync"); } @@ -2444,7 +2424,7 @@ public void fileReaderSync() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileRequest() throws Exception { test("FileRequest"); } @@ -2453,7 +2433,7 @@ public void fileRequest() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function FileSystem() { [native code] }", FF_ESR = "function FileSystem() { [native code] }") public void fileSystem() throws Exception { @@ -2464,7 +2444,7 @@ public void fileSystem() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function FileSystemDirectoryEntry() { [native code] }", FF_ESR = "function FileSystemDirectoryEntry() { [native code] }") public void fileSystemDirectoryEntry() throws Exception { @@ -2475,7 +2455,7 @@ public void fileSystemDirectoryEntry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function FileSystemDirectoryReader() { [native code] }", FF_ESR = "function FileSystemDirectoryReader() { [native code] }") public void fileSystemDirectoryReader() throws Exception { @@ -2486,7 +2466,7 @@ public void fileSystemDirectoryReader() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function FileSystemEntry() { [native code] }", FF_ESR = "function FileSystemEntry() { [native code] }") public void fileSystemEntry() throws Exception { @@ -2497,7 +2477,7 @@ public void fileSystemEntry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function FileSystemFileEntry() { [native code] }", FF_ESR = "function FileSystemFileEntry() { [native code] }") public void fileSystemFileEntry() throws Exception { @@ -2508,7 +2488,7 @@ public void fileSystemFileEntry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileSystemFlags() throws Exception { test("FileSystemFlags"); } @@ -2517,7 +2497,7 @@ public void fileSystemFlags() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fileSystemSync() throws Exception { test("FileSystemSync"); } @@ -2548,7 +2528,7 @@ public void float64Array() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void fMRadio() throws Exception { test("FMRadio"); } @@ -2575,7 +2555,7 @@ public void fontFace() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function FontFaceSet() { [native code] }", FF_ESR = "function FontFaceSet() { [native code] }") public void fontFaceSet() throws Exception { @@ -2586,7 +2566,7 @@ public void fontFaceSet() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void formChild() throws Exception { test("FormChild"); } @@ -2606,7 +2586,7 @@ public void formData() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void formField() throws Exception { test("FormField"); } @@ -2662,7 +2642,7 @@ public void gamepadEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void generator() throws Exception { test("Generator"); } @@ -2671,7 +2651,7 @@ public void generator() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void generatorFunction() throws Exception { test("GeneratorFunction"); } @@ -2724,7 +2704,7 @@ public void geolocationPositionError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void gestureEvent() throws Exception { test("GestureEvent"); } @@ -2733,7 +2713,7 @@ public void gestureEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void globalEventHandlers() throws Exception { test("GlobalEventHandlers"); } @@ -2742,7 +2722,7 @@ public void globalEventHandlers() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void globalFetch() throws Exception { test("GlobalFetch"); } @@ -2782,7 +2762,7 @@ public void history() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void hMDVRDevice() throws Exception { test("HMDVRDevice"); } @@ -2815,7 +2795,7 @@ public void htmlAnchorElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlAppletElement() throws Exception { test("HTMLAppletElement"); } @@ -2859,7 +2839,7 @@ public void htmlBaseElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlBaseFontElement() throws Exception { test("HTMLBaseFontElement"); } @@ -2870,7 +2850,7 @@ public void htmlBaseFontElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlBGSoundElement() throws Exception { test("HTMLBGSoundElement"); } @@ -2881,7 +2861,7 @@ public void htmlBGSoundElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlBlockElement() throws Exception { test("HTMLBlockElement"); } @@ -2892,7 +2872,7 @@ public void htmlBlockElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlBlockQuoteElement() throws Exception { test("HTMLBlockQuoteElement"); } @@ -2958,7 +2938,7 @@ public void htmlCollection() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlCommentElement() throws Exception { test("HTMLCommentElement"); } @@ -2967,7 +2947,7 @@ public void htmlCommentElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlContentElement() throws Exception { test("HTMLContentElement"); } @@ -2998,7 +2978,7 @@ public void htmlDataListElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDDElement() throws Exception { test("HTMLDDElement"); } @@ -3009,7 +2989,7 @@ public void htmlDDElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDefinitionDescriptionElement() throws Exception { test("HTMLDefinitionDescriptionElement"); } @@ -3020,7 +3000,7 @@ public void htmlDefinitionDescriptionElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDefinitionTermElement() throws Exception { test("HTMLDefinitionTermElement"); } @@ -3097,7 +3077,7 @@ public void htmlDocument() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlDTElement() throws Exception { test("HTMLDTElement"); } @@ -3194,7 +3174,7 @@ public void htmlFrameSetElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlGenericElement() throws Exception { test("HTMLGenericElement"); } @@ -3247,7 +3227,7 @@ public void htmlHtmlElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlHyperlinkElementUtils() throws Exception { test("HTMLHyperlinkElementUtils"); } @@ -3280,7 +3260,7 @@ public void htmlImageElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlInlineQuotationElement() throws Exception { test("HTMLInlineQuotationElement"); } @@ -3302,7 +3282,7 @@ public void htmlInputElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlIsIndexElement() throws Exception { test("HTMLIsIndexElement"); } @@ -3311,7 +3291,7 @@ public void htmlIsIndexElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlKeygenElement() throws Exception { test("HTMLKeygenElement"); } @@ -3366,7 +3346,7 @@ public void htmlLinkElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlListElement() throws Exception { test("HTMLListElement"); } @@ -3419,7 +3399,7 @@ public void htmlMenuElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlMenuItemElement() throws Exception { test("HTMLMenuItemElement"); } @@ -3463,7 +3443,7 @@ public void htmlModElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlNextIdElement() throws Exception { test("HTMLNextIdElement"); } @@ -3472,7 +3452,7 @@ public void htmlNextIdElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlNoShowElement() throws Exception { test("HTMLNoShowElement"); } @@ -3571,7 +3551,7 @@ public void htmlParamElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlPhraseElement() throws Exception { test("HTMLPhraseElement"); } @@ -3646,7 +3626,7 @@ public void htmlSelectElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlShadowElement() throws Exception { test("HTMLShadowElement"); } @@ -3732,7 +3712,7 @@ public void htmlTableColElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTableComponent() throws Exception { test("HTMLTableComponent"); } @@ -3743,7 +3723,7 @@ public void htmlTableComponent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTableDataCellElement() throws Exception { test("HTMLTableDataCellElement"); } @@ -3765,7 +3745,7 @@ public void htmlTableElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTableHeaderCellElement() throws Exception { test("HTMLTableHeaderCellElement"); } @@ -3816,7 +3796,7 @@ public void htmlTextAreaElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlTextElement() throws Exception { test("HTMLTextElement"); } @@ -3891,7 +3871,7 @@ public void htmlVideoElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void htmlWBRElement() throws Exception { test("HTMLWBRElement"); } @@ -3909,7 +3889,7 @@ public void idbCursor() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbCursorSync() throws Exception { test("IDBCursorSync"); } @@ -3936,7 +3916,7 @@ public void idbDatabase() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbDatabaseException() throws Exception { test("IDBDatabaseException"); } @@ -3945,7 +3925,7 @@ public void idbDatabaseException() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbDatabaseSync() throws Exception { test("IDBDatabaseSync"); } @@ -3954,7 +3934,7 @@ public void idbDatabaseSync() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbEnvironment() throws Exception { test("IDBEnvironment"); } @@ -3963,7 +3943,7 @@ public void idbEnvironment() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbEnvironmentSync() throws Exception { test("IDBEnvironmentSync"); } @@ -3983,7 +3963,7 @@ public void idbFactory() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbFactorySync() throws Exception { test("IDBFactorySync"); } @@ -4001,7 +3981,7 @@ public void idbIndex() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbIndexSync() throws Exception { test("IDBIndexSync"); } @@ -4019,7 +3999,7 @@ public void idbKeyRange() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbLocaleAwareKeyRange() throws Exception { test("IDBLocaleAwareKeyRange"); } @@ -4028,7 +4008,7 @@ public void idbLocaleAwareKeyRange() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbMutableFile() throws Exception { test("IDBMutableFile"); } @@ -4046,7 +4026,7 @@ public void idbObjectStore() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbObjectStoreSync() throws Exception { test("IDBObjectStoreSync"); } @@ -4082,7 +4062,7 @@ public void idbTransaction() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbTransactionSync() throws Exception { test("IDBTransactionSync"); } @@ -4100,7 +4080,7 @@ public void idbVersionChangeEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void idbVersionChangeRequest() throws Exception { test("IDBVersionChangeRequest"); } @@ -4109,7 +4089,7 @@ public void idbVersionChangeRequest() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void identityManager() throws Exception { test("IdentityManager"); } @@ -4156,7 +4136,7 @@ public void imageBitmap() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void imageBitmapFactories() throws Exception { test("ImageBitmapFactories"); } @@ -4183,7 +4163,7 @@ public void imageData() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void index() throws Exception { test("Index"); } @@ -4192,7 +4172,7 @@ public void index() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void indexedDB() throws Exception { test("IndexedDB"); } @@ -4210,7 +4190,7 @@ public void infinity() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function InputDeviceCapabilities() { [native code] }", EDGE = "function InputDeviceCapabilities() { [native code] }") public void inputDeviceCapabilities() throws Exception { @@ -4230,7 +4210,7 @@ public void inputEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void inputMethodContext() throws Exception { test("InputMethodContext"); } @@ -4239,7 +4219,7 @@ public void inputMethodContext() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void installEvent() throws Exception { test("InstallEvent"); } @@ -4248,7 +4228,7 @@ public void installEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "null", FF_ESR = "null") public void installTrigger() throws Exception { @@ -4259,7 +4239,7 @@ public void installTrigger() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void installTriggerImpl() throws Exception { test("InstallTriggerImpl"); } @@ -4301,7 +4281,7 @@ public void int8Array() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function InternalError() { [native code] }", FF_ESR = "function InternalError() { [native code] }") @HtmlUnitNYI(CHROME = "function InternalError() { [native code] }", @@ -4389,7 +4369,7 @@ public void isNaN() throws Exception { */ @Test @Alerts(DEFAULT = "function Iterator() { [native code] }", - FF_ESR = "exception") + FF_ESR = "ReferenceError") public void iterator() throws Exception { test("Iterator"); } @@ -4427,7 +4407,7 @@ public void keyframeEffect() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void keyframeEffectReadOnly() throws Exception { test("KeyframeEffectReadOnly"); } @@ -4436,7 +4416,7 @@ public void keyframeEffectReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n() throws Exception { test("L10n"); } @@ -4445,7 +4425,7 @@ public void l10n() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_formatValue() throws Exception { test("L10n.formatValue"); } @@ -4454,7 +4434,7 @@ public void l10n_formatValue() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_get() throws Exception { test("L10n.get"); } @@ -4463,7 +4443,7 @@ public void l10n_get() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_language_code() throws Exception { test("L10n.language.code"); } @@ -4472,7 +4452,7 @@ public void l10n_language_code() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_language_direction() throws Exception { test("L10n.language.direction"); } @@ -4481,7 +4461,7 @@ public void l10n_language_direction() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_once() throws Exception { test("L10n.once"); } @@ -4490,7 +4470,7 @@ public void l10n_once() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_ready() throws Exception { test("L10n.ready"); } @@ -4499,7 +4479,7 @@ public void l10n_ready() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_readyState() throws Exception { test("L10n.readyState"); } @@ -4508,7 +4488,7 @@ public void l10n_readyState() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_setAttributes() throws Exception { test("L10n.setAttributes"); } @@ -4517,7 +4497,7 @@ public void l10n_setAttributes() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void linkStyle() throws Exception { test("LinkStyle"); } @@ -4526,7 +4506,7 @@ public void linkStyle() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void localFileSystem() throws Exception { test("LocalFileSystem"); } @@ -4535,7 +4515,7 @@ public void localFileSystem() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void localFileSystemSync() throws Exception { test("LocalFileSystemSync"); } @@ -4546,7 +4526,7 @@ public void localFileSystemSync() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void localMediaStream() throws Exception { test("LocalMediaStream"); } @@ -4558,7 +4538,6 @@ public void localMediaStream() throws Exception { */ @Test @Alerts("function Location() { [native code] }") - @AlertsStandards("function Location() { [native code] }") public void location() throws Exception { test("Location"); } @@ -4567,7 +4546,7 @@ public void location() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void lockedFile() throws Exception { test("LockedFile"); } @@ -4576,7 +4555,7 @@ public void lockedFile() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void longRange() throws Exception { test("LongRange"); } @@ -4648,7 +4627,7 @@ public void mediaError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function MediaKeyError() { [native code] }", FF_ESR = "function MediaKeyError() { [native code] }") public void mediaKeyError() throws Exception { @@ -4659,7 +4638,7 @@ public void mediaKeyError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaKeyEvent() throws Exception { test("MediaKeyEvent"); } @@ -4713,7 +4692,7 @@ public void mediaKeySystemAccess() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaKeySystemConfiguration() throws Exception { test("MediaKeySystemConfiguration"); } @@ -4751,7 +4730,7 @@ public void mediaQueryListEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaQueryListListener() throws Exception { test("MediaQueryListListener"); } @@ -4805,7 +4784,7 @@ public void mediaStreamAudioSourceNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaStreamConstraints() throws Exception { test("MediaStreamConstraints"); } @@ -4841,7 +4820,7 @@ public void mediaStreamTrackEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaTrackConstraints() throws Exception { test("MediaTrackConstraints"); } @@ -4850,7 +4829,7 @@ public void mediaTrackConstraints() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaTrackSettings() throws Exception { test("MediaTrackSettings"); } @@ -4859,7 +4838,7 @@ public void mediaTrackSettings() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mediaTrackSupportedConstraints() throws Exception { test("MediaTrackSupportedConstraints"); } @@ -4901,7 +4880,7 @@ public void messagePort() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void metadata() throws Exception { test("Metadata"); } @@ -5015,7 +4994,7 @@ public void mouseEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function MouseScrollEvent() { [native code] }", FF_ESR = "function MouseScrollEvent() { [native code] }") public void mouseScrollEvent() throws Exception { @@ -5026,7 +5005,7 @@ public void mouseScrollEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mouseWheelEvent() throws Exception { test("MouseWheelEvent"); } @@ -5035,7 +5014,7 @@ public void mouseWheelEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozActivity() throws Exception { test("MozActivity"); } @@ -5044,7 +5023,7 @@ public void mozActivity() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozActivityOptions() throws Exception { test("MozActivityOptions"); } @@ -5053,7 +5032,7 @@ public void mozActivityOptions() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozActivityRequestHandler() throws Exception { test("MozActivityRequestHandler"); } @@ -5062,7 +5041,7 @@ public void mozActivityRequestHandler() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozAlarmsManager() throws Exception { test("MozAlarmsManager"); } @@ -5071,7 +5050,7 @@ public void mozAlarmsManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozContact() throws Exception { test("MozContact"); } @@ -5080,7 +5059,7 @@ public void mozContact() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozContactChangeEvent() throws Exception { test("MozContactChangeEvent"); } @@ -5089,7 +5068,7 @@ public void mozContactChangeEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozCSSKeyframesRule() throws Exception { test("MozCSSKeyframesRule"); } @@ -5098,7 +5077,7 @@ public void mozCSSKeyframesRule() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozIccManager() throws Exception { test("MozIccManager"); } @@ -5107,7 +5086,7 @@ public void mozIccManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMmsEvent() throws Exception { test("MozMmsEvent"); } @@ -5116,7 +5095,7 @@ public void mozMmsEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMmsMessage() throws Exception { test("MozMmsMessage"); } @@ -5125,7 +5104,7 @@ public void mozMmsMessage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileCellInfo() throws Exception { test("MozMobileCellInfo"); } @@ -5134,7 +5113,7 @@ public void mozMobileCellInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileCFInfo() throws Exception { test("MozMobileCFInfo"); } @@ -5143,7 +5122,7 @@ public void mozMobileCFInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileConnection() throws Exception { test("MozMobileConnection"); } @@ -5152,7 +5131,7 @@ public void mozMobileConnection() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileConnectionInfo() throws Exception { test("MozMobileConnectionInfo"); } @@ -5161,7 +5140,7 @@ public void mozMobileConnectionInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileICCInfo() throws Exception { test("MozMobileICCInfo"); } @@ -5170,7 +5149,7 @@ public void mozMobileICCInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileMessageManager() throws Exception { test("MozMobileMessageManager"); } @@ -5179,7 +5158,7 @@ public void mozMobileMessageManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileMessageThread() throws Exception { test("MozMobileMessageThread"); } @@ -5188,7 +5167,7 @@ public void mozMobileMessageThread() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozMobileNetworkInfo() throws Exception { test("MozMobileNetworkInfo"); } @@ -5197,7 +5176,7 @@ public void mozMobileNetworkInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNDEFRecord() throws Exception { test("MozNDEFRecord"); } @@ -5206,7 +5185,7 @@ public void mozNDEFRecord() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNetworkStats() throws Exception { test("MozNetworkStats"); } @@ -5215,7 +5194,7 @@ public void mozNetworkStats() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNetworkStatsData() throws Exception { test("MozNetworkStatsData"); } @@ -5224,7 +5203,7 @@ public void mozNetworkStatsData() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNetworkStatsManager() throws Exception { test("MozNetworkStatsManager"); } @@ -5233,7 +5212,7 @@ public void mozNetworkStatsManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNFC() throws Exception { test("MozNFC"); } @@ -5242,7 +5221,7 @@ public void mozNFC() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNFCPeer() throws Exception { test("MozNFCPeer"); } @@ -5251,7 +5230,7 @@ public void mozNFCPeer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozNFCTag() throws Exception { test("MozNFCTag"); } @@ -5260,7 +5239,7 @@ public void mozNFCTag() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozPowerManager() throws Exception { test("MozPowerManager"); } @@ -5269,7 +5248,7 @@ public void mozPowerManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozRTCIceCandidate() throws Exception { test("mozRTCIceCandidate"); } @@ -5278,7 +5257,7 @@ public void mozRTCIceCandidate() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozRTCPeerConnection() throws Exception { test("mozRTCPeerConnection"); } @@ -5287,7 +5266,7 @@ public void mozRTCPeerConnection() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozRTCSessionDescription() throws Exception { test("mozRTCSessionDescription"); } @@ -5296,7 +5275,7 @@ public void mozRTCSessionDescription() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSettingsEvent() throws Exception { test("MozSettingsEvent"); } @@ -5305,7 +5284,7 @@ public void mozSettingsEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSmsEvent() throws Exception { test("MozSmsEvent"); } @@ -5314,7 +5293,7 @@ public void mozSmsEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSmsFilter() throws Exception { test("MozSmsFilter"); } @@ -5323,7 +5302,7 @@ public void mozSmsFilter() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSmsManager() throws Exception { test("MozSmsManager"); } @@ -5332,7 +5311,7 @@ public void mozSmsManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSmsMessage() throws Exception { test("MozSmsMessage"); } @@ -5341,7 +5320,7 @@ public void mozSmsMessage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSmsSegmentInfo() throws Exception { test("MozSmsSegmentInfo"); } @@ -5350,7 +5329,7 @@ public void mozSmsSegmentInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozSocial() throws Exception { test("MozSocial"); } @@ -5359,7 +5338,7 @@ public void mozSocial() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozTimeManager() throws Exception { test("MozTimeManager"); } @@ -5368,7 +5347,7 @@ public void mozTimeManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozVoicemail() throws Exception { test("MozVoicemail"); } @@ -5377,7 +5356,7 @@ public void mozVoicemail() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozVoicemailEvent() throws Exception { test("MozVoicemailEvent"); } @@ -5386,7 +5365,7 @@ public void mozVoicemailEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozVoicemailStatus() throws Exception { test("MozVoicemailStatus"); } @@ -5395,7 +5374,7 @@ public void mozVoicemailStatus() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozWifiConnectionInfoEvent() throws Exception { test("MozWifiConnectionInfoEvent"); } @@ -5404,7 +5383,7 @@ public void mozWifiConnectionInfoEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozWifiP2pGroupOwner() throws Exception { test("MozWifiP2pGroupOwner"); } @@ -5413,7 +5392,7 @@ public void mozWifiP2pGroupOwner() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozWifiP2pManager() throws Exception { test("MozWifiP2pManager"); } @@ -5422,7 +5401,7 @@ public void mozWifiP2pManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void mozWifiStatusChangeEvent() throws Exception { test("MozWifiStatusChangeEvent"); } @@ -5431,7 +5410,7 @@ public void mozWifiStatusChangeEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void msCurrentStyleCSSProperties() throws Exception { test("MSCurrentStyleCSSProperties"); } @@ -5440,7 +5419,7 @@ public void msCurrentStyleCSSProperties() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void msGestureEvent() throws Exception { test("MSGestureEvent"); } @@ -5449,7 +5428,7 @@ public void msGestureEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void msStyleCSSProperties() throws Exception { test("MSStyleCSSProperties"); } @@ -5460,8 +5439,7 @@ public void msStyleCSSProperties() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "exception", - FF = "function MutationEvent() { [native code] }", + @Alerts(DEFAULT = "ReferenceError", FF_ESR = "function MutationEvent() { [native code] }") public void mutationEvent() throws Exception { test("MutationEvent"); @@ -5500,7 +5478,7 @@ public void namedNodeMap() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void nameList() throws Exception { test("NameList"); } @@ -5511,7 +5489,7 @@ public void nameList() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void namespace() throws Exception { test("Namespace"); } @@ -5522,7 +5500,7 @@ public void namespace() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void namespaceCollection() throws Exception { test("NamespaceCollection"); } @@ -5542,7 +5520,7 @@ public void naN() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void nativeXPathNSResolver() throws Exception { test("NativeXPathNSResolver"); } @@ -5562,7 +5540,7 @@ public void navigator() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorConcurrentHardware() throws Exception { test("NavigatorConcurrentHardware"); } @@ -5571,7 +5549,7 @@ public void navigatorConcurrentHardware() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorGeolocation() throws Exception { test("NavigatorGeolocation"); } @@ -5580,7 +5558,7 @@ public void navigatorGeolocation() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorID() throws Exception { test("NavigatorID"); } @@ -5589,7 +5567,7 @@ public void navigatorID() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorLanguage() throws Exception { test("NavigatorLanguage"); } @@ -5598,7 +5576,7 @@ public void navigatorLanguage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorOnLine() throws Exception { test("NavigatorOnLine"); } @@ -5607,7 +5585,7 @@ public void navigatorOnLine() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorPlugins() throws Exception { test("NavigatorPlugins"); } @@ -5616,7 +5594,7 @@ public void navigatorPlugins() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void navigatorStorage() throws Exception { test("NavigatorStorage"); } @@ -5625,7 +5603,7 @@ public void navigatorStorage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function NetworkInformation() { [native code] }", EDGE = "function NetworkInformation() { [native code] }") public void networkInformation() throws Exception { @@ -5678,7 +5656,7 @@ public void nodeList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void nonDocumentTypeChildNode() throws Exception { test("NonDocumentTypeChildNode"); } @@ -5687,7 +5665,7 @@ public void nonDocumentTypeChildNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void notation() throws Exception { test("Notation"); } @@ -5707,7 +5685,7 @@ public void notification() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void notificationEvent() throws Exception { test("NotificationEvent"); } @@ -5716,7 +5694,7 @@ public void notificationEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void notifyAudioAvailableEvent() throws Exception { test("NotifyAudioAvailableEvent"); } @@ -5743,7 +5721,7 @@ public void object() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_element_index_uint() throws Exception { test("OES_element_index_uint"); } @@ -5752,7 +5730,7 @@ public void oes_element_index_uint() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_standard_derivatives() throws Exception { test("OES_standard_derivatives"); } @@ -5761,7 +5739,7 @@ public void oes_standard_derivatives() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_texture_float() throws Exception { test("OES_texture_float"); } @@ -5770,7 +5748,7 @@ public void oes_texture_float() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_texture_float_linear() throws Exception { test("OES_texture_float_linear"); } @@ -5779,7 +5757,7 @@ public void oes_texture_float_linear() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_texture_half_float() throws Exception { test("OES_texture_half_float"); } @@ -5788,7 +5766,7 @@ public void oes_texture_half_float() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_texture_half_float_linear() throws Exception { test("OES_texture_half_float_linear"); } @@ -5797,7 +5775,7 @@ public void oes_texture_half_float_linear() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void oes_vertex_array_object() throws Exception { test("OES_vertex_array_object"); } @@ -5824,7 +5802,7 @@ public void offlineAudioContext() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void offlineResourceList() throws Exception { test("OfflineResourceList"); } @@ -5834,10 +5812,10 @@ public void offlineResourceList() throws Exception { */ @Test @Alerts("function OffscreenCanvas() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", - EDGE = "exception", - FF = "exception", - FF_ESR = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", + EDGE = "ReferenceError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") public void offscreenCanvas() throws Exception { test("OffscreenCanvas"); } @@ -5866,7 +5844,7 @@ public void oscillatorNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void overflowEvent() throws Exception { test("OverflowEvent"); } @@ -5893,7 +5871,7 @@ public void pannerNode() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void parallelArray() throws Exception { test("ParallelArray"); } @@ -5902,7 +5880,7 @@ public void parallelArray() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void parentNode() throws Exception { test("ParentNode"); } @@ -5929,7 +5907,7 @@ public void parseInt() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function PasswordCredential() { [native code] }", EDGE = "function PasswordCredential() { [native code] }") public void passwordCredential() throws Exception { @@ -5951,7 +5929,7 @@ public void path2D() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function PaymentAddress() { [native code] }", EDGE = "function PaymentAddress() { [native code] }") public void paymentAddress() throws Exception { @@ -5962,7 +5940,7 @@ public void paymentAddress() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function PaymentRequest() { [native code] }", EDGE = "function PaymentRequest() { [native code] }") public void paymentRequest() throws Exception { @@ -5973,7 +5951,7 @@ public void paymentRequest() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function PaymentResponse() { [native code] }", EDGE = "function PaymentResponse() { [native code] }") public void paymentResponse() throws Exception { @@ -6002,7 +5980,7 @@ public void performanceEntry() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void performanceFrameTiming() throws Exception { test("PerformanceFrameTiming"); } @@ -6083,7 +6061,7 @@ public void performanceTiming() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void periodicSyncEvent() throws Exception { test("PeriodicSyncEvent"); } @@ -6092,7 +6070,7 @@ public void periodicSyncEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function PeriodicSyncManager() { [native code] }", EDGE = "function PeriodicSyncManager() { [native code] }") public void periodicSyncManager() throws Exception { @@ -6103,7 +6081,7 @@ public void periodicSyncManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void periodicSyncRegistration() throws Exception { test("PeriodicSyncRegistration"); } @@ -6130,7 +6108,7 @@ public void permissions() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void permissionSettings() throws Exception { test("PermissionSettings"); } @@ -6170,7 +6148,7 @@ public void pluginArray() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void point() throws Exception { test("Point"); } @@ -6199,7 +6177,7 @@ public void popStateEvent() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void popup() throws Exception { test("Popup"); } @@ -6208,7 +6186,7 @@ public void popup() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void portCollection() throws Exception { test("PortCollection"); } @@ -6219,7 +6197,7 @@ public void portCollection() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void position() throws Exception { test("Position"); } @@ -6228,7 +6206,7 @@ public void position() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void positionError() throws Exception { test("PositionError"); } @@ -6237,7 +6215,7 @@ public void positionError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void positionOptions() throws Exception { test("PositionOptions"); } @@ -6246,7 +6224,7 @@ public void positionOptions() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void positionSensorVRDevice() throws Exception { test("PositionSensorVRDevice"); } @@ -6255,7 +6233,7 @@ public void positionSensorVRDevice() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void powerManager() throws Exception { test("PowerManager"); } @@ -6264,7 +6242,7 @@ public void powerManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function Presentation() { [native code] }", EDGE = "function Presentation() { [native code] }") public void presentation() throws Exception { @@ -6275,7 +6253,7 @@ public void presentation() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function PresentationAvailability() { [native code] }", EDGE = "function PresentationAvailability() { [native code] }") public void presentationAvailability() throws Exception { @@ -6286,7 +6264,7 @@ public void presentationAvailability() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function PresentationConnection() { [native code] }", EDGE = "function PresentationConnection() { [native code] }") public void presentationConnection() throws Exception { @@ -6297,7 +6275,7 @@ public void presentationConnection() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function PresentationConnectionAvailableEvent() { [native code] }", EDGE = "function PresentationConnectionAvailableEvent() { [native code] }") public void presentationConnectionAvailableEvent() throws Exception { @@ -6308,7 +6286,7 @@ public void presentationConnectionAvailableEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void presentationConnectionClosedEvent() throws Exception { test("PresentationConnectionClosedEvent"); } @@ -6317,7 +6295,7 @@ public void presentationConnectionClosedEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function PresentationConnectionCloseEvent() { [native code] }", EDGE = "function PresentationConnectionCloseEvent() { [native code] }") public void presentationConnectionCloseEvent() throws Exception { @@ -6328,11 +6306,11 @@ public void presentationConnectionCloseEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function PresentationConnectionList() { [native code] }", EDGE = "function PresentationConnectionList() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", - EDGE = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", + EDGE = "ReferenceError") public void presentationConnectionList() throws Exception { test("PresentationConnectionList"); } @@ -6341,11 +6319,11 @@ public void presentationConnectionList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function PresentationReceiver() { [native code] }", EDGE = "function PresentationReceiver() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", - EDGE = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", + EDGE = "ReferenceError") public void presentationReceiver() throws Exception { test("PresentationReceiver"); } @@ -6354,7 +6332,7 @@ public void presentationReceiver() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function PresentationRequest() { [native code] }", EDGE = "function PresentationRequest() { [native code] }") public void presentationRequest() throws Exception { @@ -6394,7 +6372,7 @@ public void promise() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void promiseRejection() throws Exception { test("PromiseRejection"); } @@ -6412,7 +6390,7 @@ public void promiseRejectionEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void promiseResolver() throws Exception { test("PromiseResolver"); } @@ -6430,7 +6408,7 @@ public void proxy() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void pushEvent() throws Exception { test("PushEvent"); } @@ -6448,7 +6426,7 @@ public void pushManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void pushMessageData() throws Exception { test("PushMessageData"); } @@ -6457,7 +6435,7 @@ public void pushMessageData() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void pushRegistrationManager() throws Exception { test("PushRegistrationManager"); } @@ -6493,7 +6471,7 @@ public void radioNodeList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void randomSource() throws Exception { test("RandomSource"); } @@ -6522,7 +6500,7 @@ public void rangeError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void readableByteStream() throws Exception { test("ReadableByteStream"); } @@ -6567,7 +6545,7 @@ public void regExp() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function RemotePlayback() { [native code] }", EDGE = "function RemotePlayback() { [native code] }") public void remotePlayback() throws Exception { @@ -6578,7 +6556,7 @@ public void remotePlayback() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void renderingContext() throws Exception { test("RenderingContext"); } @@ -6607,7 +6585,7 @@ public void response() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rowContainer() throws Exception { test("RowContainer"); } @@ -6625,7 +6603,7 @@ public void rtcCertificate() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcConfiguration() throws Exception { test("RTCConfiguration"); } @@ -6635,10 +6613,10 @@ public void rtcConfiguration() throws Exception { */ @Test @Alerts("function RTCDataChannel() { [native code] }") - @HtmlUnitNYI(CHROME = "exception", - EDGE = "exception", - FF = "exception", - FF_ESR = "exception") + @HtmlUnitNYI(CHROME = "ReferenceError", + EDGE = "ReferenceError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") public void rtcDataChannel() throws Exception { test("RTCDataChannel"); } @@ -6665,7 +6643,7 @@ public void rtcIceCandidate() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcIceServer() throws Exception { test("RTCIceServer"); } @@ -6674,7 +6652,7 @@ public void rtcIceServer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcIdentityAssertion() throws Exception { test("RTCIdentityAssertion"); } @@ -6683,7 +6661,7 @@ public void rtcIdentityAssertion() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcIdentityErrorEvent() throws Exception { test("RTCIdentityErrorEvent"); } @@ -6692,7 +6670,7 @@ public void rtcIdentityErrorEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcIdentityEvent() throws Exception { test("RTCIdentityEvent"); } @@ -6737,7 +6715,7 @@ public void rtcSessionDescription() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void rtcSessionDescriptionCallback() throws Exception { test("RTCSessionDescriptionCallback"); } @@ -6822,7 +6800,7 @@ public void serviceWorkerContainer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void serviceWorkerGlobalScope() throws Exception { test("ServiceWorkerGlobalScope"); } @@ -6831,7 +6809,7 @@ public void serviceWorkerGlobalScope() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void serviceWorkerMessageEvent() throws Exception { test("ServiceWorkerMessageEvent"); } @@ -6849,7 +6827,7 @@ public void serviceWorkerRegistration() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void serviceWorkerState() throws Exception { test("ServiceWorkerState"); } @@ -6867,7 +6845,7 @@ public void set() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void settingsLock() throws Exception { test("SettingsLock"); } @@ -6876,7 +6854,7 @@ public void settingsLock() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void settingsManager() throws Exception { test("SettingsManager"); } @@ -6896,7 +6874,7 @@ public void shadowRoot() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void sharedArrayBuffer() throws Exception { test("SharedArrayBuffer"); } @@ -6905,7 +6883,7 @@ public void sharedArrayBuffer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void sharedKeyframeList() throws Exception { test("SharedKeyframeList"); } @@ -6925,7 +6903,7 @@ public void sharedWorker() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void sharedWorkerGlobalScope() throws Exception { test("SharedWorkerGlobalScope"); } @@ -6934,7 +6912,7 @@ public void sharedWorkerGlobalScope() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd() throws Exception { test("SIMD"); } @@ -6943,7 +6921,7 @@ public void simd() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool16x8() throws Exception { test("SIMD.Bool16x8"); } @@ -6952,7 +6930,7 @@ public void simd_Bool16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool32x4() throws Exception { test("SIMD.Bool32x4"); } @@ -6961,7 +6939,7 @@ public void simd_Bool32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool64x2() throws Exception { test("SIMD.Bool64x2"); } @@ -6970,7 +6948,7 @@ public void simd_Bool64x2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool8x16() throws Exception { test("SIMD.Bool8x16"); } @@ -6979,7 +6957,7 @@ public void simd_Bool8x16() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_float32x4() throws Exception { test("SIMD.float32x4"); } @@ -6988,7 +6966,7 @@ public void simd_float32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Float32x4() throws Exception { test("SIMD.Float32x4"); } @@ -6997,7 +6975,7 @@ public void simd_Float32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_float64x2() throws Exception { test("SIMD.float64x2"); } @@ -7006,7 +6984,7 @@ public void simd_float64x2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Float64x2() throws Exception { test("SIMD.Float64x2"); } @@ -7015,7 +6993,7 @@ public void simd_Float64x2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_int16x8() throws Exception { test("SIMD.int16x8"); } @@ -7024,7 +7002,7 @@ public void simd_int16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Int16x8() throws Exception { test("SIMD.Int16x8"); } @@ -7033,7 +7011,7 @@ public void simd_Int16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_int32x4() throws Exception { test("SIMD.int32x4"); } @@ -7042,7 +7020,7 @@ public void simd_int32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Int32x4() throws Exception { test("SIMD.Int32x4"); } @@ -7051,7 +7029,7 @@ public void simd_Int32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_int8x16() throws Exception { test("SIMD.int8x16"); } @@ -7060,7 +7038,7 @@ public void simd_int8x16() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Int8x16() throws Exception { test("SIMD.Int8x16"); } @@ -7069,7 +7047,7 @@ public void simd_Int8x16() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Uint16x8() throws Exception { test("SIMD.Uint16x8"); } @@ -7078,7 +7056,7 @@ public void simd_Uint16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Uint32x4() throws Exception { test("SIMD.Uint32x4"); } @@ -7087,7 +7065,7 @@ public void simd_Uint32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Uint8x16() throws Exception { test("SIMD.Uint8x16"); } @@ -7098,7 +7076,7 @@ public void simd_Uint8x16() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simpleArray() throws Exception { test("SimpleArray"); } @@ -7107,7 +7085,7 @@ public void simpleArray() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void siteBoundCredential() throws Exception { test("SiteBoundCredential"); } @@ -7134,7 +7112,7 @@ public void sourceBufferList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechGrammar() throws Exception { test("SpeechGrammar"); } @@ -7143,7 +7121,7 @@ public void speechGrammar() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechGrammarList() throws Exception { test("SpeechGrammarList"); } @@ -7152,7 +7130,7 @@ public void speechGrammarList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognition() throws Exception { test("SpeechRecognition"); } @@ -7161,7 +7139,7 @@ public void speechRecognition() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognitionAlternative() throws Exception { test("SpeechRecognitionAlternative"); } @@ -7170,7 +7148,7 @@ public void speechRecognitionAlternative() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognitionError() throws Exception { test("SpeechRecognitionError"); } @@ -7179,7 +7157,7 @@ public void speechRecognitionError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognitionErrorEvent() throws Exception { test("SpeechRecognitionErrorEvent"); } @@ -7188,7 +7166,7 @@ public void speechRecognitionErrorEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognitionEvent() throws Exception { test("SpeechRecognitionEvent"); } @@ -7197,7 +7175,7 @@ public void speechRecognitionEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognitionResult() throws Exception { test("SpeechRecognitionResult"); } @@ -7206,7 +7184,7 @@ public void speechRecognitionResult() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void speechRecognitionResultList() throws Exception { test("SpeechRecognitionResultList"); } @@ -7260,7 +7238,7 @@ public void speechSynthesisVoice() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void staticNodeList() throws Exception { test("StaticNodeList"); } @@ -7280,7 +7258,7 @@ public void stereoPannerNode() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void stopIteration() throws Exception { test("StopIteration"); } @@ -7300,7 +7278,7 @@ public void storage() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void storageEstimate() throws Exception { test("StorageEstimate"); } @@ -7327,7 +7305,7 @@ public void storageManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void storageQuota() throws Exception { test("StorageQuota"); } @@ -7345,7 +7323,7 @@ public void string() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void styleMedia() throws Exception { test("StyleMedia"); } @@ -7403,7 +7381,7 @@ public void svgAElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAltGlyphElement() throws Exception { test("SVGAltGlyphElement"); } @@ -7423,7 +7401,7 @@ public void svgAngle() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimateColorElement() throws Exception { test("SVGAnimateColorElement"); } @@ -7504,7 +7482,7 @@ public void svgAnimatedNumberList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgAnimatedPoints() throws Exception { test("SVGAnimatedPoints"); } @@ -7622,7 +7600,7 @@ public void svgComponentTransferFunctionElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgCursorElement() throws Exception { test("SVGCursorElement"); } @@ -7653,7 +7631,7 @@ public void svgDescElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgDiscardElement() throws Exception { test("SVGDiscardElement"); } @@ -7662,7 +7640,7 @@ public void svgDiscardElement() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgDocument() throws Exception { test("SVGDocument"); } @@ -7693,7 +7671,7 @@ public void svgEllipseElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgEvent() throws Exception { test("SVGEvent"); } @@ -7986,7 +7964,7 @@ public void svgFilterElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFontElement() throws Exception { test("SVGFontElement"); } @@ -7995,7 +7973,7 @@ public void svgFontElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFontFaceElement() throws Exception { test("SVGFontFaceElement"); } @@ -8004,7 +7982,7 @@ public void svgFontFaceElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFontFaceFormatElement() throws Exception { test("SVGFontFaceFormatElement"); } @@ -8013,7 +7991,7 @@ public void svgFontFaceFormatElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFontFaceNameElement() throws Exception { test("SVGFontFaceNameElement"); } @@ -8022,7 +8000,7 @@ public void svgFontFaceNameElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFontFaceSrcElement() throws Exception { test("SVGFontFaceSrcElement"); } @@ -8031,7 +8009,7 @@ public void svgFontFaceSrcElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgFontFaceUriElement() throws Exception { test("SVGFontFaceUriElement"); } @@ -8071,7 +8049,7 @@ public void svgGeometryElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgGlyphElement() throws Exception { test("SVGGlyphElement"); } @@ -8098,7 +8076,7 @@ public void svgGraphicsElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgHKernElement() throws Exception { test("SVGHKernElement"); } @@ -8202,7 +8180,7 @@ public void svgMetadataElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgMissingGlyphElement() throws Exception { test("SVGMissingGlyphElement"); } @@ -8251,7 +8229,7 @@ public void svgPathElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSeg() throws Exception { test("SVGPathSeg"); } @@ -8260,7 +8238,7 @@ public void svgPathSeg() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegArcAbs() throws Exception { test("SVGPathSegArcAbs"); } @@ -8269,7 +8247,7 @@ public void svgPathSegArcAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegArcRel() throws Exception { test("SVGPathSegArcRel"); } @@ -8278,7 +8256,7 @@ public void svgPathSegArcRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegClosePath() throws Exception { test("SVGPathSegClosePath"); } @@ -8287,7 +8265,7 @@ public void svgPathSegClosePath() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoCubicAbs() throws Exception { test("SVGPathSegCurvetoCubicAbs"); } @@ -8296,7 +8274,7 @@ public void svgPathSegCurvetoCubicAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoCubicRel() throws Exception { test("SVGPathSegCurvetoCubicRel"); } @@ -8305,7 +8283,7 @@ public void svgPathSegCurvetoCubicRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoCubicSmoothAbs() throws Exception { test("SVGPathSegCurvetoCubicSmoothAbs"); } @@ -8314,7 +8292,7 @@ public void svgPathSegCurvetoCubicSmoothAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoCubicSmoothRel() throws Exception { test("SVGPathSegCurvetoCubicSmoothRel"); } @@ -8323,7 +8301,7 @@ public void svgPathSegCurvetoCubicSmoothRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoQuadraticAbs() throws Exception { test("SVGPathSegCurvetoQuadraticAbs"); } @@ -8332,7 +8310,7 @@ public void svgPathSegCurvetoQuadraticAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoQuadraticRel() throws Exception { test("SVGPathSegCurvetoQuadraticRel"); } @@ -8341,7 +8319,7 @@ public void svgPathSegCurvetoQuadraticRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoQuadraticSmoothAbs() throws Exception { test("SVGPathSegCurvetoQuadraticSmoothAbs"); } @@ -8350,7 +8328,7 @@ public void svgPathSegCurvetoQuadraticSmoothAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegCurvetoQuadraticSmoothRel() throws Exception { test("SVGPathSegCurvetoQuadraticSmoothRel"); } @@ -8359,7 +8337,7 @@ public void svgPathSegCurvetoQuadraticSmoothRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegLinetoAbs() throws Exception { test("SVGPathSegLinetoAbs"); } @@ -8368,7 +8346,7 @@ public void svgPathSegLinetoAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegLinetoHorizontalAbs() throws Exception { test("SVGPathSegLinetoHorizontalAbs"); } @@ -8377,7 +8355,7 @@ public void svgPathSegLinetoHorizontalAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegLinetoHorizontalRel() throws Exception { test("SVGPathSegLinetoHorizontalRel"); } @@ -8386,7 +8364,7 @@ public void svgPathSegLinetoHorizontalRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegLinetoRel() throws Exception { test("SVGPathSegLinetoRel"); } @@ -8395,7 +8373,7 @@ public void svgPathSegLinetoRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegLinetoVerticalAbs() throws Exception { test("SVGPathSegLinetoVerticalAbs"); } @@ -8404,7 +8382,7 @@ public void svgPathSegLinetoVerticalAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegLinetoVerticalRel() throws Exception { test("SVGPathSegLinetoVerticalRel"); } @@ -8413,7 +8391,7 @@ public void svgPathSegLinetoVerticalRel() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegList() throws Exception { test("SVGPathSegList"); } @@ -8422,7 +8400,7 @@ public void svgPathSegList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegMovetoAbs() throws Exception { test("SVGPathSegMovetoAbs"); } @@ -8431,7 +8409,7 @@ public void svgPathSegMovetoAbs() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgPathSegMovetoRel() throws Exception { test("SVGPathSegMovetoRel"); } @@ -8533,7 +8511,7 @@ public void svgRectElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgRenderingIntent() throws Exception { test("SVGRenderingIntent"); } @@ -8584,7 +8562,7 @@ public void svgStringList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgStylable() throws Exception { test("SVGStylable"); } @@ -8637,7 +8615,7 @@ public void svgSymbolElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTests() throws Exception { test("SVGTests"); } @@ -8706,7 +8684,7 @@ public void svgTransform() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTransformable() throws Exception { test("SVGTransformable"); } @@ -8724,7 +8702,7 @@ public void svgTransformList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgTRefElement() throws Exception { test("SVGTRefElement"); } @@ -8775,7 +8753,7 @@ public void svgViewElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgViewSpec() throws Exception { test("SVGViewSpec"); } @@ -8784,7 +8762,7 @@ public void svgViewSpec() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgVKernElement() throws Exception { test("SVGVKernElement"); } @@ -8793,7 +8771,7 @@ public void svgVKernElement() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void svgZoomEvent() throws Exception { test("SVGZoomEvent"); } @@ -8811,7 +8789,7 @@ public void symbol() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void syncEvent() throws Exception { test("SyncEvent"); } @@ -8820,7 +8798,7 @@ public void syncEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function SyncManager() { [native code] }", EDGE = "function SyncManager() { [native code] }") public void syncManager() throws Exception { @@ -8831,7 +8809,7 @@ public void syncManager() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void syncRegistration() throws Exception { test("SyncRegistration"); } @@ -8849,7 +8827,7 @@ public void syntaxError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void tcpServerSocket() throws Exception { test("TCPServerSocket"); } @@ -8858,7 +8836,7 @@ public void tcpServerSocket() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void tcpSocket() throws Exception { test("TCPSocket"); } @@ -8867,7 +8845,7 @@ public void tcpSocket() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void telephony() throws Exception { test("Telephony"); } @@ -8876,7 +8854,7 @@ public void telephony() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void telephonyCall() throws Exception { test("TelephonyCall"); } @@ -8885,7 +8863,7 @@ public void telephonyCall() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void telephonyCallGroup() throws Exception { test("TelephonyCallGroup"); } @@ -8924,7 +8902,7 @@ public void textEncoder() throws Exception { */ @Test @Alerts(DEFAULT = "function TextEvent() { [native code] }", - FF_ESR = "exception") + FF_ESR = "ReferenceError") public void textEvent() throws Exception { test("TextEvent"); } @@ -8944,7 +8922,7 @@ public void textMetrics() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void textRange() throws Exception { test("TextRange"); } @@ -8989,7 +8967,7 @@ public void textTrackList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", FF = "function TimeEvent() { [native code] }", FF_ESR = "function TimeEvent() { [native code] }") public void timeEvent() throws Exception { @@ -9009,7 +8987,7 @@ public void timeRanges() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function Touch() { [native code] }", EDGE = "function Touch() { [native code] }") public void touch() throws Exception { @@ -9020,7 +8998,7 @@ public void touch() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function TouchEvent() { [native code] }", EDGE = "function TouchEvent() { [native code] }") public void touchEvent() throws Exception { @@ -9031,7 +9009,7 @@ public void touchEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function TouchList() { [native code] }", EDGE = "function TouchList() { [native code] }") public void touchList() throws Exception { @@ -9042,7 +9020,7 @@ public void touchList() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void trackDefault() throws Exception { test("TrackDefault"); } @@ -9051,7 +9029,7 @@ public void trackDefault() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void trackDefaultList() throws Exception { test("TrackDefaultList"); } @@ -9069,7 +9047,7 @@ public void trackEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void transferable() throws Exception { test("Transferable"); } @@ -9098,7 +9076,7 @@ public void treeWalker() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void typedArray() throws Exception { test("TypedArray"); } @@ -9116,7 +9094,7 @@ public void typeError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void typeInfo() throws Exception { test("TypeInfo"); } @@ -9125,7 +9103,7 @@ public void typeInfo() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void uDPSocket() throws Exception { test("UDPSocket"); } @@ -9207,7 +9185,7 @@ public void unescape() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void uneval() throws Exception { test("uneval"); } @@ -9245,7 +9223,7 @@ public void urlSearchParams() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void urlUtils() throws Exception { test("URLUtils"); } @@ -9254,7 +9232,7 @@ public void urlUtils() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void urlUtilsReadOnly() throws Exception { test("URLUtilsReadOnly"); } @@ -9263,7 +9241,7 @@ public void urlUtilsReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void userDataHandler() throws Exception { test("UserDataHandler"); } @@ -9272,7 +9250,7 @@ public void userDataHandler() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void userProximityEvent() throws Exception { test("UserProximityEvent"); } @@ -9281,7 +9259,7 @@ public void userProximityEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void uSVString() throws Exception { test("USVString"); } @@ -9308,7 +9286,7 @@ public void videoPlaybackQuality() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrDevice() throws Exception { test("VRDevice"); } @@ -9317,7 +9295,7 @@ public void vrDevice() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrDisplay() throws Exception { test("VRDisplay"); } @@ -9326,7 +9304,7 @@ public void vrDisplay() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrDisplayCapabilities() throws Exception { test("VRDisplayCapabilities"); } @@ -9335,7 +9313,7 @@ public void vrDisplayCapabilities() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrEyeParameters() throws Exception { test("VREyeParameters"); } @@ -9344,7 +9322,7 @@ public void vrEyeParameters() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrFieldOfView() throws Exception { test("VRFieldOfView"); } @@ -9353,7 +9331,7 @@ public void vrFieldOfView() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrFieldOfViewReadOnly() throws Exception { test("VRFieldOfViewReadOnly"); } @@ -9362,7 +9340,7 @@ public void vrFieldOfViewReadOnly() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrLayer() throws Exception { test("VRLayer"); } @@ -9371,7 +9349,7 @@ public void vrLayer() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrPose() throws Exception { test("VRPose"); } @@ -9380,7 +9358,7 @@ public void vrPose() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrPositionState() throws Exception { test("VRPositionState"); } @@ -9389,7 +9367,7 @@ public void vrPositionState() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void vrStageParameters() throws Exception { test("VRStageParameters"); } @@ -9434,7 +9412,7 @@ public void weakSet() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL() throws Exception { test("WebGL"); } @@ -9443,7 +9421,7 @@ public void webGL() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_color_buffer_float() throws Exception { test("WEBGL_color_buffer_float"); } @@ -9452,7 +9430,7 @@ public void webGL_color_buffer_float() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_compressed_texture_atc() throws Exception { test("WEBGL_compressed_texture_atc"); } @@ -9461,7 +9439,7 @@ public void webGL_compressed_texture_atc() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_compressed_texture_es3() throws Exception { test("WEBGL_compressed_texture_es3"); } @@ -9470,7 +9448,7 @@ public void webGL_compressed_texture_es3() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void wEBGL_compressed_texture_etc() throws Exception { test("WEBGL_compressed_texture_etc"); } @@ -9479,7 +9457,7 @@ public void wEBGL_compressed_texture_etc() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_compressed_texture_etc1() throws Exception { test("WEBGL_compressed_texture_etc1"); } @@ -9488,7 +9466,7 @@ public void webGL_compressed_texture_etc1() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_compressed_texture_pvrtc() throws Exception { test("WEBGL_compressed_texture_pvrtc"); } @@ -9497,7 +9475,7 @@ public void webGL_compressed_texture_pvrtc() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_compressed_texture_s3tc() throws Exception { test("WEBGL_compressed_texture_s3tc"); } @@ -9506,7 +9484,7 @@ public void webGL_compressed_texture_s3tc() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_debug_renderer_info() throws Exception { test("WEBGL_debug_renderer_info"); } @@ -9515,7 +9493,7 @@ public void webGL_debug_renderer_info() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_debug_shaders() throws Exception { test("WEBGL_debug_shaders"); } @@ -9524,7 +9502,7 @@ public void webGL_debug_shaders() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_depth_texture() throws Exception { test("WEBGL_depth_texture"); } @@ -9533,7 +9511,7 @@ public void webGL_depth_texture() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_draw_buffers() throws Exception { test("WEBGL_draw_buffers"); } @@ -9542,7 +9520,7 @@ public void webGL_draw_buffers() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGL_lose_context() throws Exception { test("WEBGL_lose_context"); } @@ -9679,7 +9657,7 @@ public void webGLTexture() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGLTimerQueryEXT() throws Exception { test("WebGLTimerQueryEXT"); } @@ -9715,7 +9693,7 @@ public void webGLVertexArrayObject() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webGLVertexArrayObjectOES() throws Exception { test("WebGLVertexArrayObjectOES"); } @@ -9724,7 +9702,7 @@ public void webGLVertexArrayObjectOES() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webKitAnimationEvent() throws Exception { test("WebKitAnimationEvent"); } @@ -9733,7 +9711,7 @@ public void webKitAnimationEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitAudioContext() throws Exception { test("webkitAudioContext"); } @@ -9751,7 +9729,7 @@ public void webKitCSSMatrix() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBCursor() throws Exception { test("webkitIDBCursor"); } @@ -9760,7 +9738,7 @@ public void webkitIDBCursor() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBDatabase() throws Exception { test("webkitIDBDatabase"); } @@ -9769,7 +9747,7 @@ public void webkitIDBDatabase() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBFactory() throws Exception { test("webkitIDBFactory"); } @@ -9778,7 +9756,7 @@ public void webkitIDBFactory() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBIndex() throws Exception { test("webkitIDBIndex"); } @@ -9787,7 +9765,7 @@ public void webkitIDBIndex() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBKeyRange() throws Exception { test("webkitIDBKeyRange"); } @@ -9796,7 +9774,7 @@ public void webkitIDBKeyRange() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBObjectStore() throws Exception { test("webkitIDBObjectStore"); } @@ -9805,7 +9783,7 @@ public void webkitIDBObjectStore() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBRequest() throws Exception { test("webkitIDBRequest"); } @@ -9814,7 +9792,7 @@ public void webkitIDBRequest() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitIDBTransaction() throws Exception { test("webkitIDBTransaction"); } @@ -9823,7 +9801,7 @@ public void webkitIDBTransaction() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function MediaStream() { [native code] }", EDGE = "function MediaStream() { [native code] }") public void webkitMediaStream() throws Exception { @@ -9834,7 +9812,7 @@ public void webkitMediaStream() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function MutationObserver() { [native code] }", EDGE = "function MutationObserver() { [native code] }") public void webKitMutationObserver() throws Exception { @@ -9845,7 +9823,7 @@ public void webKitMutationObserver() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitOfflineAudioContext() throws Exception { test("webkitOfflineAudioContext"); } @@ -9854,7 +9832,7 @@ public void webkitOfflineAudioContext() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function RTCPeerConnection() { [native code] }", EDGE = "function RTCPeerConnection() { [native code] }") public void webkitRTCPeerConnection() throws Exception { @@ -9865,7 +9843,7 @@ public void webkitRTCPeerConnection() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webkitRTCSessionDescription() throws Exception { test("webkitRTCSessionDescription"); } @@ -9874,7 +9852,7 @@ public void webkitRTCSessionDescription() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function SpeechGrammar() { [native code] }", EDGE = "function SpeechGrammar() { [native code] }") public void webkitSpeechGrammar() throws Exception { @@ -9885,7 +9863,7 @@ public void webkitSpeechGrammar() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function SpeechGrammarList() { [native code] }", EDGE = "function SpeechGrammarList() { [native code] }") public void webkitSpeechGrammarList() throws Exception { @@ -9896,7 +9874,7 @@ public void webkitSpeechGrammarList() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function SpeechRecognition() { [native code] }", EDGE = "function SpeechRecognition() { [native code] }") public void webkitSpeechRecognition() throws Exception { @@ -9907,7 +9885,7 @@ public void webkitSpeechRecognition() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function SpeechRecognitionErrorEvent() { [native code] }", EDGE = "function SpeechRecognitionErrorEvent() { [native code] }") public void webkitSpeechRecognitionError() throws Exception { @@ -9918,7 +9896,7 @@ public void webkitSpeechRecognitionError() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "ReferenceError", CHROME = "function SpeechRecognitionEvent() { [native code] }", EDGE = "function SpeechRecognitionEvent() { [native code] }") public void webkitSpeechRecognitionEvent() throws Exception { @@ -9929,7 +9907,7 @@ public void webkitSpeechRecognitionEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webKitTransitionEvent() throws Exception { test("WebKitTransitionEvent"); } @@ -9947,7 +9925,7 @@ public void webkitURL() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webSMS() throws Exception { test("WebSMS"); } @@ -9967,7 +9945,7 @@ public void webSocket() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webSockets() throws Exception { test("WebSockets"); } @@ -9976,7 +9954,7 @@ public void webSockets() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void webVTT() throws Exception { test("WebVTT"); } @@ -9994,7 +9972,7 @@ public void wheelEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void wifiManager() throws Exception { test("WifiManager"); } @@ -10014,7 +9992,7 @@ public void window() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowBase64() throws Exception { test("WindowBase64"); } @@ -10023,7 +10001,7 @@ public void windowBase64() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowClient() throws Exception { test("WindowClient"); } @@ -10032,7 +10010,7 @@ public void windowClient() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowEventHandlers() throws Exception { test("WindowEventHandlers"); } @@ -10041,7 +10019,7 @@ public void windowEventHandlers() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowEventHandlers_onbeforeprint() throws Exception { test("WindowEventHandlers.onbeforeprint"); } @@ -10050,7 +10028,7 @@ public void windowEventHandlers_onbeforeprint() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowOrWorkerGlobalScope() throws Exception { test("WindowOrWorkerGlobalScope"); } @@ -10059,7 +10037,7 @@ public void windowOrWorkerGlobalScope() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowProperties() throws Exception { test("WindowProperties"); } @@ -10068,7 +10046,7 @@ public void windowProperties() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowTimers() throws Exception { test("WindowTimers"); } @@ -10088,7 +10066,7 @@ public void worker() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void workerGlobalScope() throws Exception { test("WorkerGlobalScope"); } @@ -10097,7 +10075,7 @@ public void workerGlobalScope() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void workerLocation() throws Exception { test("WorkerLocation"); } @@ -10106,7 +10084,7 @@ public void workerLocation() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void workerNavigator() throws Exception { test("WorkerNavigator"); } @@ -10115,7 +10093,7 @@ public void workerNavigator() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xDomainRequest() throws Exception { test("XDomainRequest"); } @@ -10155,7 +10133,7 @@ public void xmlHttpRequestEventTarget() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xmlHttpRequestProgressEvent() throws Exception { test("XMLHttpRequestProgressEvent"); } @@ -10206,7 +10184,7 @@ public void xPathExpression() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xPathNSResolver() throws Exception { test("XPathNSResolver"); } @@ -10226,7 +10204,7 @@ public void xPathResult() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void xsltemplate() throws Exception { test("XSLTemplate"); } diff --git a/src/test/java/org/htmlunit/general/HostConstantsTest.java b/src/test/java/org/htmlunit/general/HostConstantsTest.java index 4de7c7d729f..6f5955e6cca 100644 --- a/src/test/java/org/htmlunit/general/HostConstantsTest.java +++ b/src/test/java/org/htmlunit/general/HostConstantsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ import java.util.Collection; import java.util.Collections; import java.util.Comparator; +import java.util.HashMap; import java.util.List; import java.util.Set; @@ -28,12 +29,9 @@ import org.htmlunit.javascript.configuration.ClassConfiguration; import org.htmlunit.javascript.configuration.ClassConfiguration.ConstantInfo; import org.htmlunit.javascript.configuration.JavaScriptConfiguration; -import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserParameterizedRunner.Default; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized.Parameter; -import org.junit.runners.Parameterized.Parameters; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; /** * Test all {@code constant}s defined in host classes. @@ -41,7 +39,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserParameterizedRunner.class) public class HostConstantsTest extends WebDriverTestCase { /** @@ -49,41 +46,34 @@ public class HostConstantsTest extends WebDriverTestCase { * @return the parameterized data * @throws Exception if an error occurs */ - @Parameters - public static Collection data() throws Exception { - final List list = new ArrayList<>(); - final Set strings = TestCaseTest.getAllConfiguredJsClassNames(); - for (final String host : strings) { + public static Collection data() throws Exception { + final List list = new ArrayList<>(); + final Set classNames = TestCaseTest.getAllConfiguredJsClassNames(); + final ArrayList classNamesSorted = new ArrayList<>(classNames); + Collections.sort(classNamesSorted); + + for (final String host : classNamesSorted) { if (!"Audio".equals(host)) { - list.add(new Object[] {host}); + list.add(Arguments.of(host)); } } return list; } - /** - * The parent element name. - */ - @Parameter - public String host_; + @ParameterizedTest + @MethodSource("data") + void test(final String host) throws Exception { + setExpectedAlerts(getExpectedString(host)); - /** - * The default test. - * @throws Exception if an error occurs - */ - @Test - @Default - public void test() throws Exception { - setExpectedAlerts(getExpectedString()); - - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -114,17 +104,22 @@ public void test() throws Exception { loadPageVerifyTextArea2(html); } - private String[] getExpectedString() throws Exception { - if (host_.endsWith("Array") || "Image".equals(host_) || "Option".equals(host_)) { + private String[] getExpectedString(final String host) throws Exception { + if (host.endsWith("Array") || "Image".equals(host) || "Option".equals(host)) { return new String[0]; } - if ("Error".equals(host_) && getBrowserVersion().hasFeature(JS_ERROR_STACK_TRACE_LIMIT)) { + if ("Error".equals(host) && getBrowserVersion().hasFeature(JS_ERROR_STACK_TRACE_LIMIT)) { return new String[] {"stackTraceLimit:10"}; } final JavaScriptConfiguration javaScriptConfig = JavaScriptConfiguration.getInstance(getBrowserVersion()); + final HashMap classConfigurationIndex = new HashMap<>(); + for (final ClassConfiguration config : javaScriptConfig.getAll()) { + classConfigurationIndex.put(config.getClassName(), config); + } + final List constants = new ArrayList<>(); - ClassConfiguration classConfig = javaScriptConfig.getClassConfiguration(host_); + ClassConfiguration classConfig = classConfigurationIndex.get(host); boolean first = true; while (classConfig != null) { @@ -139,7 +134,7 @@ private String[] getExpectedString() throws Exception { } } } - classConfig = javaScriptConfig.getClassConfiguration(classConfig.getExtendedClassName()); + classConfig = classConfigurationIndex.get(classConfig.getExtendedClassName()); first = false; } diff --git a/src/test/java/org/htmlunit/general/HostConstructorTest.java b/src/test/java/org/htmlunit/general/HostConstructorTest.java index 5236915c625..21990b5c5a7 100644 --- a/src/test/java/org/htmlunit/general/HostConstructorTest.java +++ b/src/test/java/org/htmlunit/general/HostConstructorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,100 +15,67 @@ package org.htmlunit.general; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; -import java.util.HashSet; +import java.util.Collections; import java.util.List; import java.util.Set; import org.htmlunit.TestCaseTest; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserParameterizedRunner.Default; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized.Parameter; -import org.junit.runners.Parameterized.Parameters; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; /** * Test the host class constructors. * * @author Ronald Brill */ -@RunWith(BrowserParameterizedRunner.class) -@Ignore("Work in progress") +@Disabled("Work in progress") public class HostConstructorTest extends WebDriverTestCase { - private static final HashSet PASSING = new HashSet<>(Arrays.asList( - "Animation", - "Blob", - "DOMParser", - "FileReader", - "FormData", - "MediaSource", - "MessageChannel", - "XMLHttpRequest", - "XMLSerializer" - )); - /** * Returns the parameterized data. * @return the parameterized data * @throws Exception if an error occurs */ - @Parameters - public static Collection data() throws Exception { - final List list = new ArrayList<>(); - final Set strings = TestCaseTest.getAllConfiguredJsClassNames(); - for (final String className : strings) { - list.add(new Object[] {className}); + public static Collection data() throws Exception { + final List list = new ArrayList<>(); + final Set classNames = TestCaseTest.getAllConfiguredJsClassNames(); + final ArrayList classNamesSorted = new ArrayList<>(classNames); + Collections.sort(classNamesSorted); + + for (final String className : classNamesSorted) { + list.add(Arguments.of(className)); } return list; } - /** - * The class name. - */ - @Parameter - public String className_; - /** * The default test. * @throws Exception if an error occurs */ - @Test - @Default - public void test() throws Exception { - setExpectedAlerts(getExpectedString(className_)); - - test(className_); - } - - private void test(final String className) throws Exception { - final String html = "\n" + @ParameterizedTest(name = "_{0}") + @MethodSource("data") + @Alerts("TypeError") + void test(final String className) throws Exception { + final String html = DOCTYPE_HTML + + "\n" + "" + "\n" + ""; loadPageVerifyTitle2(html); } - private String getExpectedString(final String className) throws Exception { - if (PASSING.contains(className)) { - return "[object " + className_ + "]"; - } - - return "exception"; - } - /** * {@inheritDoc} */ @@ -117,428 +84,507 @@ protected boolean isWebClientCached() { return true; } - /** - * @throws Exception if the test fails - */ - @Test + @Alerts("[object AbortController]") + void _AbortController() throws Exception { + test("AbortController"); + } + @Alerts("[object Animation]") - public void _Animation() throws Exception { + void _Animation() throws Exception { test("Animation"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("[object HTMLAudioElement]") - public void _Audio() throws Exception { + void _Audio() throws Exception { test("Audio"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("[object AudioContext]") - public void _AudioContext() throws Exception { + void _AudioContext() throws Exception { test("AudioContext"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("[object CSSStyleSheet]") - public void _CSSStyleSheet() throws Exception { - test("CSSStyleSheet"); + @Alerts(DEFAULT = "TypeError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _BatteryManager() throws Exception { + test("BatteryManager"); + } + + @Alerts(DEFAULT = "TypeError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _BeforeInstallPromptEvent() throws Exception { + test("BeforeInstallPromptEvent"); + } + + @Alerts("[object Blob]") + void _Blob() throws Exception { + test("Blob"); + } + + @Alerts(DEFAULT = "ReferenceError", + FF = "TypeError", + FF_ESR = "TypeError") + void _CanvasCaptureMediaStream() throws Exception { + test("CanvasCaptureMediaStream"); + } + + @Alerts(DEFAULT = "TypeError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _CanvasCaptureMediaStreamTrack() throws Exception { + test("CanvasCaptureMediaStreamTrack"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("[object Comment]") - public void _Comment() throws Exception { + void _Comment() throws Exception { test("Comment"); } - /** - * @throws Exception if the test fails - */ - @Test + @Alerts(DEFAULT = "ReferenceError", + FF = "TypeError", + FF_ESR = "TypeError") + void _CSS2Properties() throws Exception { + test("CSS2Properties"); + } + + @Alerts("[object CSSStyleSheet]") + void _CSSStyleSheet() throws Exception { + test("CSSStyleSheet"); + } + + @Alerts("[object DataTransfer]") + void _DataTransfer() throws Exception { + test("DataTransfer"); + } + + @Alerts("[object Document]") + void _Document() throws Exception { + test("Document"); + } + + @Alerts("[object DocumentFragment]") + void _DocumentFragment() throws Exception { + test("DocumentFragment"); + } + + @Alerts(DEFAULT = "TypeError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _DOMError() throws Exception { + test("DOMError"); + } + + @Alerts("Error") + void _DOMException() throws Exception { + test("DOMException"); + } + @Alerts("matrix(1, 0, 0, 1, 0, 0)") - public void _DOMMatrix() throws Exception { + void _DOMMatrix() throws Exception { test("DOMMatrix"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("matrix(1, 0, 0, 1, 0, 0)") - public void _DOMMatrixReadOnly() throws Exception { + void _DOMMatrixReadOnly() throws Exception { test("DOMMatrixReadOnly"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("Error") - public void _DOMException() throws Exception { - test("DOMException"); + @Alerts("[object DOMParser]") + void _DOMParser() throws Exception { + test("DOMParser"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("[object DOMPoint]") - public void _DOMPoint() throws Exception { + void _DOMPoint() throws Exception { test("DOMPoint"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("[object DOMPointReadOnly]") - public void _DOMPointReadOnly() throws Exception { + void _DOMPointReadOnly() throws Exception { test("DOMPointReadOnly"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("[object DOMRect]") - public void _DOMRect() throws Exception { + void _DOMRect() throws Exception { test("DOMRect"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("[object DOMRectReadOnly]") - public void _DOMRectReadOnly() throws Exception { + void _DOMRectReadOnly() throws Exception { test("DOMRectReadOnly"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("[object DataTransfer]") - public void _DataTransfer() throws Exception { - test("DataTransfer"); + @Alerts("[object EventTarget]") + void _EventTarget() throws Exception { + test("EventTarget"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("[object Document]") - public void _Document() throws Exception { - test("Document"); + @Alerts(DEFAULT = "TypeError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _External() throws Exception { + test("External"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("[object DocumentFragment]") - public void _DocumentFragment() throws Exception { - test("DocumentFragment"); + @Alerts(DEFAULT = "TypeError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _FederatedCredential() throws Exception { + test("FederatedCredential"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("exception") - public void _Enumerator() throws Exception { - test("Enumerator"); + @Alerts("[object FileReader]") + void _FileReader() throws Exception { + test("FileReader"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("[object EventTarget]") - public void _EventTarget() throws Exception { - test("EventTarget"); + @Alerts(DEFAULT = "ReferenceError", + FF = "TypeError", + FF_ESR = "TypeError") + void _FileSystem() throws Exception { + test("FileSystem"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("[object Headers]") - public void _Headers() throws Exception { - test("Headers"); + @Alerts(DEFAULT = "ReferenceError", + FF = "TypeError", + FF_ESR = "TypeError") + void _FileSystemDirectoryEntry() throws Exception { + test("FileSystemDirectoryEntry"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("[object HTMLImageElement]") - public void _Image() throws Exception { - test("Image"); + @Alerts(DEFAULT = "ReferenceError", + FF = "TypeError", + FF_ESR = "TypeError") + void _FileSystemDirectoryReader() throws Exception { + test("FileSystemDirectoryReader"); + } + + @Alerts(DEFAULT = "ReferenceError", + FF = "TypeError", + FF_ESR = "TypeError") + void _FileSystemEntry() throws Exception { + test("FileSystemEntry"); + } + + @Alerts(DEFAULT = "ReferenceError", + FF = "TypeError", + FF_ESR = "TypeError") + void _FileSystemFileEntry() throws Exception { + test("FileSystemFileEntry"); + } + + @Alerts(DEFAULT = "ReferenceError", + FF = "TypeError", + FF_ESR = "TypeError") + void _FontFaceSet() throws Exception { + test("FontFaceSet"); + } + + @Alerts("[object FormData]") + void _FormData() throws Exception { + test("FormData"); + } + + @Alerts("[object Headers]") + void _Headers() throws Exception { + test("Headers"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts(DEFAULT = "[object InputDeviceCapabilities]", - FF = "exception", - FF_ESR = "exception") - public void _InputDeviceCapabilities() throws Exception { + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _InputDeviceCapabilities() throws Exception { test("InputDeviceCapabilities"); } - /** - * @throws Exception if the test fails - */ - @Test + @Alerts(DEFAULT = "ReferenceError", + FF = "TypeError", + FF_ESR = "TypeError") + void _MediaKeyError() throws Exception { + test("MediaKeyError"); + } + + @Alerts("[object MediaSource]") + void _MediaSource() throws Exception { + test("MediaSource"); + } + @Alerts("[object MediaStream]") - public void _MediaStream() throws Exception { + void _MediaStream() throws Exception { test("MediaStream"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "exception", - FF = "[object mozRTCPeerConnection]", - FF_ESR = "[object mozRTCPeerConnection]") - public void _mozRTCPeerConnection() throws Exception { - test("mozRTCPeerConnection"); + @Alerts("[object MessageChannel]") + void _MessageChannel() throws Exception { + test("MessageChannel"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("[object HTMLOptionElement]") - public void _Option() throws Exception { - test("Option"); + @Alerts(DEFAULT = "ReferenceError", + FF = "TypeError", + FF_ESR = "TypeError") + void _MouseScrollEvent() throws Exception { + test("MouseScrollEvent"); + } + + @Alerts(DEFAULT = "ReferenceError", + FF_ESR = "TypeError") + void _MutationEvent() throws Exception { + test("MutationEvent"); + } + + @Alerts("ReferenceError") + void _NativeXPathNSResolver() throws Exception { + test("NativeXPathNSResolver"); + } + + @Alerts(DEFAULT = "TypeError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _NetworkInformation() throws Exception { + test("NetworkInformation"); + } + + @Alerts(DEFAULT = "TypeError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _PasswordCredential() throws Exception { + test("PasswordCredential"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("[object Path2D]") - public void _Path2D() throws Exception { + void _Path2D() throws Exception { test("Path2D"); } - /** - * @throws Exception if the test fails - */ - @Test + @Alerts(DEFAULT = "TypeError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _PaymentAddress() throws Exception { + test("PaymentAddress"); + } + + @Alerts(DEFAULT = "TypeError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _PaymentRequest() throws Exception { + test("PaymentRequest"); + } + + @Alerts(DEFAULT = "TypeError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _PaymentResponse() throws Exception { + test("PaymentResponse"); + } + + @Alerts(DEFAULT = "TypeError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _PeriodicSyncManager() throws Exception { + test("PeriodicSyncManager"); + } + + @Alerts(DEFAULT = "TypeError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _Presentation() throws Exception { + test("Presentation"); + } + + @Alerts(DEFAULT = "TypeError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _PresentationAvailability() throws Exception { + test("PresentationAvailability"); + } + + @Alerts(DEFAULT = "TypeError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _PresentationConnection() throws Exception { + test("PresentationConnection"); + } + + @Alerts(DEFAULT = "TypeError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _PresentationConnectionAvailableEvent() throws Exception { + test("PresentationConnectionAvailableEvent"); + } + + @Alerts(DEFAULT = "TypeError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _PresentationConnectionCloseEvent() throws Exception { + test("PresentationConnectionCloseEvent"); + } + + @Alerts(DEFAULT = "TypeError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _PresentationRequest() throws Exception { + test("PresentationRequest"); + } + @Alerts("") - public void _Range() throws Exception { + void _Range() throws Exception { test("Range"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("[object ReadableStream]") - public void _ReadableStream() throws Exception { + void _ReadableStream() throws Exception { test("ReadableStream"); } - /** - * @throws Exception if the test fails - */ - @Test + @Alerts(DEFAULT = "TypeError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _RemotePlayback() throws Exception { + test("RemotePlayback"); + } + @Alerts("[object Response]") - public void _Response() throws Exception { + void _Response() throws Exception { test("Response"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("[object RTCPeerConnection]") - public void _RTCPeerConnection() throws Exception { + void _RTCPeerConnection() throws Exception { test("RTCPeerConnection"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts(DEFAULT = "[object RTCSessionDescription]", - FF = "exception", - FF_ESR = "exception") - public void _RTCSessionDescription() throws Exception { + FF = "TypeError", + FF_ESR = "TypeError") + void _RTCSessionDescription() throws Exception { test("RTCSessionDescription"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("[object SpeechSynthesisUtterance]") - public void _SpeechSynthesisUtterance() throws Exception { + void _SpeechSynthesisUtterance() throws Exception { test("SpeechSynthesisUtterance"); } - /** - * @throws Exception if the test fails - */ - @Test + @Alerts("ReferenceError") + void _StyleMedia() throws Exception { + test("StyleMedia"); + } + + @Alerts(DEFAULT = "TypeError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _SyncManager() throws Exception { + test("SyncManager"); + } + @Alerts("[object Text]") - public void _Text() throws Exception { + void _Text() throws Exception { test("Text"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("[object TextDecoder]") - public void _TextDecoder() throws Exception { + void _TextDecoder() throws Exception { test("TextDecoder"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("[object TextEncoder]") - public void _TextEncoder() throws Exception { + void _TextEncoder() throws Exception { test("TextEncoder"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("") - public void _URLSearchParams() throws Exception { - test("URLSearchParams"); + @Alerts(DEFAULT = "TypeError", + FF_ESR = "ReferenceError") + void _TextEvent() throws Exception { + test("TextEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("exception") - public void _WebGLContextEvent() throws Exception { - test("WebGLContextEvent"); + @Alerts(DEFAULT = "ReferenceError", + FF = "TypeError", + FF_ESR = "TypeError") + void _TimeEvent() throws Exception { + test("TimeEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("matrix(1, 0, 0, 1, 0, 0)") - public void _WebKitCSSMatrix() throws Exception { - test("WebKitCSSMatrix"); + @Alerts(DEFAULT = "TypeError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _Touch() throws Exception { + test("Touch"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "[object MediaStream]", - FF = "exception", - FF_ESR = "exception") - public void _webkitMediaStream() throws Exception { - test("webkitMediaStream"); + @Alerts(DEFAULT = "TypeError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _TouchEvent() throws Exception { + test("TouchEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "[object RTCPeerConnection]", - FF = "exception", - FF_ESR = "exception") - public void _webkitRTCPeerConnection() throws Exception { - test("webkitRTCPeerConnection"); + @Alerts(DEFAULT = "TypeError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _TouchList() throws Exception { + test("TouchList"); + } + + @Alerts("") + void _URLSearchParams() throws Exception { + test("URLSearchParams"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts(DEFAULT = "[object SpeechGrammar]", - FF = "exception", - FF_ESR = "exception") - public void _webkitSpeechGrammar() throws Exception { + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _webkitSpeechGrammar() throws Exception { test("webkitSpeechGrammar"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts(DEFAULT = "[object SpeechGrammarList]", - FF = "exception", - FF_ESR = "exception") - public void _webkitSpeechGrammarList() throws Exception { + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _webkitSpeechGrammarList() throws Exception { test("webkitSpeechGrammarList"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts(DEFAULT = "[object SpeechRecognition]", - FF = "exception", - FF_ESR = "exception") - public void _webkitSpeechRecognition() throws Exception { + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _webkitSpeechRecognition() throws Exception { test("webkitSpeechRecognition"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("[object XPathEvaluator]") - public void _XPathEvaluator() throws Exception { - test("XPathEvaluator"); + @Alerts(DEFAULT = "TypeError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _webkitSpeechRecognitionError() throws Exception { + test("webkitSpeechRecognitionError"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("[object XSLTProcessor]") - public void _XSLTProcessor() throws Exception { - test("XSLTProcessor"); + @Alerts(DEFAULT = "TypeError", + FF = "ReferenceError", + FF_ESR = "ReferenceError") + void _webkitSpeechRecognitionEvent() throws Exception { + test("WebkitSpeechRecognitionEvent"); } - /** - * Test {@link org.htmlunit.javascript.host.abort.AbortController}. - * - * @throws Exception if an error occurs - */ - @Test - @Alerts("[object AbortController]") - public void abortController() throws Exception { - test("AbortController"); + @Alerts("[object XMLHttpRequest]") + void _XMLHttpRequest() throws Exception { + test("XMLHttpRequest"); } - /** - * Test {@link org.htmlunit.javascript.host.abort.AbortSignal}. - * - * @throws Exception if an error occurs - */ - @Test - @Alerts("[object AbortSignal]") - public void abortSignal() throws Exception { - test("AbortSignal"); + @Alerts("[object XMLSerializer]") + void _XMLSerializer() throws Exception { + test("XMLSerializer"); + } + + @Alerts("[object XPathEvaluator]") + void _XPathEvaluator() throws Exception { + test("XPathEvaluator"); + } + + @Alerts("[object XSLTProcessor]") + void _XSLTProcessor() throws Exception { + test("XSLTProcessor"); } } diff --git a/src/test/java/org/htmlunit/general/HostExtractor.java b/src/test/java/org/htmlunit/general/HostExtractor.java index f70969795bf..00402ffb5b8 100644 --- a/src/test/java/org/htmlunit/general/HostExtractor.java +++ b/src/test/java/org/htmlunit/general/HostExtractor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/htmlunit/general/HostTestsTest.java b/src/test/java/org/htmlunit/general/HostTestsTest.java index 05db3bc63fb..73af55d5198 100644 --- a/src/test/java/org/htmlunit/general/HostTestsTest.java +++ b/src/test/java/org/htmlunit/general/HostTestsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package org.htmlunit.general; import static java.nio.charset.StandardCharsets.ISO_8859_1; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.io.File; import java.io.IOException; @@ -27,7 +27,7 @@ import java.util.regex.Pattern; import org.apache.commons.io.FileUtils; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Tests the general host tests have all JavaScript objects names defined in all the other tests. diff --git a/src/test/java/org/htmlunit/general/HostTypeOfTest.java b/src/test/java/org/htmlunit/general/HostTypeOfTest.java index 6a810bc4ddd..5f9f5b52918 100644 --- a/src/test/java/org/htmlunit/general/HostTypeOfTest.java +++ b/src/test/java/org/htmlunit/general/HostTypeOfTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,11 +18,9 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.javascript.host.css.CSSStyleRule; import org.htmlunit.javascript.host.css.CSSStyleSheet; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; +import org.junit.jupiter.api.Test; /** * Tests that {@code typeof} host class is correct. @@ -31,17 +29,16 @@ * @author Ronald Brill * @author cd alexndr */ -@RunWith(BrowserRunner.class) public class HostTypeOfTest extends WebDriverTestCase { private void test(final String className) throws Exception { - final String html = - "\n" + ""; @@ -241,7 +238,7 @@ public void applicationCacheErrorEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void apps_mgmt() throws Exception { test("Apps.mgmt"); } @@ -498,6 +495,15 @@ public void beforeUnloadEvent() throws Exception { test("BeforeUnloadEvent"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("function") + public void bigInt() throws Exception { + test("BigInt"); + } + /** * @throws Exception if the test fails */ @@ -924,26 +930,6 @@ public void client() throws Exception { test("Client"); } - /** - * Test {@link org.htmlunit.javascript.host.ClientRect}. - * - * @throws Exception if an error occurs - */ - @Test - @Alerts("undefined") - public void clientRect() throws Exception { - test("ClientRect"); - } - - /** - * @throws Exception if an error occurs - */ - @Test - @Alerts("undefined") - public void clientRectList() throws Exception { - test("ClientRectList"); - } - /** * @throws Exception if the test fails */ @@ -1900,7 +1886,7 @@ public void domPointReadOnly() throws Exception { } /** - * Test {@link org.htmlunit.javascript.host.ClientRect}. + * Test {@link org.htmlunit.javascript.host.DOMRect}. * * @throws Exception if an error occurs */ @@ -4413,7 +4399,7 @@ public void l10n() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_formatValue() throws Exception { test("L10n.formatValue"); } @@ -4422,7 +4408,7 @@ public void l10n_formatValue() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_get() throws Exception { test("L10n.get"); } @@ -4431,7 +4417,7 @@ public void l10n_get() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_language_code() throws Exception { test("L10n.language.code"); } @@ -4440,7 +4426,7 @@ public void l10n_language_code() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_language_direction() throws Exception { test("L10n.language.direction"); } @@ -4449,7 +4435,7 @@ public void l10n_language_direction() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_once() throws Exception { test("L10n.once"); } @@ -4458,7 +4444,7 @@ public void l10n_once() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_ready() throws Exception { test("L10n.ready"); } @@ -4467,7 +4453,7 @@ public void l10n_ready() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_readyState() throws Exception { test("L10n.readyState"); } @@ -4476,7 +4462,7 @@ public void l10n_readyState() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void l10n_setAttributes() throws Exception { test("L10n.setAttributes"); } @@ -5432,7 +5418,6 @@ public void msStyleCSSProperties() throws Exception { */ @Test @Alerts(DEFAULT = "undefined", - FF = "function", FF_ESR = "function") public void mutationEvent() throws Exception { test("MutationEvent"); @@ -6918,7 +6903,7 @@ public void simd() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool16x8() throws Exception { test("SIMD.Bool16x8"); } @@ -6927,7 +6912,7 @@ public void simd_Bool16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool32x4() throws Exception { test("SIMD.Bool32x4"); } @@ -6936,7 +6921,7 @@ public void simd_Bool32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool64x2() throws Exception { test("SIMD.Bool64x2"); } @@ -6945,7 +6930,7 @@ public void simd_Bool64x2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Bool8x16() throws Exception { test("SIMD.Bool8x16"); } @@ -6954,7 +6939,7 @@ public void simd_Bool8x16() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_float32x4() throws Exception { test("SIMD.float32x4"); } @@ -6963,7 +6948,7 @@ public void simd_float32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Float32x4() throws Exception { test("SIMD.Float32x4"); } @@ -6972,7 +6957,7 @@ public void simd_Float32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_float64x2() throws Exception { test("SIMD.float64x2"); } @@ -6981,7 +6966,7 @@ public void simd_float64x2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Float64x2() throws Exception { test("SIMD.Float64x2"); } @@ -6990,7 +6975,7 @@ public void simd_Float64x2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_int16x8() throws Exception { test("SIMD.int16x8"); } @@ -6999,7 +6984,7 @@ public void simd_int16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Int16x8() throws Exception { test("SIMD.Int16x8"); } @@ -7008,7 +6993,7 @@ public void simd_Int16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_int32x4() throws Exception { test("SIMD.int32x4"); } @@ -7017,7 +7002,7 @@ public void simd_int32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Int32x4() throws Exception { test("SIMD.Int32x4"); } @@ -7026,7 +7011,7 @@ public void simd_Int32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_int8x16() throws Exception { test("SIMD.int8x16"); } @@ -7035,7 +7020,7 @@ public void simd_int8x16() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Int8x16() throws Exception { test("SIMD.Int8x16"); } @@ -7044,7 +7029,7 @@ public void simd_Int8x16() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Uint16x8() throws Exception { test("SIMD.Uint16x8"); } @@ -7053,7 +7038,7 @@ public void simd_Uint16x8() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Uint32x4() throws Exception { test("SIMD.Uint32x4"); } @@ -7062,7 +7047,7 @@ public void simd_Uint32x4() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void simd_Uint8x16() throws Exception { test("SIMD.Uint8x16"); } @@ -10014,7 +9999,7 @@ public void windowEventHandlers() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("ReferenceError") public void windowEventHandlers_onbeforeprint() throws Exception { test("WindowEventHandlers.onbeforeprint"); } diff --git a/src/test/java/org/htmlunit/general/huge/CtorPrototypeTest.java b/src/test/java/org/htmlunit/general/huge/CtorPrototypeTest.java new file mode 100644 index 00000000000..3a799076282 --- /dev/null +++ b/src/test/java/org/htmlunit/general/huge/CtorPrototypeTest.java @@ -0,0 +1,2079 @@ +/* + * Copyright (c) 2002-2025 Gargoyle Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.htmlunit.general.huge; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +import org.htmlunit.TestCaseTest; +import org.htmlunit.WebDriverTestCase; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import org.openqa.selenium.WebDriver; + +/** + * Tests the ctor prototype. + * + * @author Ronald Brill + */ +public class CtorPrototypeTest extends WebDriverTestCase { + + private static int ServerRestartCount_ = 0; + + /** + * Returns the parameterized data. + * @return the parameterized data + * @throws Exception if an error occurs + */ + public static Collection data() throws Exception { + final List jsClassNames = new ArrayList<>(); + jsClassNames.addAll(TestCaseTest.getAllConfiguredJsConstructorNames()); + Collections.sort(jsClassNames); + + final List list = new ArrayList<>(jsClassNames.size() * jsClassNames.size() / 10); + for (final String jsClassName : jsClassNames) { + list.add(Arguments.of(jsClassName)); + } + return list; + } + + /** + * The default test. + * @throws Exception if an error occurs + */ + @ParameterizedTest(name = "_{0}") + @MethodSource("data") + @Alerts("true") + void ctor(final String jsClassName) throws Exception { + test(jsClassName); + } + + /** + * Runs the test. + * + * @param jsClassName the host name + * @throws Exception if an error occurs + */ + protected void test(final String jsClassName) throws Exception { + final String html = DOCTYPE_HTML + + "\n" + + "\n" + + "-\n" + + "\n" + + "\n" + + "\n" + + ""; + + ServerRestartCount_++; + if (ServerRestartCount_ == 200) { + stopWebServers(); + ServerRestartCount_ = 0; + } + + final WebDriver driver = loadPage2(html); + assertTitle(driver, getExpectedAlerts()[0]); + } + + /** + * {@inheritDoc} + */ + @Override + protected boolean isWebClientCached() { + return true; + } + + @Alerts("false") + void _AbortSignal() throws Exception { + test("AbortSignal"); + } + + @Alerts("exception") + void _AbstractList() throws Exception { + test("AbstractList"); + } + + @Alerts("false") + void _AnalyserNode() throws Exception { + test("AnalyserNode"); + } + + @Alerts("false") + void _Animation() throws Exception { + test("Animation"); + } + + @Alerts("false") + void _AnimationEvent() throws Exception { + test("AnimationEvent"); + } + + @Alerts("false") + void _Atomics() throws Exception { + test("Atomics"); + } + + @Alerts("false") + void _Attr() throws Exception { + test("Attr"); + } + + @Alerts("true") + @HtmlUnitNYI(CHROME = "false", + EDGE = "false", + FF = "false", + FF_ESR = "false") + void _Audio() throws Exception { + test("Audio"); + } + + @Alerts("false") + void _AudioBufferSourceNode() throws Exception { + test("AudioBufferSourceNode"); + } + + @Alerts("false") + void _AudioContext() throws Exception { + test("AudioContext"); + } + + @Alerts("false") + void _AudioDestinationNode() throws Exception { + test("AudioDestinationNode"); + } + + @Alerts("false") + void _AudioNode() throws Exception { + test("AudioNode"); + } + + @Alerts("false") + void _AudioProcessingEvent() throws Exception { + test("AudioProcessingEvent"); + } + + @Alerts("false") + void _AudioScheduledSourceNode() throws Exception { + test("AudioScheduledSourceNode"); + } + + @Alerts("false") + void _BaseAudioContext() throws Exception { + test("BaseAudioContext"); + } + + @Alerts(DEFAULT = "false", + FF = "exception", + FF_ESR = "exception") + void _BatteryManager() throws Exception { + test("BatteryManager"); + } + + @Alerts(DEFAULT = "false", + FF = "exception", + FF_ESR = "exception") + void _BeforeInstallPromptEvent() throws Exception { + test("BeforeInstallPromptEvent"); + } + + @Alerts("false") + void _BeforeUnloadEvent() throws Exception { + test("BeforeUnloadEvent"); + } + + @Alerts("false") + void _BiquadFilterNode() throws Exception { + test("BiquadFilterNode"); + } + + @Alerts("false") + void _BlobEvent() throws Exception { + test("BlobEvent"); + } + + @Alerts("false") + void _BroadcastChannel() throws Exception { + test("BroadcastChannel"); + } + + @Alerts("false") + void _CDATASection() throws Exception { + test("CDATASection"); + } + + @Alerts("false") + void _CSS() throws Exception { + test("CSS"); + } + + @Alerts(DEFAULT = "exception", + FF = "false", + FF_ESR = "false") + void _CSS2Properties() throws Exception { + test("CSS2Properties"); + } + + @Alerts("false") + void _CSSConditionRule() throws Exception { + test("CSSConditionRule"); + } + + @Alerts("false") + void _CSSCounterStyleRule() throws Exception { + test("CSSCounterStyleRule"); + } + + @Alerts("false") + void _CSSFontFaceRule() throws Exception { + test("CSSFontFaceRule"); + } + + @Alerts("false") + void _CSSGroupingRule() throws Exception { + test("CSSGroupingRule"); + } + + @Alerts("false") + void _CSSImportRule() throws Exception { + test("CSSImportRule"); + } + + @Alerts("false") + void _CSSKeyframeRule() throws Exception { + test("CSSKeyframeRule"); + } + + @Alerts("false") + void _CSSKeyframesRule() throws Exception { + test("CSSKeyframesRule"); + } + + @Alerts("false") + void _CSSMediaRule() throws Exception { + test("CSSMediaRule"); + } + + @Alerts("false") + void _CSSNamespaceRule() throws Exception { + test("CSSNamespaceRule"); + } + + @Alerts("false") + void _CSSPageRule() throws Exception { + test("CSSPageRule"); + } + + @Alerts("false") + void _CSSStyleRule() throws Exception { + test("CSSStyleRule"); + } + + @Alerts("false") + void _CSSStyleSheet() throws Exception { + test("CSSStyleSheet"); + } + + @Alerts("false") + void _CSSSupportsRule() throws Exception { + test("CSSSupportsRule"); + } + + @Alerts(DEFAULT = "exception", + FF = "false", + FF_ESR = "false") + void _CanvasCaptureMediaStream() throws Exception { + test("CanvasCaptureMediaStream"); + } + + @Alerts(DEFAULT = "false", + FF = "exception", + FF_ESR = "exception") + void _CanvasCaptureMediaStreamTrack() throws Exception { + test("CanvasCaptureMediaStreamTrack"); + } + + @Alerts("false") + void _ChannelMergerNode() throws Exception { + test("ChannelMergerNode"); + } + + @Alerts("false") + void _ChannelSplitterNode() throws Exception { + test("ChannelSplitterNode"); + } + + @Alerts("false") + void _CharacterData() throws Exception { + test("CharacterData"); + } + + @Alerts("false") + void _ClipboardEvent() throws Exception { + test("ClipboardEvent"); + } + + @Alerts("false") + void _CloseEvent() throws Exception { + test("CloseEvent"); + } + + @Alerts("false") + void _Comment() throws Exception { + test("Comment"); + } + + @Alerts("false") + void _CompositionEvent() throws Exception { + test("CompositionEvent"); + } + + @Alerts("false") + void _ConstantSourceNode() throws Exception { + test("ConstantSourceNode"); + } + + @Alerts("false") + void _ConvolverNode() throws Exception { + test("ConvolverNode"); + } + + @Alerts("false") + void _CustomEvent() throws Exception { + test("CustomEvent"); + } + + @Alerts(DEFAULT = "true", + FF = "exception", + FF_ESR = "exception") + void _DOMError() throws Exception { + test("DOMError"); + } + + @Alerts("false") + void _DOMMatrix() throws Exception { + test("DOMMatrix"); + } + + @Alerts("false") + void _DOMPoint() throws Exception { + test("DOMPoint"); + } + + @Alerts("false") + void _DOMRect() throws Exception { + test("DOMRect"); + } + + @Alerts("false") + void _DelayNode() throws Exception { + test("DelayNode"); + } + + @Alerts("false") + void _DeviceMotionEvent() throws Exception { + test("DeviceMotionEvent"); + } + + @Alerts("false") + void _DeviceOrientationEvent() throws Exception { + test("DeviceOrientationEvent"); + } + + @Alerts("false") + void _Document() throws Exception { + test("Document"); + } + + @Alerts("false") + void _DocumentFragment() throws Exception { + test("DocumentFragment"); + } + + @Alerts("false") + void _DocumentType() throws Exception { + test("DocumentType"); + } + + @Alerts("false") + void _DragEvent() throws Exception { + test("DragEvent"); + } + + @Alerts("false") + void _DynamicsCompressorNode() throws Exception { + test("DynamicsCompressorNode"); + } + + @Alerts("false") + void _Element() throws Exception { + test("Element"); + } + + @Alerts("false") + void _ErrorEvent() throws Exception { + test("ErrorEvent"); + } + + @Alerts(DEFAULT = "true", + FF = "exception", + FF_ESR = "exception") + void _External() throws Exception { + test("External"); + } + + @Alerts("false") + void _EventSource() throws Exception { + test("EventSource"); + } + + @Alerts(DEFAULT = "false", + FF = "exception", + FF_ESR = "exception") + void _FederatedCredential() throws Exception { + test("FederatedCredential"); + } + + @Alerts("false") + void _File() throws Exception { + test("File"); + } + + @Alerts("false") + void _FileReader() throws Exception { + test("FileReader"); + } + + @Alerts(DEFAULT = "exception", + FF = "true", + FF_ESR = "true") + void _FileSystem() throws Exception { + test("FileSystem"); + } + + @Alerts(DEFAULT = "exception", + FF = "false", + FF_ESR = "false") + void _FileSystemDirectoryEntry() throws Exception { + test("FileSystemDirectoryEntry"); + } + + @Alerts(DEFAULT = "exception", + FF = "true", + FF_ESR = "true") + void _FileSystemDirectoryReader() throws Exception { + test("FileSystemDirectoryReader"); + } + + @Alerts(DEFAULT = "exception", + FF = "true", + FF_ESR = "true") + void _FileSystemEntry() throws Exception { + test("FileSystemEntry"); + } + + @Alerts(DEFAULT = "exception", + FF = "false", + FF_ESR = "false") + void _FileSystemFileEntry() throws Exception { + test("FileSystemFileEntry"); + } + + @Alerts("false") + void _FocusEvent() throws Exception { + test("FocusEvent"); + } + + @Alerts(DEFAULT = "exception", + FF = "false", + FF_ESR = "false") + void _FontFaceSet() throws Exception { + test("FontFaceSet"); + } + + @Alerts("false") + void _GainNode() throws Exception { + test("GainNode"); + } + + @Alerts("false") + void _GamepadEvent() throws Exception { + test("GamepadEvent"); + } + + @Alerts("false") + void _HTMLAnchorElement() throws Exception { + test("HTMLAnchorElement"); + } + + @Alerts("false") + void _HTMLAreaElement() throws Exception { + test("HTMLAreaElement"); + } + + @Alerts("false") + void _HTMLAudioElement() throws Exception { + test("HTMLAudioElement"); + } + + @Alerts("false") + void _HTMLBRElement() throws Exception { + test("HTMLBRElement"); + } + + @Alerts("false") + void _HTMLBaseElement() throws Exception { + test("HTMLBaseElement"); + } + + @Alerts("false") + void _HTMLBodyElement() throws Exception { + test("HTMLBodyElement"); + } + + @Alerts("false") + void _HTMLButtonElement() throws Exception { + test("HTMLButtonElement"); + } + + @Alerts("false") + void _HTMLCanvasElement() throws Exception { + test("HTMLCanvasElement"); + } + + @Alerts("false") + void _HTMLDListElement() throws Exception { + test("HTMLDListElement"); + } + + @Alerts("false") + void _HTMLDataElement() throws Exception { + test("HTMLDataElement"); + } + + @Alerts("false") + void _HTMLDataListElement() throws Exception { + test("HTMLDataListElement"); + } + + @Alerts("false") + void _HTMLDetailsElement() throws Exception { + test("HTMLDetailsElement"); + } + + @Alerts("false") + void _HTMLDialogElement() throws Exception { + test("HTMLDialogElement"); + } + + @Alerts("false") + void _HTMLDirectoryElement() throws Exception { + test("HTMLDirectoryElement"); + } + + @Alerts("false") + void _HTMLDivElement() throws Exception { + test("HTMLDivElement"); + } + + @Alerts("false") + void _HTMLDocument() throws Exception { + test("HTMLDocument"); + } + + @Alerts("false") + void _HTMLElement() throws Exception { + test("HTMLElement"); + } + + @Alerts("false") + void _HTMLEmbedElement() throws Exception { + test("HTMLEmbedElement"); + } + + @Alerts("false") + void _HTMLFieldSetElement() throws Exception { + test("HTMLFieldSetElement"); + } + + @Alerts("false") + void _HTMLFontElement() throws Exception { + test("HTMLFontElement"); + } + + @Alerts("false") + void _HTMLFormControlsCollection() throws Exception { + test("HTMLFormControlsCollection"); + } + + @Alerts("false") + void _HTMLFormElement() throws Exception { + test("HTMLFormElement"); + } + + @Alerts("false") + void _HTMLFrameElement() throws Exception { + test("HTMLFrameElement"); + } + + @Alerts("false") + void _HTMLFrameSetElement() throws Exception { + test("HTMLFrameSetElement"); + } + + @Alerts("false") + void _HTMLHRElement() throws Exception { + test("HTMLHRElement"); + } + + @Alerts("false") + void _HTMLHeadElement() throws Exception { + test("HTMLHeadElement"); + } + + @Alerts("false") + void _HTMLHeadingElement() throws Exception { + test("HTMLHeadingElement"); + } + + @Alerts("false") + void _HTMLHtmlElement() throws Exception { + test("HTMLHtmlElement"); + } + + @Alerts("false") + void _HTMLIFrameElement() throws Exception { + test("HTMLIFrameElement"); + } + + @Alerts("false") + void _HTMLImageElement() throws Exception { + test("HTMLImageElement"); + } + + @Alerts("false") + void _HTMLInputElement() throws Exception { + test("HTMLInputElement"); + } + + @Alerts("false") + void _HTMLLIElement() throws Exception { + test("HTMLLIElement"); + } + + @Alerts("false") + void _HTMLLabelElement() throws Exception { + test("HTMLLabelElement"); + } + + @Alerts("false") + void _HTMLLegendElement() throws Exception { + test("HTMLLegendElement"); + } + + @Alerts("false") + void _HTMLLinkElement() throws Exception { + test("HTMLLinkElement"); + } + + @Alerts("exception") + void _HTMLListElement() throws Exception { + test("HTMLListElement"); + } + + @Alerts("false") + void _HTMLMapElement() throws Exception { + test("HTMLMapElement"); + } + + @Alerts("false") + void _HTMLMarqueeElement() throws Exception { + test("HTMLMarqueeElement"); + } + + @Alerts("false") + void _HTMLMediaElement() throws Exception { + test("HTMLMediaElement"); + } + + @Alerts("false") + void _HTMLMenuElement() throws Exception { + test("HTMLMenuElement"); + } + + @Alerts("false") + void _HTMLMetaElement() throws Exception { + test("HTMLMetaElement"); + } + + @Alerts("false") + void _HTMLMeterElement() throws Exception { + test("HTMLMeterElement"); + } + + @Alerts("false") + void _HTMLModElement() throws Exception { + test("HTMLModElement"); + } + + @Alerts("false") + void _HTMLOListElement() throws Exception { + test("HTMLOListElement"); + } + + @Alerts("false") + void _HTMLObjectElement() throws Exception { + test("HTMLObjectElement"); + } + + @Alerts("false") + void _HTMLOptGroupElement() throws Exception { + test("HTMLOptGroupElement"); + } + + @Alerts("false") + void _HTMLOptionElement() throws Exception { + test("HTMLOptionElement"); + } + + @Alerts("false") + @HtmlUnitNYI(CHROME = "true", + EDGE = "true", + FF = "true", + FF_ESR = "true") + void _HTMLOptionsCollection() throws Exception { + test("HTMLOptionsCollection"); + } + + @Alerts("false") + void _HTMLOutputElement() throws Exception { + test("HTMLOutputElement"); + } + + @Alerts("false") + void _HTMLParagraphElement() throws Exception { + test("HTMLParagraphElement"); + } + + @Alerts("false") + void _HTMLParamElement() throws Exception { + test("HTMLParamElement"); + } + + @Alerts("false") + void _HTMLPictureElement() throws Exception { + test("HTMLPictureElement"); + } + + @Alerts("false") + void _HTMLPreElement() throws Exception { + test("HTMLPreElement"); + } + + @Alerts("false") + void _HTMLProgressElement() throws Exception { + test("HTMLProgressElement"); + } + + @Alerts("false") + void _HTMLQuoteElement() throws Exception { + test("HTMLQuoteElement"); + } + + @Alerts("false") + void _HTMLScriptElement() throws Exception { + test("HTMLScriptElement"); + } + + @Alerts("false") + void _HTMLSelectElement() throws Exception { + test("HTMLSelectElement"); + } + + @Alerts("false") + void _HTMLSlotElement() throws Exception { + test("HTMLSlotElement"); + } + + @Alerts("false") + void _HTMLSourceElement() throws Exception { + test("HTMLSourceElement"); + } + + @Alerts("false") + void _HTMLSpanElement() throws Exception { + test("HTMLSpanElement"); + } + + @Alerts("false") + void _HTMLStyleElement() throws Exception { + test("HTMLStyleElement"); + } + + @Alerts("false") + void _HTMLTableCaptionElement() throws Exception { + test("HTMLTableCaptionElement"); + } + + @Alerts("false") + void _HTMLTableCellElement() throws Exception { + test("HTMLTableCellElement"); + } + + @Alerts("false") + void _HTMLTableColElement() throws Exception { + test("HTMLTableColElement"); + } + + @Alerts("exception") + void _HTMLTableComponent() throws Exception { + test("HTMLTableComponent"); + } + + @Alerts("false") + void _HTMLTableElement() throws Exception { + test("HTMLTableElement"); + } + + @Alerts("false") + void _HTMLTableRowElement() throws Exception { + test("HTMLTableRowElement"); + } + + @Alerts("false") + void _HTMLTableSectionElement() throws Exception { + test("HTMLTableSectionElement"); + } + + @Alerts("false") + void _HTMLTemplateElement() throws Exception { + test("HTMLTemplateElement"); + } + + @Alerts("false") + void _HTMLTextAreaElement() throws Exception { + test("HTMLTextAreaElement"); + } + + @Alerts("false") + void _HTMLTimeElement() throws Exception { + test("HTMLTimeElement"); + } + + @Alerts("false") + void _HTMLTitleElement() throws Exception { + test("HTMLTitleElement"); + } + + @Alerts("false") + void _HTMLTrackElement() throws Exception { + test("HTMLTrackElement"); + } + + @Alerts("false") + void _HTMLUListElement() throws Exception { + test("HTMLUListElement"); + } + + @Alerts("false") + void _HTMLUnknownElement() throws Exception { + test("HTMLUnknownElement"); + } + + @Alerts("false") + void _HTMLVideoElement() throws Exception { + test("HTMLVideoElement"); + } + + @Alerts("false") + void _HashChangeEvent() throws Exception { + test("HashChangeEvent"); + } + + @Alerts("false") + void _IDBCursorWithValue() throws Exception { + test("IDBCursorWithValue"); + } + + @Alerts("false") + void _IDBDatabase() throws Exception { + test("IDBDatabase"); + } + + @Alerts("false") + void _IDBOpenDBRequest() throws Exception { + test("IDBOpenDBRequest"); + } + + @Alerts("false") + void _IDBRequest() throws Exception { + test("IDBRequest"); + } + + @Alerts("false") + void _IDBTransaction() throws Exception { + test("IDBTransaction"); + } + + @Alerts("false") + void _IDBVersionChangeEvent() throws Exception { + test("IDBVersionChangeEvent"); + } + + @Alerts("false") + void _IIRFilterNode() throws Exception { + test("IIRFilterNode"); + } + + @Alerts(DEFAULT = "true", + FF = "exception", + FF_ESR = "exception") + void _InputDeviceCapabilities() throws Exception { + test("InputDeviceCapabilities"); + } + + @Alerts("false") + void _InputEvent() throws Exception { + test("InputEvent"); + } + + @Alerts("false") + void _KeyboardEvent() throws Exception { + test("KeyboardEvent"); + } + + @Alerts("false") + @HtmlUnitNYI(CHROME = "true", + EDGE = "true", + FF = "true", + FF_ESR = "true") + void _KeyframeEffect() throws Exception { + test("KeyframeEffect"); + } + + @Alerts("false") + void _MIDIAccess() throws Exception { + test("MIDIAccess"); + } + + @Alerts("false") + void _MIDIConnectionEvent() throws Exception { + test("MIDIConnectionEvent"); + } + + @Alerts("false") + void _MIDIInput() throws Exception { + test("MIDIInput"); + } + + @Alerts("false") + void _MIDIMessageEvent() throws Exception { + test("MIDIMessageEvent"); + } + + @Alerts("false") + void _MIDIOutput() throws Exception { + test("MIDIOutput"); + } + + @Alerts("false") + void _MIDIPort() throws Exception { + test("MIDIPort"); + } + + @Alerts("false") + void _MediaDevices() throws Exception { + test("MediaDevices"); + } + + @Alerts("false") + void _MediaElementAudioSourceNode() throws Exception { + test("MediaElementAudioSourceNode"); + } + + @Alerts("false") + void _MediaEncryptedEvent() throws Exception { + test("MediaEncryptedEvent"); + } + + @Alerts(DEFAULT = "exception", + FF = "false", + FF_ESR = "false") + void _MediaKeyError() throws Exception { + test("MediaKeyError"); + } + + @Alerts("false") + void _MediaKeyMessageEvent() throws Exception { + test("MediaKeyMessageEvent"); + } + + @Alerts("false") + void _MediaKeySession() throws Exception { + test("MediaKeySession"); + } + + @Alerts("false") + void _MediaQueryList() throws Exception { + test("MediaQueryList"); + } + + @Alerts("false") + void _MediaQueryListEvent() throws Exception { + test("MediaQueryListEvent"); + } + + @Alerts("false") + void _MediaRecorder() throws Exception { + test("MediaRecorder"); + } + + @Alerts("false") + void _MediaSource() throws Exception { + test("MediaSource"); + } + + @Alerts("false") + void _MediaStream() throws Exception { + test("MediaStream"); + } + + @Alerts("false") + void _MediaStreamAudioDestinationNode() throws Exception { + test("MediaStreamAudioDestinationNode"); + } + + @Alerts("false") + void _MediaStreamAudioSourceNode() throws Exception { + test("MediaStreamAudioSourceNode"); + } + + @Alerts("false") + void _MediaStreamEvent() throws Exception { + test("MediaStreamEvent"); + } + + @Alerts("false") + void _MediaStreamTrack() throws Exception { + test("MediaStreamTrack"); + } + + @Alerts("false") + void _MediaStreamTrackEvent() throws Exception { + test("MediaStreamTrackEvent"); + } + + @Alerts("false") + void _MessageEvent() throws Exception { + test("MessageEvent"); + } + + @Alerts("false") + void _MessagePort() throws Exception { + test("MessagePort"); + } + + @Alerts("false") + void _MouseEvent() throws Exception { + test("MouseEvent"); + } + + @Alerts(DEFAULT = "exception", + FF = "false", + FF_ESR = "false") + void _MouseScrollEvent() throws Exception { + test("MouseScrollEvent"); + } + + @Alerts(DEFAULT = "exception", + FF_ESR = "false") + void _MutationEvent() throws Exception { + test("MutationEvent"); + } + + @Alerts("exception") + void _NativeXPathNSResolver() throws Exception { + test("NativeXPathNSResolver"); + } + + @Alerts(DEFAULT = "false", + FF = "exception", + FF_ESR = "exception") + void _NetworkInformation() throws Exception { + test("NetworkInformation"); + } + + @Alerts("false") + void _Node() throws Exception { + test("Node"); + } + + @Alerts("false") + void _Notification() throws Exception { + test("Notification"); + } + + @Alerts("false") + void _OfflineAudioCompletionEvent() throws Exception { + test("OfflineAudioCompletionEvent"); + } + + @Alerts("false") + void _OfflineAudioContext() throws Exception { + test("OfflineAudioContext"); + } + + @Alerts("false") + void _OscillatorNode() throws Exception { + test("OscillatorNode"); + } + + @Alerts("false") + void _PageTransitionEvent() throws Exception { + test("PageTransitionEvent"); + } + + @Alerts("false") + void _PannerNode() throws Exception { + test("PannerNode"); + } + + @Alerts(DEFAULT = "false", + FF = "exception", + FF_ESR = "exception") + void _PasswordCredential() throws Exception { + test("PasswordCredential"); + } + + @Alerts(DEFAULT = "true", + FF = "exception", + FF_ESR = "exception") + void _PaymentAddress() throws Exception { + test("PaymentAddress"); + } + + @Alerts(DEFAULT = "false", + FF = "exception", + FF_ESR = "exception") + void _PaymentRequest() throws Exception { + test("PaymentRequest"); + } + + @Alerts(DEFAULT = "false", + FF = "exception", + FF_ESR = "exception") + void _PaymentResponse() throws Exception { + test("PaymentResponse"); + } + + @Alerts("false") + void _Performance() throws Exception { + test("Performance"); + } + + @Alerts("false") + void _PerformanceMark() throws Exception { + test("PerformanceMark"); + } + + @Alerts("false") + void _PerformanceMeasure() throws Exception { + test("PerformanceMeasure"); + } + + @Alerts("false") + void _PerformanceNavigationTiming() throws Exception { + test("PerformanceNavigationTiming"); + } + + @Alerts("false") + void _PerformanceResourceTiming() throws Exception { + test("PerformanceResourceTiming"); + } + + @Alerts(DEFAULT = "true", + FF = "exception", + FF_ESR = "exception") + void _PeriodicSyncManager() throws Exception { + test("PeriodicSyncManager"); + } + + @Alerts("false") + void _PermissionStatus() throws Exception { + test("PermissionStatus"); + } + + @Alerts("false") + void _PointerEvent() throws Exception { + test("PointerEvent"); + } + + @Alerts("false") + void _PopStateEvent() throws Exception { + test("PopStateEvent"); + } + + @Alerts(DEFAULT = "true", + FF = "exception", + FF_ESR = "exception") + void _Presentation() throws Exception { + test("Presentation"); + } + + @Alerts(DEFAULT = "false", + FF = "exception", + FF_ESR = "exception") + void _PresentationAvailability() throws Exception { + test("PresentationAvailability"); + } + + @Alerts(DEFAULT = "false", + FF = "exception", + FF_ESR = "exception") + void _PresentationConnection() throws Exception { + test("PresentationConnection"); + } + + @Alerts(DEFAULT = "false", + FF = "exception", + FF_ESR = "exception") + void _PresentationConnectionAvailableEvent() throws Exception { + test("PresentationConnectionAvailableEvent"); + } + + @Alerts(DEFAULT = "false", + FF = "exception", + FF_ESR = "exception") + void _PresentationConnectionCloseEvent() throws Exception { + test("PresentationConnectionCloseEvent"); + } + + @Alerts(DEFAULT = "false", + FF = "exception", + FF_ESR = "exception") + void _PresentationRequest() throws Exception { + test("PresentationRequest"); + } + + @Alerts("false") + void _ProcessingInstruction() throws Exception { + test("ProcessingInstruction"); + } + + @Alerts("false") + void _ProgressEvent() throws Exception { + test("ProgressEvent"); + } + + @Alerts("false") + void _PromiseRejectionEvent() throws Exception { + test("PromiseRejectionEvent"); + } + + @Alerts("false") + void _RTCDataChannelEvent() throws Exception { + test("RTCDataChannelEvent"); + } + + @Alerts("false") + void _RTCPeerConnection() throws Exception { + test("RTCPeerConnection"); + } + + @Alerts("false") + void _RTCPeerConnectionIceEvent() throws Exception { + test("RTCPeerConnectionIceEvent"); + } + + @Alerts("false") + void _RTCSctpTransport() throws Exception { + test("RTCSctpTransport"); + } + + @Alerts("false") + void _RadioNodeList() throws Exception { + test("RadioNodeList"); + } + + @Alerts("false") + void _Range() throws Exception { + test("Range"); + } + + @Alerts(DEFAULT = "false", + FF = "exception", + FF_ESR = "exception") + void _RemotePlayback() throws Exception { + test("RemotePlayback"); + } + + @Alerts("exception") + void _RowContainer() throws Exception { + test("RowContainer"); + } + + @Alerts("false") + void _SVGAElement() throws Exception { + test("SVGAElement"); + } + + @Alerts("false") + void _SVGAnimateElement() throws Exception { + test("SVGAnimateElement"); + } + + @Alerts("false") + void _SVGAnimateMotionElement() throws Exception { + test("SVGAnimateMotionElement"); + } + + @Alerts("false") + void _SVGAnimateTransformElement() throws Exception { + test("SVGAnimateTransformElement"); + } + + @Alerts("false") + void _SVGAnimationElement() throws Exception { + test("SVGAnimationElement"); + } + + @Alerts("false") + void _SVGCircleElement() throws Exception { + test("SVGCircleElement"); + } + + @Alerts("false") + void _SVGClipPathElement() throws Exception { + test("SVGClipPathElement"); + } + + @Alerts("false") + void _SVGComponentTransferFunctionElement() throws Exception { + test("SVGComponentTransferFunctionElement"); + } + + @Alerts("false") + void _SVGDefsElement() throws Exception { + test("SVGDefsElement"); + } + + @Alerts("false") + void _SVGDescElement() throws Exception { + test("SVGDescElement"); + } + + @Alerts("exception") + void _SVGDiscardElement() throws Exception { + test("SVGDiscardElement"); + } + + @Alerts("false") + void _SVGElement() throws Exception { + test("SVGElement"); + } + + @Alerts("false") + void _SVGEllipseElement() throws Exception { + test("SVGEllipseElement"); + } + + @Alerts("false") + void _SVGFEBlendElement() throws Exception { + test("SVGFEBlendElement"); + } + + @Alerts("false") + void _SVGFEColorMatrixElement() throws Exception { + test("SVGFEColorMatrixElement"); + } + + @Alerts("false") + void _SVGFEComponentTransferElement() throws Exception { + test("SVGFEComponentTransferElement"); + } + + @Alerts("false") + void _SVGFECompositeElement() throws Exception { + test("SVGFECompositeElement"); + } + + @Alerts("false") + void _SVGFEConvolveMatrixElement() throws Exception { + test("SVGFEConvolveMatrixElement"); + } + + @Alerts("false") + void _SVGFEDiffuseLightingElement() throws Exception { + test("SVGFEDiffuseLightingElement"); + } + + @Alerts("false") + void _SVGFEDisplacementMapElement() throws Exception { + test("SVGFEDisplacementMapElement"); + } + + @Alerts("false") + void _SVGFEDistantLightElement() throws Exception { + test("SVGFEDistantLightElement"); + } + + @Alerts("false") + void _SVGFEDropShadowElement() throws Exception { + test("SVGFEDropShadowElement"); + } + + @Alerts("false") + void _SVGFEFloodElement() throws Exception { + test("SVGFEFloodElement"); + } + + @Alerts("false") + void _SVGFEFuncAElement() throws Exception { + test("SVGFEFuncAElement"); + } + + @Alerts("false") + void _SVGFEFuncBElement() throws Exception { + test("SVGFEFuncBElement"); + } + + @Alerts("false") + void _SVGFEFuncGElement() throws Exception { + test("SVGFEFuncGElement"); + } + + @Alerts("false") + void _SVGFEFuncRElement() throws Exception { + test("SVGFEFuncRElement"); + } + + @Alerts("false") + void _SVGFEGaussianBlurElement() throws Exception { + test("SVGFEGaussianBlurElement"); + } + + @Alerts("false") + void _SVGFEImageElement() throws Exception { + test("SVGFEImageElement"); + } + + @Alerts("false") + void _SVGFEMergeElement() throws Exception { + test("SVGFEMergeElement"); + } + + @Alerts("false") + void _SVGFEMergeNodeElement() throws Exception { + test("SVGFEMergeNodeElement"); + } + + @Alerts("false") + void _SVGFEMorphologyElement() throws Exception { + test("SVGFEMorphologyElement"); + } + + @Alerts("false") + void _SVGFEOffsetElement() throws Exception { + test("SVGFEOffsetElement"); + } + + @Alerts("false") + void _SVGFEPointLightElement() throws Exception { + test("SVGFEPointLightElement"); + } + + @Alerts("false") + void _SVGFESpecularLightingElement() throws Exception { + test("SVGFESpecularLightingElement"); + } + + @Alerts("false") + void _SVGFESpotLightElement() throws Exception { + test("SVGFESpotLightElement"); + } + + @Alerts("false") + void _SVGFETileElement() throws Exception { + test("SVGFETileElement"); + } + + @Alerts("false") + void _SVGFETurbulenceElement() throws Exception { + test("SVGFETurbulenceElement"); + } + + @Alerts("false") + void _SVGFilterElement() throws Exception { + test("SVGFilterElement"); + } + + @Alerts("false") + void _SVGForeignObjectElement() throws Exception { + test("SVGForeignObjectElement"); + } + + @Alerts("false") + void _SVGGElement() throws Exception { + test("SVGGElement"); + } + + @Alerts("false") + void _SVGGeometryElement() throws Exception { + test("SVGGeometryElement"); + } + + @Alerts("false") + void _SVGGradientElement() throws Exception { + test("SVGGradientElement"); + } + + @Alerts("false") + void _SVGGraphicsElement() throws Exception { + test("SVGGraphicsElement"); + } + + @Alerts("false") + void _SVGImageElement() throws Exception { + test("SVGImageElement"); + } + + @Alerts("false") + void _SVGLineElement() throws Exception { + test("SVGLineElement"); + } + + @Alerts("false") + void _SVGLinearGradientElement() throws Exception { + test("SVGLinearGradientElement"); + } + + @Alerts("false") + void _SVGMPathElement() throws Exception { + test("SVGMPathElement"); + } + + @Alerts("false") + void _SVGMarkerElement() throws Exception { + test("SVGMarkerElement"); + } + + @Alerts("false") + void _SVGMaskElement() throws Exception { + test("SVGMaskElement"); + } + + @Alerts("false") + void _SVGMetadataElement() throws Exception { + test("SVGMetadataElement"); + } + + @Alerts("false") + void _SVGPathElement() throws Exception { + test("SVGPathElement"); + } + + @Alerts("false") + void _SVGPatternElement() throws Exception { + test("SVGPatternElement"); + } + + @Alerts("false") + void _SVGPolygonElement() throws Exception { + test("SVGPolygonElement"); + } + + @Alerts("false") + void _SVGPolylineElement() throws Exception { + test("SVGPolylineElement"); + } + + @Alerts("false") + void _SVGRadialGradientElement() throws Exception { + test("SVGRadialGradientElement"); + } + + @Alerts("false") + void _SVGRectElement() throws Exception { + test("SVGRectElement"); + } + + @Alerts("false") + void _SVGSVGElement() throws Exception { + test("SVGSVGElement"); + } + + @Alerts("false") + void _SVGScriptElement() throws Exception { + test("SVGScriptElement"); + } + + @Alerts("false") + void _SVGSetElement() throws Exception { + test("SVGSetElement"); + } + + @Alerts("false") + void _SVGStopElement() throws Exception { + test("SVGStopElement"); + } + + @Alerts("false") + void _SVGStyleElement() throws Exception { + test("SVGStyleElement"); + } + + @Alerts("false") + void _SVGSwitchElement() throws Exception { + test("SVGSwitchElement"); + } + + @Alerts("false") + void _SVGSymbolElement() throws Exception { + test("SVGSymbolElement"); + } + + @Alerts("false") + void _SVGTSpanElement() throws Exception { + test("SVGTSpanElement"); + } + + @Alerts("false") + void _SVGTextContentElement() throws Exception { + test("SVGTextContentElement"); + } + + @Alerts("false") + void _SVGTextElement() throws Exception { + test("SVGTextElement"); + } + + @Alerts("false") + void _SVGTextPathElement() throws Exception { + test("SVGTextPathElement"); + } + + @Alerts("false") + void _SVGTextPositioningElement() throws Exception { + test("SVGTextPositioningElement"); + } + + @Alerts("false") + void _SVGTitleElement() throws Exception { + test("SVGTitleElement"); + } + + @Alerts("false") + void _SVGUseElement() throws Exception { + test("SVGUseElement"); + } + + @Alerts("false") + void _SVGViewElement() throws Exception { + test("SVGViewElement"); + } + + @Alerts("false") + void _Screen() throws Exception { + test("Screen"); + } + + @Alerts("false") + void _ScreenOrientation() throws Exception { + test("ScreenOrientation"); + } + + @Alerts("false") + void _ScriptProcessorNode() throws Exception { + test("ScriptProcessorNode"); + } + + @Alerts("false") + void _SecurityPolicyViolationEvent() throws Exception { + test("SecurityPolicyViolationEvent"); + } + + @Alerts("false") + void _ServiceWorker() throws Exception { + test("ServiceWorker"); + } + + @Alerts("false") + void _ServiceWorkerContainer() throws Exception { + test("ServiceWorkerContainer"); + } + + @Alerts("false") + void _ServiceWorkerRegistration() throws Exception { + test("ServiceWorkerRegistration"); + } + + @Alerts("false") + void _ShadowRoot() throws Exception { + test("ShadowRoot"); + } + + @Alerts("false") + void _SharedWorker() throws Exception { + test("SharedWorker"); + } + + @Alerts("false") + void _SourceBuffer() throws Exception { + test("SourceBuffer"); + } + + @Alerts("false") + void _SourceBufferList() throws Exception { + test("SourceBufferList"); + } + + @Alerts("exception") + void _SpeechGrammar() throws Exception { + test("SpeechGrammar"); + } + + @Alerts("exception") + void _SpeechGrammarList() throws Exception { + test("SpeechGrammarList"); + } + + @Alerts("exception") + void _SpeechRecognition() throws Exception { + test("SpeechRecognition"); + } + + @Alerts("exception") + void _SpeechRecognitionErrorEvent() throws Exception { + test("SpeechRecognitionErrorEvent"); + } + + @Alerts("exception") + void _SpeechRecognitionEvent() throws Exception { + test("SpeechRecognitionEvent"); + } + + @Alerts("false") + void _SpeechSynthesis() throws Exception { + test("SpeechSynthesis"); + } + + @Alerts("false") + void _SpeechSynthesisErrorEvent() throws Exception { + test("SpeechSynthesisErrorEvent"); + } + + @Alerts("false") + void _SpeechSynthesisEvent() throws Exception { + test("SpeechSynthesisEvent"); + } + + @Alerts("false") + void _SpeechSynthesisUtterance() throws Exception { + test("SpeechSynthesisUtterance"); + } + + @Alerts("false") + void _StereoPannerNode() throws Exception { + test("StereoPannerNode"); + } + + @Alerts("false") + void _StorageEvent() throws Exception { + test("StorageEvent"); + } + + @Alerts("exception") + void _StyleMedia() throws Exception { + test("StyleMedia"); + } + + @Alerts("false") + void _SubmitEvent() throws Exception { + test("SubmitEvent"); + } + + @Alerts(DEFAULT = "true", + FF = "exception", + FF_ESR = "exception") + void _SyncManager() throws Exception { + test("SyncManager"); + } + + @Alerts("false") + void _Text() throws Exception { + test("Text"); + } + + @Alerts(DEFAULT = "false", + FF_ESR = "exception") + void _TextEvent() throws Exception { + test("TextEvent"); + } + + @Alerts("false") + void _TextTrack() throws Exception { + test("TextTrack"); + } + + @Alerts("false") + void _TextTrackCue() throws Exception { + test("TextTrackCue"); + } + + @Alerts("false") + void _TextTrackList() throws Exception { + test("TextTrackList"); + } + + @Alerts(DEFAULT = "exception", + FF = "false", + FF_ESR = "false") + void _TimeEvent() throws Exception { + test("TimeEvent"); + } + + @Alerts(DEFAULT = "true", + FF = "exception", + FF_ESR = "exception") + void _Touch() throws Exception { + test("Touch"); + } + + @Alerts(DEFAULT = "false", + FF = "exception", + FF_ESR = "exception") + void _TouchEvent() throws Exception { + test("TouchEvent"); + } + + @Alerts(DEFAULT = "true", + FF = "exception", + FF_ESR = "exception") + void _TouchList() throws Exception { + test("TouchList"); + } + + @Alerts("false") + void _TrackEvent() throws Exception { + test("TrackEvent"); + } + + @Alerts("false") + void _TransitionEvent() throws Exception { + test("TransitionEvent"); + } + + @Alerts("false") + void _UIEvent() throws Exception { + test("UIEvent"); + } + + @Alerts("false") + void _VTTCue() throws Exception { + test("VTTCue"); + } + + @Alerts("false") + void _WaveShaperNode() throws Exception { + test("WaveShaperNode"); + } + + @Alerts(DEFAULT = "false", + FF = "true", + FF_ESR = "true") + @HtmlUnitNYI(CHROME = "true", + EDGE = "true") + void _WebGLBuffer() throws Exception { + test("WebGLBuffer"); + } + + @Alerts("false") + void _WebGLContextEvent() throws Exception { + test("WebGLContextEvent"); + } + + @Alerts(DEFAULT = "false", + FF = "true", + FF_ESR = "true") + @HtmlUnitNYI(CHROME = "true", + EDGE = "true") + void _WebGLFramebuffer() throws Exception { + test("WebGLFramebuffer"); + } + + @Alerts(DEFAULT = "false", + FF = "true", + FF_ESR = "true") + @HtmlUnitNYI(CHROME = "true", + EDGE = "true") + void _WebGLProgram() throws Exception { + test("WebGLProgram"); + } + + @Alerts(DEFAULT = "false", + FF = "true", + FF_ESR = "true") + @HtmlUnitNYI(CHROME = "true", + EDGE = "true") + void _WebGLQuery() throws Exception { + test("WebGLQuery"); + } + + @Alerts(DEFAULT = "false", + FF = "true", + FF_ESR = "true") + @HtmlUnitNYI(CHROME = "true", + EDGE = "true") + void _WebGLRenderbuffer() throws Exception { + test("WebGLRenderbuffer"); + } + + @Alerts(DEFAULT = "false", + FF = "true", + FF_ESR = "true") + @HtmlUnitNYI(CHROME = "true", + EDGE = "true") + void _WebGLSampler() throws Exception { + test("WebGLSampler"); + } + + @Alerts(DEFAULT = "false", + FF = "true", + FF_ESR = "true") + @HtmlUnitNYI(CHROME = "true", + EDGE = "true") + void _WebGLShader() throws Exception { + test("WebGLShader"); + } + + @Alerts(DEFAULT = "false", + FF = "true", + FF_ESR = "true") + @HtmlUnitNYI(CHROME = "true", + EDGE = "true") + void _WebGLSync() throws Exception { + test("WebGLSync"); + } + + @Alerts(DEFAULT = "false", + FF = "true", + FF_ESR = "true") + @HtmlUnitNYI(CHROME = "true", + EDGE = "true") + void _WebGLTexture() throws Exception { + test("WebGLTexture"); + } + + @Alerts(DEFAULT = "false", + FF = "true", + FF_ESR = "true") + @HtmlUnitNYI(CHROME = "true", + EDGE = "true") + void _WebGLTransformFeedback() throws Exception { + test("WebGLTransformFeedback"); + } + + @Alerts(DEFAULT = "false", + FF = "true", + FF_ESR = "true") + @HtmlUnitNYI(CHROME = "true", + EDGE = "true") + void _WebGLVertexArrayObject() throws Exception { + test("WebGLVertexArrayObject"); + } + + @Alerts("false") + void _WebKitCSSMatrix() throws Exception { + test("WebKitCSSMatrix"); + } + + @Alerts(DEFAULT = "true", + FF = "exception", + FF_ESR = "exception") + void _WebKitMutationObserver() throws Exception { + test("WebKitMutationObserver"); + } + + @Alerts(DEFAULT = "false", + FF = "exception", + FF_ESR = "exception") + void _WebKitMediaStream() throws Exception { + test("webkitMediaStream"); + } + + @Alerts("false") + void _WebSocket() throws Exception { + test("WebSocket"); + } + + @Alerts("false") + void _WheelEvent() throws Exception { + test("WheelEvent"); + } + + @Alerts("false") + void _Window() throws Exception { + test("Window"); + } + + @Alerts("false") + void _Worker() throws Exception { + test("Worker"); + } + + @Alerts("false") + void _XMLDocument() throws Exception { + test("XMLDocument"); + } + + @Alerts("false") + void _XMLHttpRequest() throws Exception { + test("XMLHttpRequest"); + } + + @Alerts("false") + void _XMLHttpRequestEventTarget() throws Exception { + test("XMLHttpRequestEventTarget"); + } + + @Alerts("false") + void _XMLHttpRequestUpload() throws Exception { + test("XMLHttpRequestUpload"); + } + + @Alerts(DEFAULT = "false", + FF = "exception", + FF_ESR = "exception") + void _webkitMediaStream() throws Exception { + test("webkitMediaStream"); + } + + @Alerts(DEFAULT = "false", + FF = "exception", + FF_ESR = "exception") + void _webkitRTCPeerConnection() throws Exception { + test("webkitRTCPeerConnection"); + } +} diff --git a/src/test/java/org/htmlunit/general/huge/ElementClosesElementTest.java b/src/test/java/org/htmlunit/general/huge/ElementClosesElementTest.java index 95c0f183755..5f9007a51d4 100644 --- a/src/test/java/org/htmlunit/general/huge/ElementClosesElementTest.java +++ b/src/test/java/org/htmlunit/general/huge/ElementClosesElementTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,15 +22,11 @@ import org.htmlunit.WebClient; import org.htmlunit.WebDriverTestCase; import org.htmlunit.html.DefaultElementFactory; -import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserParameterizedRunner.Default; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; -import org.junit.After; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized.Parameter; -import org.junit.runners.Parameterized.Parameters; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa.selenium.htmlunit.HtmlUnitDriver; @@ -42,7 +38,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserParameterizedRunner.class) public class ElementClosesElementTest extends WebDriverTestCase { private static int ServerRestartCount_; @@ -75,21 +70,26 @@ public class ElementClosesElementTest extends WebDriverTestCase { * @return the parameterized data * @throws Exception if an error occurs */ - @Parameters - public static Collection data() throws Exception { - final List list = new ArrayList<>(); + public static Collection data() throws Exception { + final List list = new ArrayList<>(); final List strings = new ArrayList<>(DefaultElementFactory.SUPPORTED_TAGS_); strings.add("unknown"); for (final String parent : strings) { for (final String child : strings) { - list.add(new Object[] {parent, child}); + list.add(Arguments.of(parent, child)); } } return list; } - private void test(final String parent, final String child) throws Exception { + /** + * The default test. + * @throws Exception if an error occurs + */ + @ParameterizedTest(name = "_{0}_{1}") + @MethodSource("data") + void test(final String parent, final String child) throws Exception { String bodyStart = "\n"; String bodyEnd = "\n"; @@ -138,7 +138,8 @@ else if ("tr".equals(parent)) { html = "<" + parent + " id='outer'><" + child + ">\n"; } - String pageHtml = "\n" + String pageHtml = DOCTYPE_HTML + + "\n" + "-\n" + "\n" + bodyStart @@ -149,18 +150,21 @@ else if ("tr".equals(parent)) { if ("basefont".equals(parent) || "base".equals(parent) || "isindex".equals(parent)) { - pageHtml = "\n" + pageHtml = DOCTYPE_HTML + + "\n" + "<" + parent + " id='outer'><" + child + ">\n" + "\n" + ""; } else if ("head".equals(parent)) { - pageHtml = "<" + child + ">\n" + pageHtml = DOCTYPE_HTML + + "<" + child + ">\n" + "\n" + ""; } else if ("title".equals(parent)) { - pageHtml = "\n" + pageHtml = DOCTYPE_HTML + + "\n" + "<" + child + ">\n" + "</head><body>\n" + "</body></html>"; @@ -211,27 +215,6 @@ else if ("html".equals(parent)) { assertEquals(expected, result); } - /** - * The parent element name. - */ - @Parameter - public String parent_; - - /** - * The child element name. - */ - @Parameter(1) - public String child_; - - /** - * Cleanup. - */ - @After - public void after() { - parent_ = null; - child_ = null; - } - /** * {@inheritDoc} */ @@ -240,1743 +223,969 @@ protected boolean isWebClientCached() { return true; } - /** - * The default test. - * @throws Exception if an error occurs - */ - @Test - @Default - public void closes() throws Exception { - test(parent_, child_); - } - - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _a_a() throws Exception { + void _a_a() throws Exception { test("a", "a"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _button_button() throws Exception { + void _button_button() throws Exception { test("button", "button"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _colgroup_col() throws Exception { + void _colgroup_col() throws Exception { test("colgroup", "col"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _colgroup_template() throws Exception { + void _colgroup_template() throws Exception { test("colgroup", "template"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _command_body() throws Exception { + void _command_body() throws Exception { test("command", "body"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _command_caption() throws Exception { + void _command_caption() throws Exception { test("command", "caption"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _command_col() throws Exception { + void _command_col() throws Exception { test("command", "col"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _command_colgroup() throws Exception { + void _command_colgroup() throws Exception { test("command", "colgroup"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _command_frame() throws Exception { + void _command_frame() throws Exception { test("command", "frame"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _command_frameset() throws Exception { + void _command_frameset() throws Exception { test("command", "frameset"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _command_head() throws Exception { + void _command_head() throws Exception { test("command", "head"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _command_html() throws Exception { + void _command_html() throws Exception { test("command", "html"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _command_tbody() throws Exception { + void _command_tbody() throws Exception { test("command", "tbody"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _command_td() throws Exception { + void _command_td() throws Exception { test("command", "td"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _command_tfoot() throws Exception { + void _command_tfoot() throws Exception { test("command", "tfoot"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _command_th() throws Exception { + void _command_th() throws Exception { test("command", "th"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _command_thead() throws Exception { + void _command_thead() throws Exception { test("command", "thead"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _command_tr() throws Exception { + void _command_tr() throws Exception { test("command", "tr"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _dd_dd() throws Exception { + void _dd_dd() throws Exception { test("dd", "dd"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _dd_dt() throws Exception { + void _dd_dt() throws Exception { test("dd", "dt"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _dt_dd() throws Exception { + void _dt_dd() throws Exception { test("dt", "dd"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _dt_dt() throws Exception { + void _dt_dt() throws Exception { test("dt", "dt"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _form_form() throws Exception { + void _form_form() throws Exception { test("form", "form"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _form_isindex() throws Exception { + void _form_isindex() throws Exception { test("form", "isindex"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _frameset_frame() throws Exception { + void _frameset_frame() throws Exception { test("frameset", "frame"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _frameset_frameset() throws Exception { + void _frameset_frameset() throws Exception { test("frameset", "frameset"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _frameset_noframes() throws Exception { + void _frameset_noframes() throws Exception { test("frameset", "noframes"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h1_h1() throws Exception { + void _h1_h1() throws Exception { test("h1", "h1"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h1_h2() throws Exception { + void _h1_h2() throws Exception { test("h1", "h2"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h1_h3() throws Exception { + void _h1_h3() throws Exception { test("h1", "h3"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h1_h4() throws Exception { + void _h1_h4() throws Exception { test("h1", "h4"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h1_h5() throws Exception { + void _h1_h5() throws Exception { test("h1", "h5"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h1_h6() throws Exception { + void _h1_h6() throws Exception { test("h1", "h6"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h2_h1() throws Exception { + void _h2_h1() throws Exception { test("h2", "h1"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h2_h2() throws Exception { + void _h2_h2() throws Exception { test("h2", "h2"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h2_h3() throws Exception { + void _h2_h3() throws Exception { test("h2", "h3"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h2_h4() throws Exception { + void _h2_h4() throws Exception { test("h2", "h4"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h2_h5() throws Exception { + void _h2_h5() throws Exception { test("h2", "h5"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h2_h6() throws Exception { + void _h2_h6() throws Exception { test("h2", "h6"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h3_h1() throws Exception { + void _h3_h1() throws Exception { test("h3", "h1"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h3_h2() throws Exception { + void _h3_h2() throws Exception { test("h3", "h2"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h3_h3() throws Exception { + void _h3_h3() throws Exception { test("h3", "h3"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h3_h4() throws Exception { + void _h3_h4() throws Exception { test("h3", "h4"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h3_h5() throws Exception { + void _h3_h5() throws Exception { test("h3", "h5"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h3_h6() throws Exception { + void _h3_h6() throws Exception { test("h3", "h6"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h4_h1() throws Exception { + void _h4_h1() throws Exception { test("h4", "h1"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h4_h2() throws Exception { + void _h4_h2() throws Exception { test("h4", "h2"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h4_h3() throws Exception { + void _h4_h3() throws Exception { test("h4", "h3"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h4_h4() throws Exception { + void _h4_h4() throws Exception { test("h4", "h4"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h4_h5() throws Exception { + void _h4_h5() throws Exception { test("h4", "h5"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h4_h6() throws Exception { + void _h4_h6() throws Exception { test("h4", "h6"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h5_h1() throws Exception { + void _h5_h1() throws Exception { test("h5", "h1"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h5_h2() throws Exception { + void _h5_h2() throws Exception { test("h5", "h2"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h5_h3() throws Exception { + void _h5_h3() throws Exception { test("h5", "h3"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h5_h4() throws Exception { + void _h5_h4() throws Exception { test("h5", "h4"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h5_h5() throws Exception { + void _h5_h5() throws Exception { test("h5", "h5"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h5_h6() throws Exception { + void _h5_h6() throws Exception { test("h5", "h6"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h6_h1() throws Exception { + void _h6_h1() throws Exception { test("h6", "h1"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h6_h2() throws Exception { + void _h6_h2() throws Exception { test("h6", "h2"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h6_h3() throws Exception { + void _h6_h3() throws Exception { test("h6", "h3"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h6_h4() throws Exception { + void _h6_h4() throws Exception { test("h6", "h4"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h6_h5() throws Exception { + void _h6_h5() throws Exception { test("h6", "h5"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _h6_h6() throws Exception { + void _h6_h6() throws Exception { test("h6", "h6"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _head_base() throws Exception { + void _head_base() throws Exception { test("head", "base"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _head_basefont() throws Exception { + void _head_basefont() throws Exception { test("head", "basefont"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _head_bgsound() throws Exception { + void _head_bgsound() throws Exception { test("head", "bgsound"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts(DEFAULT = "1", FF = "0", FF_ESR = "0") - public void _head_command() throws Exception { + void _head_command() throws Exception { test("head", "command"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _head_link() throws Exception { + void _head_link() throws Exception { test("head", "link"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _head_meta() throws Exception { + void _head_meta() throws Exception { test("head", "meta"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _head_noframes() throws Exception { + void _head_noframes() throws Exception { test("head", "noframes"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _head_noscript() throws Exception { + void _head_noscript() throws Exception { test("head", "noscript"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _head_script() throws Exception { + void _head_script() throws Exception { test("head", "script"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _head_style() throws Exception { + void _head_style() throws Exception { test("head", "style"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _head_template() throws Exception { + void _head_template() throws Exception { test("head", "template"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _head_title() throws Exception { + void _head_title() throws Exception { test("head", "title"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("2") - public void _html_body() throws Exception { + void _html_body() throws Exception { test("html", "body"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("2") - public void _html_caption() throws Exception { + void _html_caption() throws Exception { test("html", "caption"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("2") - public void _html_col() throws Exception { + void _html_col() throws Exception { test("html", "col"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("2") - public void _html_colgroup() throws Exception { + void _html_colgroup() throws Exception { test("html", "colgroup"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("2") - public void _html_frame() throws Exception { + void _html_frame() throws Exception { test("html", "frame"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("2") - public void _html_frameset() throws Exception { + void _html_frameset() throws Exception { test("html", "frameset"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("2") - public void _html_head() throws Exception { + void _html_head() throws Exception { test("html", "head"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("2") - public void _html_html() throws Exception { + void _html_html() throws Exception { test("html", "html"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("2") - public void _html_tbody() throws Exception { + void _html_tbody() throws Exception { test("html", "tbody"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("2") - public void _html_td() throws Exception { + void _html_td() throws Exception { test("html", "td"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("2") - public void _html_tfoot() throws Exception { + void _html_tfoot() throws Exception { test("html", "tfoot"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("2") - public void _html_th() throws Exception { + void _html_th() throws Exception { test("html", "th"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("2") - public void _html_thead() throws Exception { + void _html_thead() throws Exception { test("html", "thead"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("2") - public void _html_tr() throws Exception { + void _html_tr() throws Exception { test("html", "tr"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("null") @HtmlUnitNYI( CHROME = "0", EDGE = "0", FF = "0", FF_ESR = "0") - public void _isindex_frameset() throws Exception { + void _isindex_frameset() throws Exception { test("isindex", "frameset"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _isindex_isindex() throws Exception { + void _isindex_isindex() throws Exception { test("isindex", "isindex"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _li_caption() throws Exception { + void _li_caption() throws Exception { test("li", "caption"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _li_li() throws Exception { + void _li_li() throws Exception { test("li", "li"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _nobr_nobr() throws Exception { + void _nobr_nobr() throws Exception { test("nobr", "nobr"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _option_optgroup() throws Exception { + void _option_optgroup() throws Exception { test("option", "optgroup"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _option_option() throws Exception { + void _option_option() throws Exception { test("option", "option"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_address() throws Exception { + void _p_address() throws Exception { test("p", "address"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_article() throws Exception { + void _p_article() throws Exception { test("p", "article"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_aside() throws Exception { + void _p_aside() throws Exception { test("p", "aside"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_blockquote() throws Exception { + void _p_blockquote() throws Exception { test("p", "blockquote"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_center() throws Exception { + void _p_center() throws Exception { test("p", "center"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_dd() throws Exception { + void _p_dd() throws Exception { test("p", "dd"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_details() throws Exception { + void _p_details() throws Exception { test("p", "details"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_dialog() throws Exception { + void _p_dialog() throws Exception { test("p", "dialog"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_dir() throws Exception { + void _p_dir() throws Exception { test("p", "dir"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_div() throws Exception { + void _p_div() throws Exception { test("p", "div"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_dl() throws Exception { + void _p_dl() throws Exception { test("p", "dl"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_dt() throws Exception { + void _p_dt() throws Exception { test("p", "dt"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_fieldset() throws Exception { + void _p_fieldset() throws Exception { test("p", "fieldset"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_figcaption() throws Exception { + void _p_figcaption() throws Exception { test("p", "figcaption"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_figure() throws Exception { + void _p_figure() throws Exception { test("p", "figure"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_footer() throws Exception { + void _p_footer() throws Exception { test("p", "footer"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_form() throws Exception { + void _p_form() throws Exception { test("p", "form"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_h1() throws Exception { + void _p_h1() throws Exception { test("p", "h1"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_h2() throws Exception { + void _p_h2() throws Exception { test("p", "h2"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_h3() throws Exception { + void _p_h3() throws Exception { test("p", "h3"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_h4() throws Exception { + void _p_h4() throws Exception { test("p", "h4"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_h5() throws Exception { + void _p_h5() throws Exception { test("p", "h5"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_h6() throws Exception { + void _p_h6() throws Exception { test("p", "h6"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_header() throws Exception { + void _p_header() throws Exception { test("p", "header"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_hr() throws Exception { + void _p_hr() throws Exception { test("p", "hr"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _p_isindex() throws Exception { + void _p_isindex() throws Exception { test("p", "isindex"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_li() throws Exception { + void _p_li() throws Exception { test("p", "li"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_listing() throws Exception { + void _p_listing() throws Exception { test("p", "listing"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_main() throws Exception { + void _p_main() throws Exception { test("p", "main"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_menu() throws Exception { + void _p_menu() throws Exception { test("p", "menu"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_nav() throws Exception { + void _p_nav() throws Exception { test("p", "nav"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_ol() throws Exception { + void _p_ol() throws Exception { test("p", "ol"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_p() throws Exception { + void _p_p() throws Exception { test("p", "p"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_plaintext() throws Exception { + void _p_plaintext() throws Exception { test("p", "plaintext"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_pre() throws Exception { + void _p_pre() throws Exception { test("p", "pre"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_section() throws Exception { + void _p_section() throws Exception { test("p", "section"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_summary() throws Exception { + void _p_summary() throws Exception { test("p", "summary"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_ul() throws Exception { + void _p_ul() throws Exception { test("p", "ul"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _p_xmp() throws Exception { + void _p_xmp() throws Exception { test("p", "xmp"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _ruby_blink() throws Exception { + void _ruby_blink() throws Exception { test("ruby", "blink"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts(DEFAULT = "1", FF = "0", FF_ESR = "0") @HtmlUnitNYI(FF = "1", FF_ESR = "1") - public void _select_hr() throws Exception { + void _select_hr() throws Exception { test("select", "hr"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _select_optgroup() throws Exception { + void _select_optgroup() throws Exception { test("select", "optgroup"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _select_option() throws Exception { + void _select_option() throws Exception { test("select", "option"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _select_script() throws Exception { + void _select_script() throws Exception { test("select", "script"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _select_template() throws Exception { + void _select_template() throws Exception { test("select", "template"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _table_caption() throws Exception { + void _table_caption() throws Exception { test("table", "caption"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _table_col() throws Exception { + void _table_col() throws Exception { test("table", "col"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _table_colgroup() throws Exception { + void _table_colgroup() throws Exception { test("table", "colgroup"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _table_form() throws Exception { + void _table_form() throws Exception { test("table", "form"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _table_script() throws Exception { + void _table_script() throws Exception { test("table", "script"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _table_style() throws Exception { + void _table_style() throws Exception { test("table", "style"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _table_tbody() throws Exception { + void _table_tbody() throws Exception { test("table", "tbody"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _table_td() throws Exception { + void _table_td() throws Exception { test("table", "td"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _table_template() throws Exception { + void _table_template() throws Exception { test("table", "template"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _table_tfoot() throws Exception { + void _table_tfoot() throws Exception { test("table", "tfoot"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _table_th() throws Exception { + void _table_th() throws Exception { test("table", "th"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _table_thead() throws Exception { + void _table_thead() throws Exception { test("table", "thead"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _table_tr() throws Exception { + void _table_tr() throws Exception { test("table", "tr"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _tbody_form() throws Exception { + void _tbody_form() throws Exception { test("tbody", "form"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _tbody_script() throws Exception { + void _tbody_script() throws Exception { test("tbody", "script"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _tbody_style() throws Exception { + void _tbody_style() throws Exception { test("tbody", "style"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _tbody_td() throws Exception { + void _tbody_td() throws Exception { test("tbody", "td"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _tbody_template() throws Exception { + void _tbody_template() throws Exception { test("tbody", "template"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _tbody_th() throws Exception { + void _tbody_th() throws Exception { test("tbody", "th"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _tbody_tr() throws Exception { + void _tbody_tr() throws Exception { test("tbody", "tr"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _tfoot_form() throws Exception { + void _tfoot_form() throws Exception { test("tfoot", "form"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _tfoot_script() throws Exception { + void _tfoot_script() throws Exception { test("tfoot", "script"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _tfoot_style() throws Exception { + void _tfoot_style() throws Exception { test("tfoot", "style"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _tfoot_td() throws Exception { + void _tfoot_td() throws Exception { test("tfoot", "td"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _tfoot_template() throws Exception { + void _tfoot_template() throws Exception { test("tfoot", "template"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _tfoot_th() throws Exception { + void _tfoot_th() throws Exception { test("tfoot", "th"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _tfoot_tr() throws Exception { + void _tfoot_tr() throws Exception { test("tfoot", "tr"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _thead_form() throws Exception { + void _thead_form() throws Exception { test("thead", "form"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _thead_script() throws Exception { + void _thead_script() throws Exception { test("thead", "script"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _thead_style() throws Exception { + void _thead_style() throws Exception { test("thead", "style"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _thead_td() throws Exception { + void _thead_td() throws Exception { test("thead", "td"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _thead_template() throws Exception { + void _thead_template() throws Exception { test("thead", "template"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _thead_th() throws Exception { + void _thead_th() throws Exception { test("thead", "th"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _thead_tr() throws Exception { + void _thead_tr() throws Exception { test("thead", "tr"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _tr_form() throws Exception { + void _tr_form() throws Exception { test("tr", "form"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _tr_script() throws Exception { + void _tr_script() throws Exception { test("tr", "script"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _tr_style() throws Exception { + void _tr_style() throws Exception { test("tr", "style"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _tr_td() throws Exception { + void _tr_td() throws Exception { test("tr", "td"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _tr_template() throws Exception { + void _tr_template() throws Exception { test("tr", "template"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("1") - public void _tr_th() throws Exception { + void _tr_th() throws Exception { test("tr", "th"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _template_caption() throws Exception { + void _template_caption() throws Exception { test("template", "tr"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _template_col() throws Exception { + void _template_col() throws Exception { test("template", "col"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _template_colgroup() throws Exception { + void _template_colgroup() throws Exception { test("template", "colgroup"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _template_frame() throws Exception { + void _template_frame() throws Exception { test("template", "frame"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _template_tbody() throws Exception { + void _template_tbody() throws Exception { test("template", "tbody"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _template_td() throws Exception { + void _template_td() throws Exception { test("template", "td"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _template_tfoot() throws Exception { + void _template_tfoot() throws Exception { test("template", "tfoot"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _template_th() throws Exception { + void _template_th() throws Exception { test("template", "th"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _template_thead() throws Exception { + void _template_thead() throws Exception { test("template", "thead"); } - /** - * @throws Exception if the test fails - */ - @Test @Alerts("0") - public void _template_tr() throws Exception { + void _template_tr() throws Exception { test("template", "tr"); } } diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOf.java b/src/test/java/org/htmlunit/general/huge/HostParentOf.java index 7fd0d9a0ebc..13885507ab0 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOf.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,12 +22,10 @@ import org.htmlunit.TestCaseTest; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.html.HtmlPageTest; -import org.htmlunit.junit.BrowserParameterizedRunner.Default; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.After; -import org.junit.Test; -import org.junit.runners.Parameterized.Parameter; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; import org.openqa.selenium.WebDriver; /** @@ -46,43 +44,20 @@ public abstract class HostParentOf extends WebDriverTestCase { * @return the parameterized data * @throws Exception if an error occurs */ - protected static Collection<Object[]> data(final Predicate<String> predicate) throws Exception { + protected static Collection<Arguments> data(final Predicate<String> predicate) throws Exception { final Set<String> jsClassNames = TestCaseTest.getAllConfiguredJsConstructorNames(); - final List<Object[]> list = new ArrayList<>(jsClassNames.size() * jsClassNames.size() / 10); + final List<Arguments> list = new ArrayList<>(jsClassNames.size() * jsClassNames.size() / 10); for (final String parent : jsClassNames) { if (predicate.test(parent)) { for (final String child : jsClassNames) { - list.add(new Object[] {parent, child}); + list.add(Arguments.of(parent, child)); } } } return list; } - /** - * The parent element name. - */ - @Parameter - public String parent_; - - /** - * The child element name. - */ - @Parameter(1) - public String child_; - - /** - * The default test. - * @throws Exception if an error occurs - */ - @Test - @Alerts("false") - @Default - public void isParentOf() throws Exception { - test(parent_, child_); - } - /** * Runs the test. * @@ -90,8 +65,11 @@ public void isParentOf() throws Exception { * @param child the child host name * @throws Exception if an error occurs */ + @ParameterizedTest(name = "_{0}_{1}") + @MethodSource("data") + @Alerts("false/false") protected void test(final String parent, final String child) throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "<html>\n" + "<head>\n" + "<title>-\n" @@ -99,15 +77,16 @@ protected void test(final String parent, final String child) throws Exception { + "\n" + "\n" + ""; @@ -127,13 +106,4 @@ protected void test(final String parent, final String child) throws Exception { protected boolean isWebClientCached() { return true; } - - /** - * Cleanup. - */ - @After - public void after() { - parent_ = null; - child_ = null; - } } diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfATest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfATest.java index e1957f7cfea..346ec2754f9 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfATest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfATest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,12 +16,9 @@ import java.util.Collection; -import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized.Parameters; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; +import org.junit.jupiter.params.provider.Arguments; /** * Tests two Host classes, if one prototype is parent of another. @@ -31,7 +28,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserParameterizedRunner.class) public class HostParentOfATest extends HostParentOf { /** @@ -39,460 +35,263 @@ public class HostParentOfATest extends HostParentOf { * @return the parameterized data * @throws Exception if an error occurs */ - @Parameters - public static Collection data() throws Exception { + public static Collection data() throws Exception { return HostParentOf.data(input -> { final char ch = Character.toUpperCase(input.charAt(0)); return ch == 'A'; }); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AbortController_AbortController() throws Exception { + @Alerts("true/false") + void _AbortController_AbortController() throws Exception { test("AbortController", "AbortController"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AbortSignal_AbortSignal() throws Exception { + @Alerts("true/false") + void _AbortSignal_AbortSignal() throws Exception { test("AbortSignal", "AbortSignal"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AbstractRange_AbstractRange() throws Exception { + @Alerts("true/false") + void _AbstractRange_AbstractRange() throws Exception { test("AbstractRange", "AbstractRange"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AbstractRange_Range() throws Exception { + @Alerts("true/true") + void _AbstractRange_Range() throws Exception { test("AbstractRange", "Range"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _ActiveXObject_ActiveXObject() throws Exception { + @Alerts("false/false") + void _ActiveXObject_ActiveXObject() throws Exception { test("ActiveXObject", "ActiveXObject"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AnalyserNode_AnalyserNode() throws Exception { + @Alerts("true/false") + void _AnalyserNode_AnalyserNode() throws Exception { test("AnalyserNode", "AnalyserNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _ANGLE_instanced_arrays_ANGLE_instanced_arrays() throws Exception { + @Alerts("false/false") + void _ANGLE_instanced_arrays_ANGLE_instanced_arrays() throws Exception { test("ANGLE_instanced_arrays", "ANGLE_instanced_arrays"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Animation_Animation() throws Exception { + @Alerts("true/false") + void _Animation_Animation() throws Exception { test("Animation", "Animation"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AnimationEvent_AnimationEvent() throws Exception { + @Alerts("true/false") + void _AnimationEvent_AnimationEvent() throws Exception { test("AnimationEvent", "AnimationEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _ApplicationCache_ApplicationCache() throws Exception { + @Alerts("false/false") + void _ApplicationCache_ApplicationCache() throws Exception { test("ApplicationCache", "ApplicationCache"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _ApplicationCacheErrorEvent_ApplicationCacheErrorEvent() throws Exception { + @Alerts("false/false") + void _ApplicationCacheErrorEvent_ApplicationCacheErrorEvent() throws Exception { test("ApplicationCacheErrorEvent", "ApplicationCacheErrorEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _ArrayBuffer_ArrayBuffer() throws Exception { + @Alerts("true/false") + void _ArrayBuffer_ArrayBuffer() throws Exception { test("ArrayBuffer", "ArrayBuffer"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - @HtmlUnitNYI(CHROME = "true", - EDGE = "true", - FF = "true", - FF_ESR = "true") - public void _Atomics_Atomics() throws Exception { + @Alerts("false/false") + @HtmlUnitNYI(CHROME = "true/false", + EDGE = "true/false", + FF = "true/false", + FF_ESR = "true/false") + void _Atomics_Atomics() throws Exception { test("Atomics", "Atomics"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Attr_Attr() throws Exception { + @Alerts("true/false") + void _Attr_Attr() throws Exception { test("Attr", "Attr"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Audio_Audio() throws Exception { + @Alerts("true/false") + void _Audio_Audio() throws Exception { test("Audio", "Audio"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - @HtmlUnitNYI(CHROME = "false", - EDGE = "false", - FF = "false", - FF_ESR = "false") - public void _Audio_HTMLAudioElement() throws Exception { + @Alerts("true/false") + @HtmlUnitNYI(CHROME = "false/false", + EDGE = "false/false", + FF = "false/false", + FF_ESR = "false/false") + void _Audio_HTMLAudioElement() throws Exception { test("Audio", "HTMLAudioElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioBuffer_AudioBuffer() throws Exception { + @Alerts("true/false") + void _AudioBuffer_AudioBuffer() throws Exception { test("AudioBuffer", "AudioBuffer"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioBufferSourceNode_AudioBufferSourceNode() throws Exception { + @Alerts("true/false") + void _AudioBufferSourceNode_AudioBufferSourceNode() throws Exception { test("AudioBufferSourceNode", "AudioBufferSourceNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioContext_AudioContext() throws Exception { + @Alerts("true/false") + void _AudioContext_AudioContext() throws Exception { test("AudioContext", "AudioContext"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioDestinationNode_AudioDestinationNode() throws Exception { + @Alerts("true/false") + void _AudioDestinationNode_AudioDestinationNode() throws Exception { test("AudioDestinationNode", "AudioDestinationNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioListener_AudioListener() throws Exception { + @Alerts("true/false") + void _AudioListener_AudioListener() throws Exception { test("AudioListener", "AudioListener"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioNode_AnalyserNode() throws Exception { + @Alerts("true/true") + void _AudioNode_AnalyserNode() throws Exception { test("AudioNode", "AnalyserNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioNode_AudioBufferSourceNode() throws Exception { + @Alerts("true/false") + void _AudioNode_AudioBufferSourceNode() throws Exception { test("AudioNode", "AudioBufferSourceNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioNode_AudioDestinationNode() throws Exception { + @Alerts("true/true") + void _AudioNode_AudioDestinationNode() throws Exception { test("AudioNode", "AudioDestinationNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioNode_AudioNode() throws Exception { + @Alerts("true/false") + void _AudioNode_AudioNode() throws Exception { test("AudioNode", "AudioNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioNode_AudioScheduledSourceNode() throws Exception { + @Alerts("true/true") + void _AudioNode_AudioScheduledSourceNode() throws Exception { test("AudioNode", "AudioScheduledSourceNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioNode_BiquadFilterNode() throws Exception { + @Alerts("true/true") + void _AudioNode_BiquadFilterNode() throws Exception { test("AudioNode", "BiquadFilterNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioNode_ChannelMergerNode() throws Exception { + @Alerts("true/true") + void _AudioNode_ChannelMergerNode() throws Exception { test("AudioNode", "ChannelMergerNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioNode_ChannelSplitterNode() throws Exception { + @Alerts("true/true") + void _AudioNode_ChannelSplitterNode() throws Exception { test("AudioNode", "ChannelSplitterNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioNode_ConstantSourceNode() throws Exception { + @Alerts("true/false") + void _AudioNode_ConstantSourceNode() throws Exception { test("AudioNode", "ConstantSourceNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioNode_ConvolverNode() throws Exception { + @Alerts("true/true") + void _AudioNode_ConvolverNode() throws Exception { test("AudioNode", "ConvolverNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioNode_DelayNode() throws Exception { + @Alerts("true/true") + void _AudioNode_DelayNode() throws Exception { test("AudioNode", "DelayNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioNode_DynamicsCompressorNode() throws Exception { + @Alerts("true/true") + void _AudioNode_DynamicsCompressorNode() throws Exception { test("AudioNode", "DynamicsCompressorNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioNode_GainNode() throws Exception { + @Alerts("true/true") + void _AudioNode_GainNode() throws Exception { test("AudioNode", "GainNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioNode_IIRFilterNode() throws Exception { + @Alerts("true/true") + void _AudioNode_IIRFilterNode() throws Exception { test("AudioNode", "IIRFilterNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioNode_MediaElementAudioSourceNode() throws Exception { + @Alerts("true/true") + void _AudioNode_MediaElementAudioSourceNode() throws Exception { test("AudioNode", "MediaElementAudioSourceNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioNode_MediaStreamAudioDestinationNode() throws Exception { + @Alerts("true/true") + void _AudioNode_MediaStreamAudioDestinationNode() throws Exception { test("AudioNode", "MediaStreamAudioDestinationNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioNode_MediaStreamAudioSourceNode() throws Exception { + @Alerts("true/true") + void _AudioNode_MediaStreamAudioSourceNode() throws Exception { test("AudioNode", "MediaStreamAudioSourceNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioNode_OscillatorNode() throws Exception { + @Alerts("true/false") + void _AudioNode_OscillatorNode() throws Exception { test("AudioNode", "OscillatorNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioNode_PannerNode() throws Exception { + @Alerts("true/true") + void _AudioNode_PannerNode() throws Exception { test("AudioNode", "PannerNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioNode_ScriptProcessorNode() throws Exception { + @Alerts("true/true") + void _AudioNode_ScriptProcessorNode() throws Exception { test("AudioNode", "ScriptProcessorNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioNode_StereoPannerNode() throws Exception { + @Alerts("true/true") + void _AudioNode_StereoPannerNode() throws Exception { test("AudioNode", "StereoPannerNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioNode_WaveShaperNode() throws Exception { + @Alerts("true/true") + void _AudioNode_WaveShaperNode() throws Exception { test("AudioNode", "WaveShaperNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioParam_AudioParam() throws Exception { + @Alerts("true/false") + void _AudioParam_AudioParam() throws Exception { test("AudioParam", "AudioParam"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioProcessingEvent_AudioProcessingEvent() throws Exception { + @Alerts("true/false") + void _AudioProcessingEvent_AudioProcessingEvent() throws Exception { test("AudioProcessingEvent", "AudioProcessingEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioScheduledSourceNode_AudioBufferSourceNode() throws Exception { + @Alerts("true/true") + void _AudioScheduledSourceNode_AudioBufferSourceNode() throws Exception { test("AudioScheduledSourceNode", "AudioBufferSourceNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioScheduledSourceNode_AudioScheduledSourceNode() throws Exception { + @Alerts("true/false") + void _AudioScheduledSourceNode_AudioScheduledSourceNode() throws Exception { test("AudioScheduledSourceNode", "AudioScheduledSourceNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioScheduledSourceNode_ConstantSourceNode() throws Exception { + @Alerts("true/true") + void _AudioScheduledSourceNode_ConstantSourceNode() throws Exception { test("AudioScheduledSourceNode", "ConstantSourceNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _AudioScheduledSourceNode_OscillatorNode() throws Exception { + @Alerts("true/true") + void _AudioScheduledSourceNode_OscillatorNode() throws Exception { test("AudioScheduledSourceNode", "OscillatorNode"); } } diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfBTest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfBTest.java index f2f67ef17af..3c03b82d69e 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfBTest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfBTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,11 +16,8 @@ import java.util.Collection; -import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized.Parameters; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.params.provider.Arguments; /** * Tests two Host classes, if one prototype is parent of another. @@ -30,7 +27,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserParameterizedRunner.class) public class HostParentOfBTest extends HostParentOf { /** @@ -38,123 +34,74 @@ public class HostParentOfBTest extends HostParentOf { * @return the parameterized data * @throws Exception if an error occurs */ - @Parameters - public static Collection data() throws Exception { + public static Collection data() throws Exception { return HostParentOf.data(input -> { final char ch = Character.toUpperCase(input.charAt(0)); return ch == 'B'; }); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _BarProp_BarProp() throws Exception { + @Alerts("true/false") + void _BarProp_BarProp() throws Exception { test("BarProp", "BarProp"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _BaseAudioContext_AudioContext() throws Exception { + @Alerts("true/true") + void _BaseAudioContext_AudioContext() throws Exception { test("BaseAudioContext", "AudioContext"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _BaseAudioContext_BaseAudioContext() throws Exception { + @Alerts("true/false") + void _BaseAudioContext_BaseAudioContext() throws Exception { test("BaseAudioContext", "BaseAudioContext"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _BaseAudioContext_OfflineAudioContext() throws Exception { + @Alerts("true/true") + void _BaseAudioContext_OfflineAudioContext() throws Exception { test("BaseAudioContext", "OfflineAudioContext"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - FF = "false", - FF_ESR = "false") - public void _BatteryManager_BatteryManager() throws Exception { + @Alerts(DEFAULT = "true/false", + FF = "false/false", + FF_ESR = "false/false") + void _BatteryManager_BatteryManager() throws Exception { test("BatteryManager", "BatteryManager"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _BeforeInstallPromptEvent_BeforeInstallPromptEvent() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _BeforeInstallPromptEvent_BeforeInstallPromptEvent() throws Exception { test("BeforeInstallPromptEvent", "BeforeInstallPromptEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _BeforeUnloadEvent_BeforeUnloadEvent() throws Exception { + @Alerts("true/false") + void _BeforeUnloadEvent_BeforeUnloadEvent() throws Exception { test("BeforeUnloadEvent", "BeforeUnloadEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _BiquadFilterNode_BiquadFilterNode() throws Exception { + @Alerts("true/false") + void _BiquadFilterNode_BiquadFilterNode() throws Exception { test("BiquadFilterNode", "BiquadFilterNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Blob_Blob() throws Exception { + @Alerts("true/false") + void _Blob_Blob() throws Exception { test("Blob", "Blob"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Blob_File() throws Exception { + @Alerts("true/true") + void _Blob_File() throws Exception { test("Blob", "File"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _BlobEvent_BlobEvent() throws Exception { + @Alerts("true/false") + void _BlobEvent_BlobEvent() throws Exception { test("BlobEvent", "BlobEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _BroadcastChannel_BroadcastChannel() throws Exception { + @Alerts("true/false") + void _BroadcastChannel_BroadcastChannel() throws Exception { test("BroadcastChannel", "BroadcastChannel"); } } diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfCTest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfCTest.java index 8421cbaaef7..8276ec61f2b 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfCTest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfCTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,12 +16,9 @@ import java.util.Collection; -import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized.Parameters; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; +import org.junit.jupiter.params.provider.Arguments; /** * Tests two Host classes, if one prototype is parent of another. @@ -31,7 +28,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserParameterizedRunner.class) public class HostParentOfCTest extends HostParentOf { /** @@ -39,709 +35,413 @@ public class HostParentOfCTest extends HostParentOf { * @return the parameterized data * @throws Exception if an error occurs */ - @Parameters - public static Collection data() throws Exception { + public static Collection data() throws Exception { return HostParentOf.data(input -> { final char ch = Character.toUpperCase(input.charAt(0)); return ch == 'C'; }); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Cache_Cache() throws Exception { + @Alerts("true/false") + void _Cache_Cache() throws Exception { test("Cache", "Cache"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CacheStorage_CacheStorage() throws Exception { + @Alerts("true/false") + void _CacheStorage_CacheStorage() throws Exception { test("CacheStorage", "CacheStorage"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true", - FF_ESR = "true") - public void _CanvasCaptureMediaStream_CanvasCaptureMediaStream() throws Exception { + @Alerts(DEFAULT = "false/false", + FF = "true/false", + FF_ESR = "true/false") + void _CanvasCaptureMediaStream_CanvasCaptureMediaStream() throws Exception { test("CanvasCaptureMediaStream", "CanvasCaptureMediaStream"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _CanvasCaptureMediaStreamTrack_CanvasCaptureMediaStreamTrack() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _CanvasCaptureMediaStreamTrack_CanvasCaptureMediaStreamTrack() throws Exception { test("CanvasCaptureMediaStreamTrack", "CanvasCaptureMediaStreamTrack"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CanvasGradient_CanvasGradient() throws Exception { + @Alerts("true/false") + void _CanvasGradient_CanvasGradient() throws Exception { test("CanvasGradient", "CanvasGradient"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CanvasPattern_CanvasPattern() throws Exception { + @Alerts("true/false") + void _CanvasPattern_CanvasPattern() throws Exception { test("CanvasPattern", "CanvasPattern"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CanvasRenderingContext2D_CanvasRenderingContext2D() throws Exception { + @Alerts("true/false") + void _CanvasRenderingContext2D_CanvasRenderingContext2D() throws Exception { test("CanvasRenderingContext2D", "CanvasRenderingContext2D"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CaretPosition_CaretPosition() throws Exception { + @Alerts("true/false") + void _CaretPosition_CaretPosition() throws Exception { test("CaretPosition", "CaretPosition"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CDATASection_CDATASection() throws Exception { + @Alerts("true/false") + void _CDATASection_CDATASection() throws Exception { test("CDATASection", "CDATASection"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _ChannelMergerNode_ChannelMergerNode() throws Exception { + @Alerts("true/false") + void _ChannelMergerNode_ChannelMergerNode() throws Exception { test("ChannelMergerNode", "ChannelMergerNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _ChannelSplitterNode_ChannelSplitterNode() throws Exception { + @Alerts("true/false") + void _ChannelSplitterNode_ChannelSplitterNode() throws Exception { test("ChannelSplitterNode", "ChannelSplitterNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CharacterData_CDATASection() throws Exception { + @Alerts("true/false") + void _CharacterData_CDATASection() throws Exception { test("CharacterData", "CDATASection"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CharacterData_CharacterData() throws Exception { + @Alerts("true/false") + void _CharacterData_CharacterData() throws Exception { test("CharacterData", "CharacterData"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CharacterData_Comment() throws Exception { + @Alerts("true/true") + void _CharacterData_Comment() throws Exception { test("CharacterData", "Comment"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CharacterData_ProcessingInstruction() throws Exception { + @Alerts("true/true") + void _CharacterData_ProcessingInstruction() throws Exception { test("CharacterData", "ProcessingInstruction"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CharacterData_Text() throws Exception { + @Alerts("true/true") + void _CharacterData_Text() throws Exception { test("CharacterData", "Text"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _ClientRect_ClientRect() throws Exception { - test("ClientRect", "ClientRect"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _ClientRectList_ClientRectList() throws Exception { - test("ClientRectList", "ClientRectList"); - } - - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _ClipboardEvent_ClipboardEvent() throws Exception { + @Alerts("true/false") + void _ClipboardEvent_ClipboardEvent() throws Exception { test("ClipboardEvent", "ClipboardEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CloseEvent_CloseEvent() throws Exception { + @Alerts("true/false") + void _CloseEvent_CloseEvent() throws Exception { test("CloseEvent", "CloseEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Comment_Comment() throws Exception { + @Alerts("true/false") + void _Comment_Comment() throws Exception { test("Comment", "Comment"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CompositionEvent_CompositionEvent() throws Exception { + @Alerts("true/false") + void _CompositionEvent_CompositionEvent() throws Exception { test("CompositionEvent", "CompositionEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _Console_Console() throws Exception { + @Alerts("false/false") + void _Console_Console() throws Exception { test("Console", "Console"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _ConstantSourceNode_ConstantSourceNode() throws Exception { + @Alerts("true/false") + void _ConstantSourceNode_ConstantSourceNode() throws Exception { test("ConstantSourceNode", "ConstantSourceNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _ConvolverNode_ConvolverNode() throws Exception { + @Alerts("true/false") + void _ConvolverNode_ConvolverNode() throws Exception { test("ConvolverNode", "ConvolverNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _Coordinates_Coordinates() throws Exception { + @Alerts("false/false") + void _Coordinates_Coordinates() throws Exception { test("Coordinates", "Coordinates"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Credential_Credential() throws Exception { + @Alerts("true/false") + void _Credential_Credential() throws Exception { test("Credential", "Credential"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _Credential_FederatedCredential() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/true", + EDGE = "true/true") + void _Credential_FederatedCredential() throws Exception { test("Credential", "FederatedCredential"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _Credential_PasswordCredential() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/true", + EDGE = "true/true") + void _Credential_PasswordCredential() throws Exception { test("Credential", "PasswordCredential"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CredentialsContainer_CredentialsContainer() throws Exception { + @Alerts("true/false") + void _CredentialsContainer_CredentialsContainer() throws Exception { test("CredentialsContainer", "CredentialsContainer"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Crypto_Crypto() throws Exception { + @Alerts("true/false") + void _Crypto_Crypto() throws Exception { test("Crypto", "Crypto"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CryptoKey_CryptoKey() throws Exception { + @Alerts("true/false") + void _CryptoKey_CryptoKey() throws Exception { test("CryptoKey", "CryptoKey"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _CSS_CSS() throws Exception { + @Alerts("false/false") + void _CSS_CSS() throws Exception { test("CSS", "CSS"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true", - FF_ESR = "true") - public void _CSS2Properties_CSS2Properties() throws Exception { + @Alerts(DEFAULT = "false/false", + FF = "true/false", + FF_ESR = "true/false") + void _CSS2Properties_CSS2Properties() throws Exception { test("CSS2Properties", "CSS2Properties"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSConditionRule_CSSConditionRule() throws Exception { + @Alerts("true/false") + void _CSSConditionRule_CSSConditionRule() throws Exception { test("CSSConditionRule", "CSSConditionRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSConditionRule_CSSMediaRule() throws Exception { + @Alerts("true/true") + void _CSSConditionRule_CSSMediaRule() throws Exception { test("CSSConditionRule", "CSSMediaRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSConditionRule_CSSSupportsRule() throws Exception { + @Alerts("true/true") + void _CSSConditionRule_CSSSupportsRule() throws Exception { test("CSSConditionRule", "CSSSupportsRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSCounterStyleRule_CSSCounterStyleRule() throws Exception { + @Alerts("true/false") + void _CSSCounterStyleRule_CSSCounterStyleRule() throws Exception { test("CSSCounterStyleRule", "CSSCounterStyleRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSFontFaceRule_CSSFontFaceRule() throws Exception { + @Alerts("true/false") + void _CSSFontFaceRule_CSSFontFaceRule() throws Exception { test("CSSFontFaceRule", "CSSFontFaceRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSGroupingRule_CSSConditionRule() throws Exception { + @Alerts("true/true") + void _CSSGroupingRule_CSSConditionRule() throws Exception { test("CSSGroupingRule", "CSSConditionRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSGroupingRule_CSSGroupingRule() throws Exception { + @Alerts("true/false") + void _CSSGroupingRule_CSSGroupingRule() throws Exception { test("CSSGroupingRule", "CSSGroupingRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSGroupingRule_CSSMediaRule() throws Exception { + @Alerts("true/false") + void _CSSGroupingRule_CSSMediaRule() throws Exception { test("CSSGroupingRule", "CSSMediaRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true") - @HtmlUnitNYI(FF = "false") - public void _CSSGroupingRule_CSSStyleRule() throws Exception { + @Alerts("true/true") + @HtmlUnitNYI(CHROME = "false/false", + EDGE = "false/false", + FF = "false/false", + FF_ESR = "false/false") + void _CSSGroupingRule_CSSPageRule() throws Exception { + test("CSSGroupingRule", "CSSPageRule"); + } + + @Alerts(DEFAULT = "false/false", + FF = "true/true", + FF_ESR = "true/true") + @HtmlUnitNYI(FF = "false/false", + FF_ESR = "false/false") + void _CSSGroupingRule_CSSStyleRule() throws Exception { test("CSSGroupingRule", "CSSStyleRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSGroupingRule_CSSSupportsRule() throws Exception { + @Alerts("true/false") + void _CSSGroupingRule_CSSSupportsRule() throws Exception { test("CSSGroupingRule", "CSSSupportsRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSImportRule_CSSImportRule() throws Exception { + @Alerts("true/false") + void _CSSImportRule_CSSImportRule() throws Exception { test("CSSImportRule", "CSSImportRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSKeyframeRule_CSSKeyframeRule() throws Exception { + @Alerts("true/false") + void _CSSKeyframeRule_CSSKeyframeRule() throws Exception { test("CSSKeyframeRule", "CSSKeyframeRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSKeyframesRule_CSSKeyframesRule() throws Exception { + @Alerts("true/false") + void _CSSKeyframesRule_CSSKeyframesRule() throws Exception { test("CSSKeyframesRule", "CSSKeyframesRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSMediaRule_CSSMediaRule() throws Exception { + @Alerts("true/false") + void _CSSMediaRule_CSSMediaRule() throws Exception { test("CSSMediaRule", "CSSMediaRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSNamespaceRule_CSSNamespaceRule() throws Exception { + @Alerts("true/false") + void _CSSNamespaceRule_CSSNamespaceRule() throws Exception { test("CSSNamespaceRule", "CSSNamespaceRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSPageRule_CSSPageRule() throws Exception { + @Alerts("true/false") + void _CSSPageRule_CSSPageRule() throws Exception { test("CSSPageRule", "CSSPageRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _CSSPrimitiveValue_CSSPrimitiveValue() throws Exception { + @Alerts("false/false") + void _CSSPrimitiveValue_CSSPrimitiveValue() throws Exception { test("CSSPrimitiveValue", "CSSPrimitiveValue"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSRule_CSSConditionRule() throws Exception { + @Alerts("true/false") + void _CSSRule_CSSConditionRule() throws Exception { test("CSSRule", "CSSConditionRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSRule_CSSCounterStyleRule() throws Exception { + @Alerts("true/true") + void _CSSRule_CSSCounterStyleRule() throws Exception { test("CSSRule", "CSSCounterStyleRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSRule_CSSFontFaceRule() throws Exception { + @Alerts("true/true") + void _CSSRule_CSSFontFaceRule() throws Exception { test("CSSRule", "CSSFontFaceRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSRule_CSSGroupingRule() throws Exception { + @Alerts("true/true") + void _CSSRule_CSSGroupingRule() throws Exception { test("CSSRule", "CSSGroupingRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSRule_CSSImportRule() throws Exception { + @Alerts("true/true") + void _CSSRule_CSSImportRule() throws Exception { test("CSSRule", "CSSImportRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSRule_CSSKeyframeRule() throws Exception { + @Alerts("true/true") + void _CSSRule_CSSKeyframeRule() throws Exception { test("CSSRule", "CSSKeyframeRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSRule_CSSKeyframesRule() throws Exception { + @Alerts("true/true") + void _CSSRule_CSSKeyframesRule() throws Exception { test("CSSRule", "CSSKeyframesRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSRule_CSSMediaRule() throws Exception { + @Alerts("true/false") + void _CSSRule_CSSMediaRule() throws Exception { test("CSSRule", "CSSMediaRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSRule_CSSNamespaceRule() throws Exception { + @Alerts("true/true") + void _CSSRule_CSSNamespaceRule() throws Exception { test("CSSRule", "CSSNamespaceRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSRule_CSSPageRule() throws Exception { + @Alerts("true/false") + @HtmlUnitNYI(CHROME = "true/true", + EDGE = "true/true", + FF = "true/true", + FF_ESR = "true/true") + void _CSSRule_CSSPageRule() throws Exception { test("CSSRule", "CSSPageRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSRule_CSSRule() throws Exception { + @Alerts("true/false") + void _CSSRule_CSSRule() throws Exception { test("CSSRule", "CSSRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSRule_CSSStyleRule() throws Exception { + @Alerts(DEFAULT = "true/true", + FF = "true/false", + FF_ESR = "true/false") + @HtmlUnitNYI(FF = "true/true", + FF_ESR = "true/true") + void _CSSRule_CSSStyleRule() throws Exception { test("CSSRule", "CSSStyleRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSRule_CSSSupportsRule() throws Exception { + @Alerts("true/false") + void _CSSRule_CSSSupportsRule() throws Exception { test("CSSRule", "CSSSupportsRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSRuleList_CSSRuleList() throws Exception { + @Alerts("true/false") + void _CSSRuleList_CSSRuleList() throws Exception { test("CSSRuleList", "CSSRuleList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true", - FF_ESR = "true") - public void _CSSStyleDeclaration_CSS2Properties() throws Exception { + @Alerts(DEFAULT = "false/false", + FF = "true/true", + FF_ESR = "true/true") + void _CSSStyleDeclaration_CSS2Properties() throws Exception { test("CSSStyleDeclaration", "CSS2Properties"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSStyleDeclaration_CSSStyleDeclaration() throws Exception { + @Alerts("true/false") + void _CSSStyleDeclaration_CSSStyleDeclaration() throws Exception { test("CSSStyleDeclaration", "CSSStyleDeclaration"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSStyleRule_CSSStyleRule() throws Exception { + @Alerts("true/false") + void _CSSStyleRule_CSSStyleRule() throws Exception { test("CSSStyleRule", "CSSStyleRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSStyleSheet_CSSStyleSheet() throws Exception { + @Alerts("true/false") + void _CSSStyleSheet_CSSStyleSheet() throws Exception { test("CSSStyleSheet", "CSSStyleSheet"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CSSSupportsRule_CSSSupportsRule() throws Exception { + @Alerts("true/false") + void _CSSSupportsRule_CSSSupportsRule() throws Exception { test("CSSSupportsRule", "CSSSupportsRule"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _CSSValue_CSSPrimitiveValue() throws Exception { + @Alerts("false/false") + void _CSSValue_CSSPrimitiveValue() throws Exception { test("CSSValue", "CSSPrimitiveValue"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _CSSValue_CSSValue() throws Exception { + @Alerts("false/false") + void _CSSValue_CSSValue() throws Exception { test("CSSValue", "CSSValue"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _CSSValue_CSSValueList() throws Exception { + @Alerts("false/false") + void _CSSValue_CSSValueList() throws Exception { test("CSSValue", "CSSValueList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _CSSValueList_CSSValueList() throws Exception { + @Alerts("false/false") + void _CSSValueList_CSSValueList() throws Exception { test("CSSValueList", "CSSValueList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CustomElementRegistry_CustomElementRegistry() throws Exception { + @Alerts("true/false") + void _CustomElementRegistry_CustomElementRegistry() throws Exception { test("CustomElementRegistry", "CustomElementRegistry"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _CustomEvent_CustomEvent() throws Exception { + @Alerts("true/false") + void _CustomEvent_CustomEvent() throws Exception { test("CustomEvent", "CustomEvent"); } } diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfDTest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfDTest.java index 80909973ad1..b8942c84bbe 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfDTest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfDTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,12 +16,9 @@ import java.util.Collection; -import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized.Parameters; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; +import org.junit.jupiter.params.provider.Arguments; /** * Tests two Host classes, if one prototype is parent of another. @@ -31,7 +28,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserParameterizedRunner.class) public class HostParentOfDTest extends HostParentOf { /** @@ -39,4787 +35,2695 @@ public class HostParentOfDTest extends HostParentOf { * @return the parameterized data * @throws Exception if an error occurs */ - @Parameters - public static Collection data() throws Exception { + public static Collection data() throws Exception { return HostParentOf.data(input -> { final char ch = Character.toUpperCase(input.charAt(0)); return ch >= 'D' && ch <= 'E'; }); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DataTransfer_DataTransfer() throws Exception { + @Alerts("true/false") + void _DataTransfer_DataTransfer() throws Exception { test("DataTransfer", "DataTransfer"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DataTransferItem_DataTransferItem() throws Exception { + @Alerts("true/false") + void _DataTransferItem_DataTransferItem() throws Exception { test("DataTransferItem", "DataTransferItem"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DataTransferItemList_DataTransferItemList() throws Exception { + @Alerts("true/false") + void _DataTransferItemList_DataTransferItemList() throws Exception { test("DataTransferItemList", "DataTransferItemList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DataView_DataView() throws Exception { + @Alerts("true/false") + void _DataView_DataView() throws Exception { test("DataView", "DataView"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DelayNode_DelayNode() throws Exception { + @Alerts("true/false") + void _DelayNode_DelayNode() throws Exception { test("DelayNode", "DelayNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _DeviceLightEvent_DeviceLightEvent() throws Exception { + @Alerts("false/false") + void _DeviceLightEvent_DeviceLightEvent() throws Exception { test("DeviceLightEvent", "DeviceLightEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DeviceMotionEvent_DeviceMotionEvent() throws Exception { + @Alerts("true/false") + void _DeviceMotionEvent_DeviceMotionEvent() throws Exception { test("DeviceMotionEvent", "DeviceMotionEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DeviceOrientationEvent_DeviceOrientationEvent() throws Exception { + @Alerts("true/false") + void _DeviceOrientationEvent_DeviceOrientationEvent() throws Exception { test("DeviceOrientationEvent", "DeviceOrientationEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _DeviceProximityEvent_DeviceProximityEvent() throws Exception { + @Alerts("false/false") + void _DeviceProximityEvent_DeviceProximityEvent() throws Exception { test("DeviceProximityEvent", "DeviceProximityEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Document_Document() throws Exception { + @Alerts("true/false") + void _Document_Document() throws Exception { test("Document", "Document"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Document_HTMLDocument() throws Exception { + @Alerts("true/true") + void _Document_HTMLDocument() throws Exception { test("Document", "HTMLDocument"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Document_XMLDocument() throws Exception { + @Alerts("true/true") + void _Document_XMLDocument() throws Exception { test("Document", "XMLDocument"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DocumentFragment_DocumentFragment() throws Exception { + @Alerts("true/false") + void _DocumentFragment_DocumentFragment() throws Exception { test("DocumentFragment", "DocumentFragment"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DocumentFragment_ShadowRoot() throws Exception { + @Alerts("true/true") + void _DocumentFragment_ShadowRoot() throws Exception { test("DocumentFragment", "ShadowRoot"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DocumentType_DocumentType() throws Exception { + @Alerts("true/false") + void _DocumentType_DocumentType() throws Exception { test("DocumentType", "DocumentType"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _DOMCursor_DOMCursor() throws Exception { + @Alerts("false/false") + void _DOMCursor_DOMCursor() throws Exception { test("DOMCursor", "DOMCursor"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - FF = "false", - FF_ESR = "false") - public void _DOMError_DOMError() throws Exception { + @Alerts(DEFAULT = "true/false", + FF = "false/false", + FF_ESR = "false/false") + void _DOMError_DOMError() throws Exception { test("DOMError", "DOMError"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DOMException_DOMException() throws Exception { + @Alerts("true/false") + void _DOMException_DOMException() throws Exception { test("DOMException", "DOMException"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DOMImplementation_DOMImplementation() throws Exception { + @Alerts("true/false") + void _DOMImplementation_DOMImplementation() throws Exception { test("DOMImplementation", "DOMImplementation"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DOMMatrix_DOMMatrix() throws Exception { + @Alerts("true/false") + void _DOMMatrix_DOMMatrix() throws Exception { test("DOMMatrix", "DOMMatrix"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DOMMatrix_WebKitCSSMatrix() throws Exception { + @Alerts("true/false") + void _DOMMatrix_WebKitCSSMatrix() throws Exception { test("DOMMatrix", "WebKitCSSMatrix"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DOMMatrixReadOnly_DOMMatrix() throws Exception { + @Alerts("true/true") + void _DOMMatrixReadOnly_DOMMatrix() throws Exception { test("DOMMatrixReadOnly", "DOMMatrix"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DOMMatrixReadOnly_DOMMatrixReadOnly() throws Exception { + @Alerts("true/false") + void _DOMMatrixReadOnly_DOMMatrixReadOnly() throws Exception { test("DOMMatrixReadOnly", "DOMMatrixReadOnly"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DOMMatrixReadOnly_WebKitCSSMatrix() throws Exception { + @Alerts("true/true") + void _DOMMatrixReadOnly_WebKitCSSMatrix() throws Exception { test("DOMMatrixReadOnly", "WebKitCSSMatrix"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DOMParser_DOMParser() throws Exception { + @Alerts("true/false") + void _DOMParser_DOMParser() throws Exception { test("DOMParser", "DOMParser"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DOMPoint_DOMPoint() throws Exception { + @Alerts("true/false") + void _DOMPoint_DOMPoint() throws Exception { test("DOMPoint", "DOMPoint"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DOMPointReadOnly_DOMPoint() throws Exception { + @Alerts("true/true") + void _DOMPointReadOnly_DOMPoint() throws Exception { test("DOMPointReadOnly", "DOMPoint"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DOMPointReadOnly_DOMPointReadOnly() throws Exception { + @Alerts("true/false") + void _DOMPointReadOnly_DOMPointReadOnly() throws Exception { test("DOMPointReadOnly", "DOMPointReadOnly"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DOMRect_DOMRect() throws Exception { + @Alerts("true/false") + void _DOMRect_DOMRect() throws Exception { test("DOMRect", "DOMRect"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DOMRectList_DOMRectList() throws Exception { + @Alerts("true/false") + void _DOMRectList_DOMRectList() throws Exception { test("DOMRectList", "DOMRectList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - @HtmlUnitNYI(CHROME = "false", - EDGE = "false", - FF = "false", - FF_ESR = "false") - public void _DOMRectReadOnly_DOMRect() throws Exception { + @Alerts("true/true") + void _DOMRectReadOnly_DOMRect() throws Exception { test("DOMRectReadOnly", "DOMRect"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DOMRectReadOnly_DOMRectReadOnly() throws Exception { + @Alerts("true/false") + void _DOMRectReadOnly_DOMRectReadOnly() throws Exception { test("DOMRectReadOnly", "DOMRectReadOnly"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _DOMRequest_DOMRequest() throws Exception { + @Alerts("false/false") + void _DOMRequest_DOMRequest() throws Exception { test("DOMRequest", "DOMRequest"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _DOMSettableTokenList_DOMSettableTokenList() throws Exception { + @Alerts("false/false") + void _DOMSettableTokenList_DOMSettableTokenList() throws Exception { test("DOMSettableTokenList", "DOMSettableTokenList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DOMStringList_DOMStringList() throws Exception { + @Alerts("true/false") + void _DOMStringList_DOMStringList() throws Exception { test("DOMStringList", "DOMStringList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - @HtmlUnitNYI(CHROME = "false", - EDGE = "false", - FF = "false", - FF_ESR = "false") - public void _DOMStringMap_DOMStringMap() throws Exception { + @Alerts("true/false") + @HtmlUnitNYI(CHROME = "false/false", + EDGE = "false/false", + FF = "false/false", + FF_ESR = "false/false") + void _DOMStringMap_DOMStringMap() throws Exception { test("DOMStringMap", "DOMStringMap"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _DOMTokenList_DOMSettableTokenList() throws Exception { + @Alerts("false/false") + void _DOMTokenList_DOMSettableTokenList() throws Exception { test("DOMTokenList", "DOMSettableTokenList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DOMTokenList_DOMTokenList() throws Exception { + @Alerts("true/false") + void _DOMTokenList_DOMTokenList() throws Exception { test("DOMTokenList", "DOMTokenList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DragEvent_DragEvent() throws Exception { + @Alerts("true/false") + void _DragEvent_DragEvent() throws Exception { test("DragEvent", "DragEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _DynamicsCompressorNode_DynamicsCompressorNode() throws Exception { + @Alerts("true/false") + void _DynamicsCompressorNode_DynamicsCompressorNode() throws Exception { test("DynamicsCompressorNode", "DynamicsCompressorNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_Audio() throws Exception { + @Alerts("true/false") + void _Element_Audio() throws Exception { test("Element", "Audio"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_Element() throws Exception { + @Alerts("true/false") + void _Element_Element() throws Exception { test("Element", "Element"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLAnchorElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLAnchorElement() throws Exception { test("Element", "HTMLAnchorElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _Element_HTMLAppletElement() throws Exception { + @Alerts("false/false") + void _Element_HTMLAppletElement() throws Exception { test("Element", "HTMLAppletElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLAreaElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLAreaElement() throws Exception { test("Element", "HTMLAreaElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLAudioElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLAudioElement() throws Exception { test("Element", "HTMLAudioElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLBaseElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLBaseElement() throws Exception { test("Element", "HTMLBaseElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _Element_HTMLBaseFontElement() throws Exception { + @Alerts("false/false") + void _Element_HTMLBaseFontElement() throws Exception { test("Element", "HTMLBaseFontElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _Element_HTMLBGSoundElement() throws Exception { + @Alerts("false/false") + void _Element_HTMLBGSoundElement() throws Exception { test("Element", "HTMLBGSoundElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _Element_HTMLBlockElement() throws Exception { + @Alerts("false/false") + void _Element_HTMLBlockElement() throws Exception { test("Element", "HTMLBlockElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLBodyElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLBodyElement() throws Exception { test("Element", "HTMLBodyElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLBRElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLBRElement() throws Exception { test("Element", "HTMLBRElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLButtonElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLButtonElement() throws Exception { test("Element", "HTMLButtonElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLCanvasElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLCanvasElement() throws Exception { test("Element", "HTMLCanvasElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLDataElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLDataElement() throws Exception { test("Element", "HTMLDataElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLDataListElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLDataListElement() throws Exception { test("Element", "HTMLDataListElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _Element_HTMLDDElement() throws Exception { + @Alerts("false/false") + void _Element_HTMLDDElement() throws Exception { test("Element", "HTMLDDElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLDetailsElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLDetailsElement() throws Exception { test("Element", "HTMLDetailsElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLDialogElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLDialogElement() throws Exception { test("Element", "HTMLDialogElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLDirectoryElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLDirectoryElement() throws Exception { test("Element", "HTMLDirectoryElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLDivElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLDivElement() throws Exception { test("Element", "HTMLDivElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLDListElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLDListElement() throws Exception { test("Element", "HTMLDListElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _Element_HTMLDTElement() throws Exception { + @Alerts("false/false") + void _Element_HTMLDTElement() throws Exception { test("Element", "HTMLDTElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLElement() throws Exception { + @Alerts("true/true") + void _Element_HTMLElement() throws Exception { test("Element", "HTMLElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLEmbedElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLEmbedElement() throws Exception { test("Element", "HTMLEmbedElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLFieldSetElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLFieldSetElement() throws Exception { test("Element", "HTMLFieldSetElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLFontElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLFontElement() throws Exception { test("Element", "HTMLFontElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLFormElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLFormElement() throws Exception { test("Element", "HTMLFormElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLFrameElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLFrameElement() throws Exception { test("Element", "HTMLFrameElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLFrameSetElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLFrameSetElement() throws Exception { test("Element", "HTMLFrameSetElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLHeadElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLHeadElement() throws Exception { test("Element", "HTMLHeadElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLHeadingElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLHeadingElement() throws Exception { test("Element", "HTMLHeadingElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLHRElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLHRElement() throws Exception { test("Element", "HTMLHRElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLHtmlElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLHtmlElement() throws Exception { test("Element", "HTMLHtmlElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLIFrameElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLIFrameElement() throws Exception { test("Element", "HTMLIFrameElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLImageElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLImageElement() throws Exception { test("Element", "HTMLImageElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLInputElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLInputElement() throws Exception { test("Element", "HTMLInputElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _Element_HTMLIsIndexElement() throws Exception { + @Alerts("false/false") + void _Element_HTMLIsIndexElement() throws Exception { test("Element", "HTMLIsIndexElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLLabelElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLLabelElement() throws Exception { test("Element", "HTMLLabelElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLLegendElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLLegendElement() throws Exception { test("Element", "HTMLLegendElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLLIElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLLIElement() throws Exception { test("Element", "HTMLLIElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLLinkElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLLinkElement() throws Exception { test("Element", "HTMLLinkElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLMapElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLMapElement() throws Exception { test("Element", "HTMLMapElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLMarqueeElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLMarqueeElement() throws Exception { test("Element", "HTMLMarqueeElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLMediaElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLMediaElement() throws Exception { test("Element", "HTMLMediaElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLMenuElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLMenuElement() throws Exception { test("Element", "HTMLMenuElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _Element_HTMLMenuItemElement() throws Exception { + @Alerts("false/false") + void _Element_HTMLMenuItemElement() throws Exception { test("Element", "HTMLMenuItemElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLMetaElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLMetaElement() throws Exception { test("Element", "HTMLMetaElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLMeterElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLMeterElement() throws Exception { test("Element", "HTMLMeterElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLModElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLModElement() throws Exception { test("Element", "HTMLModElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _Element_HTMLNextIdElement() throws Exception { + @Alerts("false/false") + void _Element_HTMLNextIdElement() throws Exception { test("Element", "HTMLNextIdElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLObjectElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLObjectElement() throws Exception { test("Element", "HTMLObjectElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLOListElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLOListElement() throws Exception { test("Element", "HTMLOListElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLOptGroupElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLOptGroupElement() throws Exception { test("Element", "HTMLOptGroupElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLOptionElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLOptionElement() throws Exception { test("Element", "HTMLOptionElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLOutputElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLOutputElement() throws Exception { test("Element", "HTMLOutputElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLParagraphElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLParagraphElement() throws Exception { test("Element", "HTMLParagraphElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLParamElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLParamElement() throws Exception { test("Element", "HTMLParamElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _Element_HTMLPhraseElement() throws Exception { + @Alerts("false/false") + void _Element_HTMLPhraseElement() throws Exception { test("Element", "HTMLPhraseElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLPictureElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLPictureElement() throws Exception { test("Element", "HTMLPictureElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLPreElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLPreElement() throws Exception { test("Element", "HTMLPreElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLProgressElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLProgressElement() throws Exception { test("Element", "HTMLProgressElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLQuoteElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLQuoteElement() throws Exception { test("Element", "HTMLQuoteElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLScriptElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLScriptElement() throws Exception { test("Element", "HTMLScriptElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLSelectElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLSelectElement() throws Exception { test("Element", "HTMLSelectElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLSlotElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLSlotElement() throws Exception { test("Element", "HTMLSlotElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLSourceElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLSourceElement() throws Exception { test("Element", "HTMLSourceElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLSpanElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLSpanElement() throws Exception { test("Element", "HTMLSpanElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLStyleElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLStyleElement() throws Exception { test("Element", "HTMLStyleElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLTableCaptionElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLTableCaptionElement() throws Exception { test("Element", "HTMLTableCaptionElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLTableCellElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLTableCellElement() throws Exception { test("Element", "HTMLTableCellElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLTableColElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLTableColElement() throws Exception { test("Element", "HTMLTableColElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _Element_HTMLTableDataCellElement() throws Exception { + @Alerts("false/false") + void _Element_HTMLTableDataCellElement() throws Exception { test("Element", "HTMLTableDataCellElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLTableElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLTableElement() throws Exception { test("Element", "HTMLTableElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _Element_HTMLTableHeaderCellElement() throws Exception { + @Alerts("false/false") + void _Element_HTMLTableHeaderCellElement() throws Exception { test("Element", "HTMLTableHeaderCellElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLTableRowElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLTableRowElement() throws Exception { test("Element", "HTMLTableRowElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLTableSectionElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLTableSectionElement() throws Exception { test("Element", "HTMLTableSectionElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLTemplateElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLTemplateElement() throws Exception { test("Element", "HTMLTemplateElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLTextAreaElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLTextAreaElement() throws Exception { test("Element", "HTMLTextAreaElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLTimeElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLTimeElement() throws Exception { test("Element", "HTMLTimeElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLTitleElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLTitleElement() throws Exception { test("Element", "HTMLTitleElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLTrackElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLTrackElement() throws Exception { test("Element", "HTMLTrackElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLUListElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLUListElement() throws Exception { test("Element", "HTMLUListElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLUnknownElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLUnknownElement() throws Exception { test("Element", "HTMLUnknownElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_HTMLVideoElement() throws Exception { + @Alerts("true/false") + void _Element_HTMLVideoElement() throws Exception { test("Element", "HTMLVideoElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_Image() throws Exception { + @Alerts("true/false") + void _Element_Image() throws Exception { test("Element", "Image"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_Option() throws Exception { + @Alerts("true/false") + void _Element_Option() throws Exception { test("Element", "Option"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGAElement() throws Exception { + @Alerts("true/false") + void _Element_SVGAElement() throws Exception { test("Element", "SVGAElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGAnimateElement() throws Exception { + @Alerts("true/false") + void _Element_SVGAnimateElement() throws Exception { test("Element", "SVGAnimateElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGAnimateMotionElement() throws Exception { + @Alerts("true/false") + void _Element_SVGAnimateMotionElement() throws Exception { test("Element", "SVGAnimateMotionElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGAnimateTransformElement() throws Exception { + @Alerts("true/false") + void _Element_SVGAnimateTransformElement() throws Exception { test("Element", "SVGAnimateTransformElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGAnimationElement() throws Exception { + @Alerts("true/false") + void _Element_SVGAnimationElement() throws Exception { test("Element", "SVGAnimationElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGCircleElement() throws Exception { + @Alerts("true/false") + void _Element_SVGCircleElement() throws Exception { test("Element", "SVGCircleElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGClipPathElement() throws Exception { + @Alerts("true/false") + void _Element_SVGClipPathElement() throws Exception { test("Element", "SVGClipPathElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGComponentTransferFunctionElement() throws Exception { + @Alerts("true/false") + void _Element_SVGComponentTransferFunctionElement() throws Exception { test("Element", "SVGComponentTransferFunctionElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGDefsElement() throws Exception { + @Alerts("true/false") + void _Element_SVGDefsElement() throws Exception { test("Element", "SVGDefsElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGDescElement() throws Exception { + @Alerts("true/false") + void _Element_SVGDescElement() throws Exception { test("Element", "SVGDescElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGElement() throws Exception { + @Alerts("false/false") + void _Element_SVGDiscardElement() throws Exception { + test("Element", "SVGDiscardElement"); + } + + @Alerts("true/true") + void _Element_SVGElement() throws Exception { test("Element", "SVGElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGEllipseElement() throws Exception { + @Alerts("true/false") + void _Element_SVGEllipseElement() throws Exception { test("Element", "SVGEllipseElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFEBlendElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFEBlendElement() throws Exception { test("Element", "SVGFEBlendElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFEColorMatrixElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFEColorMatrixElement() throws Exception { test("Element", "SVGFEColorMatrixElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFEComponentTransferElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFEComponentTransferElement() throws Exception { test("Element", "SVGFEComponentTransferElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFECompositeElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFECompositeElement() throws Exception { test("Element", "SVGFECompositeElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFEConvolveMatrixElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFEConvolveMatrixElement() throws Exception { test("Element", "SVGFEConvolveMatrixElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFEDiffuseLightingElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFEDiffuseLightingElement() throws Exception { test("Element", "SVGFEDiffuseLightingElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFEDisplacementMapElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFEDisplacementMapElement() throws Exception { test("Element", "SVGFEDisplacementMapElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFEDistantLightElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFEDistantLightElement() throws Exception { test("Element", "SVGFEDistantLightElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFEDropShadowElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFEDropShadowElement() throws Exception { test("Element", "SVGFEDropShadowElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFEFloodElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFEFloodElement() throws Exception { test("Element", "SVGFEFloodElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFEFuncAElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFEFuncAElement() throws Exception { test("Element", "SVGFEFuncAElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFEFuncBElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFEFuncBElement() throws Exception { test("Element", "SVGFEFuncBElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFEFuncGElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFEFuncGElement() throws Exception { test("Element", "SVGFEFuncGElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFEFuncRElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFEFuncRElement() throws Exception { test("Element", "SVGFEFuncRElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFEGaussianBlurElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFEGaussianBlurElement() throws Exception { test("Element", "SVGFEGaussianBlurElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFEImageElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFEImageElement() throws Exception { test("Element", "SVGFEImageElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFEMergeElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFEMergeElement() throws Exception { test("Element", "SVGFEMergeElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFEMergeNodeElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFEMergeNodeElement() throws Exception { test("Element", "SVGFEMergeNodeElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFEMorphologyElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFEMorphologyElement() throws Exception { test("Element", "SVGFEMorphologyElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFEOffsetElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFEOffsetElement() throws Exception { test("Element", "SVGFEOffsetElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFEPointLightElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFEPointLightElement() throws Exception { test("Element", "SVGFEPointLightElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFESpecularLightingElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFESpecularLightingElement() throws Exception { test("Element", "SVGFESpecularLightingElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFESpotLightElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFESpotLightElement() throws Exception { test("Element", "SVGFESpotLightElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFETileElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFETileElement() throws Exception { test("Element", "SVGFETileElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFETurbulenceElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFETurbulenceElement() throws Exception { test("Element", "SVGFETurbulenceElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGFilterElement() throws Exception { + @Alerts("true/false") + void _Element_SVGFilterElement() throws Exception { test("Element", "SVGFilterElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGForeignObjectElement() throws Exception { + @Alerts("true/false") + void _Element_SVGForeignObjectElement() throws Exception { test("Element", "SVGForeignObjectElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGGElement() throws Exception { + @Alerts("true/false") + void _Element_SVGGElement() throws Exception { test("Element", "SVGGElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGGeometryElement() throws Exception { + @Alerts("true/false") + void _Element_SVGGeometryElement() throws Exception { test("Element", "SVGGeometryElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGGradientElement() throws Exception { + @Alerts("true/false") + void _Element_SVGGradientElement() throws Exception { test("Element", "SVGGradientElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGGraphicsElement() throws Exception { + @Alerts("true/false") + void _Element_SVGGraphicsElement() throws Exception { test("Element", "SVGGraphicsElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGImageElement() throws Exception { + @Alerts("true/false") + void _Element_SVGImageElement() throws Exception { test("Element", "SVGImageElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGLinearGradientElement() throws Exception { + @Alerts("true/false") + void _Element_SVGLinearGradientElement() throws Exception { test("Element", "SVGLinearGradientElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGLineElement() throws Exception { + @Alerts("true/false") + void _Element_SVGLineElement() throws Exception { test("Element", "SVGLineElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGMarkerElement() throws Exception { + @Alerts("true/false") + void _Element_SVGMarkerElement() throws Exception { test("Element", "SVGMarkerElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGMaskElement() throws Exception { + @Alerts("true/false") + void _Element_SVGMaskElement() throws Exception { test("Element", "SVGMaskElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGMetadataElement() throws Exception { + @Alerts("true/false") + void _Element_SVGMetadataElement() throws Exception { test("Element", "SVGMetadataElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGMPathElement() throws Exception { + @Alerts("true/false") + void _Element_SVGMPathElement() throws Exception { test("Element", "SVGMPathElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGPathElement() throws Exception { + @Alerts("true/false") + void _Element_SVGPathElement() throws Exception { test("Element", "SVGPathElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGPatternElement() throws Exception { + @Alerts("true/false") + void _Element_SVGPatternElement() throws Exception { test("Element", "SVGPatternElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGPolygonElement() throws Exception { + @Alerts("true/false") + void _Element_SVGPolygonElement() throws Exception { test("Element", "SVGPolygonElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGPolylineElement() throws Exception { + @Alerts("true/false") + void _Element_SVGPolylineElement() throws Exception { test("Element", "SVGPolylineElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGRadialGradientElement() throws Exception { + @Alerts("true/false") + void _Element_SVGRadialGradientElement() throws Exception { test("Element", "SVGRadialGradientElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGRectElement() throws Exception { + @Alerts("true/false") + void _Element_SVGRectElement() throws Exception { test("Element", "SVGRectElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGScriptElement() throws Exception { + @Alerts("true/false") + void _Element_SVGScriptElement() throws Exception { test("Element", "SVGScriptElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGSetElement() throws Exception { + @Alerts("true/false") + void _Element_SVGSetElement() throws Exception { test("Element", "SVGSetElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGStopElement() throws Exception { + @Alerts("true/false") + void _Element_SVGStopElement() throws Exception { test("Element", "SVGStopElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGStyleElement() throws Exception { + @Alerts("true/false") + void _Element_SVGStyleElement() throws Exception { test("Element", "SVGStyleElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGSVGElement() throws Exception { + @Alerts("true/false") + void _Element_SVGSVGElement() throws Exception { test("Element", "SVGSVGElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGSwitchElement() throws Exception { + @Alerts("true/false") + void _Element_SVGSwitchElement() throws Exception { test("Element", "SVGSwitchElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGSymbolElement() throws Exception { + @Alerts("true/false") + void _Element_SVGSymbolElement() throws Exception { test("Element", "SVGSymbolElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGTextContentElement() throws Exception { + @Alerts("true/false") + void _Element_SVGTextContentElement() throws Exception { test("Element", "SVGTextContentElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGTextElement() throws Exception { + @Alerts("true/false") + void _Element_SVGTextElement() throws Exception { test("Element", "SVGTextElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGTextPathElement() throws Exception { + @Alerts("true/false") + void _Element_SVGTextPathElement() throws Exception { test("Element", "SVGTextPathElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGTextPositioningElement() throws Exception { + @Alerts("true/false") + void _Element_SVGTextPositioningElement() throws Exception { test("Element", "SVGTextPositioningElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGTitleElement() throws Exception { + @Alerts("true/false") + void _Element_SVGTitleElement() throws Exception { test("Element", "SVGTitleElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGTSpanElement() throws Exception { + @Alerts("true/false") + void _Element_SVGTSpanElement() throws Exception { test("Element", "SVGTSpanElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGUseElement() throws Exception { + @Alerts("true/false") + void _Element_SVGUseElement() throws Exception { test("Element", "SVGUseElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Element_SVGViewElement() throws Exception { + @Alerts("true/false") + void _Element_SVGViewElement() throws Exception { test("Element", "SVGViewElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _Enumerator_Enumerator() throws Exception { + @Alerts("false/false") + void _Enumerator_Enumerator() throws Exception { test("Enumerator", "Enumerator"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - @HtmlUnitNYI(CHROME = "false", - EDGE = "false", - FF = "false", - FF_ESR = "false") - public void _Error_DOMException() throws Exception { + @Alerts("true/false") + @HtmlUnitNYI(CHROME = "false/false", + EDGE = "false/false", + FF = "false/false", + FF_ESR = "false/false") + void _Error_DOMException() throws Exception { test("Error", "DOMException"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Error_Error() throws Exception { + @Alerts("true/false") + void _Error_Error() throws Exception { test("Error", "Error"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _ErrorEvent_ErrorEvent() throws Exception { + @Alerts("true/false") + void _ErrorEvent_ErrorEvent() throws Exception { test("ErrorEvent", "ErrorEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_AnimationEvent() throws Exception { + @Alerts("true/true") + void _Event_AnimationEvent() throws Exception { test("Event", "AnimationEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _Event_ApplicationCacheErrorEvent() throws Exception { + @Alerts("false/false") + void _Event_ApplicationCacheErrorEvent() throws Exception { test("Event", "ApplicationCacheErrorEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_AudioProcessingEvent() throws Exception { + @Alerts("true/true") + void _Event_AudioProcessingEvent() throws Exception { test("Event", "AudioProcessingEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _Event_BeforeInstallPromptEvent() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/true", + EDGE = "true/true") + void _Event_BeforeInstallPromptEvent() throws Exception { test("Event", "BeforeInstallPromptEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_BeforeUnloadEvent() throws Exception { + @Alerts("true/true") + void _Event_BeforeUnloadEvent() throws Exception { test("Event", "BeforeUnloadEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_BlobEvent() throws Exception { + @Alerts("true/true") + void _Event_BlobEvent() throws Exception { test("Event", "BlobEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_ClipboardEvent() throws Exception { + @Alerts("true/true") + void _Event_ClipboardEvent() throws Exception { test("Event", "ClipboardEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_CloseEvent() throws Exception { + @Alerts("true/true") + void _Event_CloseEvent() throws Exception { test("Event", "CloseEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_CompositionEvent() throws Exception { + @Alerts("true/false") + void _Event_CompositionEvent() throws Exception { test("Event", "CompositionEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_CustomEvent() throws Exception { + @Alerts("true/true") + void _Event_CustomEvent() throws Exception { test("Event", "CustomEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _Event_DeviceLightEvent() throws Exception { + @Alerts("false/false") + void _Event_DeviceLightEvent() throws Exception { test("Event", "DeviceLightEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_DeviceMotionEvent() throws Exception { + @Alerts("true/true") + void _Event_DeviceMotionEvent() throws Exception { test("Event", "DeviceMotionEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_DeviceOrientationEvent() throws Exception { + @Alerts("true/true") + void _Event_DeviceOrientationEvent() throws Exception { test("Event", "DeviceOrientationEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _Event_DeviceProximityEvent() throws Exception { + @Alerts("false/false") + void _Event_DeviceProximityEvent() throws Exception { test("Event", "DeviceProximityEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_DragEvent() throws Exception { + @Alerts("true/false") + void _Event_DragEvent() throws Exception { test("Event", "DragEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_ErrorEvent() throws Exception { + @Alerts("true/true") + void _Event_ErrorEvent() throws Exception { test("Event", "ErrorEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_Event() throws Exception { + @Alerts("true/false") + void _Event_Event() throws Exception { test("Event", "Event"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_FocusEvent() throws Exception { + @Alerts("true/false") + void _Event_FocusEvent() throws Exception { test("Event", "FocusEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_GamepadEvent() throws Exception { + @Alerts("true/true") + void _Event_GamepadEvent() throws Exception { test("Event", "GamepadEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_HashChangeEvent() throws Exception { + @Alerts("true/true") + void _Event_HashChangeEvent() throws Exception { test("Event", "HashChangeEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_IDBVersionChangeEvent() throws Exception { + @Alerts("true/true") + void _Event_IDBVersionChangeEvent() throws Exception { test("Event", "IDBVersionChangeEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_InputEvent() throws Exception { + @Alerts("true/false") + void _Event_InputEvent() throws Exception { test("Event", "InputEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_KeyboardEvent() throws Exception { + @Alerts("true/false") + void _Event_KeyboardEvent() throws Exception { test("Event", "KeyboardEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_MediaEncryptedEvent() throws Exception { + @Alerts("true/true") + void _Event_MediaEncryptedEvent() throws Exception { test("Event", "MediaEncryptedEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true", - FF_ESR = "true") - public void _Event_MediaKeyError() throws Exception { + @Alerts(DEFAULT = "false/false", + FF = "true/true", + FF_ESR = "true/true") + void _Event_MediaKeyError() throws Exception { test("Event", "MediaKeyError"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_MediaKeyMessageEvent() throws Exception { + @Alerts("true/true") + void _Event_MediaKeyMessageEvent() throws Exception { test("Event", "MediaKeyMessageEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_MediaQueryListEvent() throws Exception { + @Alerts("true/true") + void _Event_MediaQueryListEvent() throws Exception { test("Event", "MediaQueryListEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_MediaStreamEvent() throws Exception { + @Alerts("true/true") + void _Event_MediaStreamEvent() throws Exception { test("Event", "MediaStreamEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_MediaStreamTrackEvent() throws Exception { + @Alerts("true/true") + void _Event_MediaStreamTrackEvent() throws Exception { test("Event", "MediaStreamTrackEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_MessageEvent() throws Exception { + @Alerts("true/true") + void _Event_MessageEvent() throws Exception { test("Event", "MessageEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_MIDIConnectionEvent() throws Exception { + @Alerts("true/true") + void _Event_MIDIConnectionEvent() throws Exception { test("Event", "MIDIConnectionEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_MIDIMessageEvent() throws Exception { + @Alerts("true/true") + void _Event_MIDIMessageEvent() throws Exception { test("Event", "MIDIMessageEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_MouseEvent() throws Exception { + @Alerts("true/false") + void _Event_MouseEvent() throws Exception { test("Event", "MouseEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true", - FF_ESR = "true") - public void _Event_MouseScrollEvent() throws Exception { + @Alerts(DEFAULT = "false/false", + FF = "true/false", + FF_ESR = "true/false") + void _Event_MouseScrollEvent() throws Exception { test("Event", "MouseScrollEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _Event_MouseWheelEvent() throws Exception { + @Alerts("false/false") + void _Event_MouseWheelEvent() throws Exception { test("Event", "MouseWheelEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _Event_MSGestureEvent() throws Exception { + @Alerts("false/false") + void _Event_MSGestureEvent() throws Exception { test("Event", "MSGestureEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true", - FF_ESR = "true") - public void _Event_MutationEvent() throws Exception { + @Alerts(DEFAULT = "false/false", + FF_ESR = "true/true") + void _Event_MutationEvent() throws Exception { test("Event", "MutationEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_OfflineAudioCompletionEvent() throws Exception { + @Alerts("true/true") + void _Event_OfflineAudioCompletionEvent() throws Exception { test("Event", "OfflineAudioCompletionEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_PageTransitionEvent() throws Exception { + @Alerts("true/true") + void _Event_PageTransitionEvent() throws Exception { test("Event", "PageTransitionEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_PointerEvent() throws Exception { + @Alerts("true/false") + void _Event_PointerEvent() throws Exception { test("Event", "PointerEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_PopStateEvent() throws Exception { + @Alerts("true/true") + void _Event_PopStateEvent() throws Exception { test("Event", "PopStateEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _Event_PresentationConnectionAvailableEvent() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/true", + EDGE = "true/true") + void _Event_PresentationConnectionAvailableEvent() throws Exception { test("Event", "PresentationConnectionAvailableEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _Event_PresentationConnectionCloseEvent() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/true", + EDGE = "true/true") + void _Event_PresentationConnectionCloseEvent() throws Exception { test("Event", "PresentationConnectionCloseEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_ProgressEvent() throws Exception { + @Alerts("true/true") + void _Event_ProgressEvent() throws Exception { test("Event", "ProgressEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_PromiseRejectionEvent() throws Exception { + @Alerts("true/true") + void _Event_PromiseRejectionEvent() throws Exception { test("Event", "PromiseRejectionEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_RTCDataChannelEvent() throws Exception { + @Alerts("true/true") + void _Event_RTCDataChannelEvent() throws Exception { test("Event", "RTCDataChannelEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_RTCPeerConnectionIceEvent() throws Exception { + @Alerts("true/true") + void _Event_RTCPeerConnectionIceEvent() throws Exception { test("Event", "RTCPeerConnectionIceEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_SecurityPolicyViolationEvent() throws Exception { + @Alerts("true/true") + void _Event_SecurityPolicyViolationEvent() throws Exception { test("Event", "SecurityPolicyViolationEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_SpeechSynthesisEvent() throws Exception { + @Alerts("true/true") + void _Event_SpeechSynthesisEvent() throws Exception { test("Event", "SpeechSynthesisEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_StorageEvent() throws Exception { + @Alerts("true/true") + void _Event_StorageEvent() throws Exception { test("Event", "StorageEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_SubmitEvent() throws Exception { + @Alerts("true/true") + void _Event_SubmitEvent() throws Exception { test("Event", "SubmitEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _Event_SVGZoomEvent() throws Exception { + @Alerts("false/false") + void _Event_SVGZoomEvent() throws Exception { test("Event", "SVGZoomEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - FF_ESR = "false") - public void _Event_TextEvent() throws Exception { + @Alerts(DEFAULT = "true/false", + FF_ESR = "false/false") + void _Event_TextEvent() throws Exception { test("Event", "TextEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true", - FF_ESR = "true") - public void _Event_TimeEvent() throws Exception { + @Alerts(DEFAULT = "false/false", + FF = "true/true", + FF_ESR = "true/true") + void _Event_TimeEvent() throws Exception { test("Event", "TimeEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _Event_TouchEvent() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _Event_TouchEvent() throws Exception { test("Event", "TouchEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_TrackEvent() throws Exception { + @Alerts("true/true") + void _Event_TrackEvent() throws Exception { test("Event", "TrackEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_TransitionEvent() throws Exception { + @Alerts("true/true") + void _Event_TransitionEvent() throws Exception { test("Event", "TransitionEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_UIEvent() throws Exception { + @Alerts("true/true") + void _Event_UIEvent() throws Exception { test("Event", "UIEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _Event_UserProximityEvent() throws Exception { + @Alerts("false/false") + void _Event_UserProximityEvent() throws Exception { test("Event", "UserProximityEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_WebGLContextEvent() throws Exception { + @Alerts("true/true") + void _Event_WebGLContextEvent() throws Exception { test("Event", "WebGLContextEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _Event_webkitSpeechRecognitionError() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/true", + EDGE = "true/true") + void _Event_webkitSpeechRecognitionError() throws Exception { test("Event", "webkitSpeechRecognitionError"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _Event_webkitSpeechRecognitionEvent() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/true", + EDGE = "true/true") + void _Event_webkitSpeechRecognitionEvent() throws Exception { test("Event", "webkitSpeechRecognitionEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_WheelEvent() throws Exception { + @Alerts("true/false") + void _Event_WheelEvent() throws Exception { test("Event", "WheelEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventSource_EventSource() throws Exception { + @Alerts("true/false") + void _EventSource_EventSource() throws Exception { test("EventSource", "EventSource"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_AbortSignal() throws Exception { + @Alerts("true/true") + void _EventTarget_AbortSignal() throws Exception { test("EventTarget", "AbortSignal"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_AnalyserNode() throws Exception { + @Alerts("true/false") + void _EventTarget_AnalyserNode() throws Exception { test("EventTarget", "AnalyserNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_Animation() throws Exception { + @Alerts("true/true") + void _EventTarget_Animation() throws Exception { test("EventTarget", "Animation"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _EventTarget_ApplicationCache() throws Exception { + @Alerts("false/false") + void _EventTarget_ApplicationCache() throws Exception { test("EventTarget", "ApplicationCache"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_Attr() throws Exception { + @Alerts("true/false") + void _EventTarget_Attr() throws Exception { test("EventTarget", "Attr"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_Audio() throws Exception { + @Alerts("true/false") + void _EventTarget_Audio() throws Exception { test("EventTarget", "Audio"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_AudioBufferSourceNode() throws Exception { + @Alerts("true/false") + void _EventTarget_AudioBufferSourceNode() throws Exception { test("EventTarget", "AudioBufferSourceNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_AudioContext() throws Exception { + @Alerts("true/false") + void _EventTarget_AudioContext() throws Exception { test("EventTarget", "AudioContext"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_AudioDestinationNode() throws Exception { + @Alerts("true/false") + void _EventTarget_AudioDestinationNode() throws Exception { test("EventTarget", "AudioDestinationNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_AudioNode() throws Exception { + @Alerts("true/true") + void _EventTarget_AudioNode() throws Exception { test("EventTarget", "AudioNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_AudioScheduledSourceNode() throws Exception { + @Alerts("true/false") + void _EventTarget_AudioScheduledSourceNode() throws Exception { test("EventTarget", "AudioScheduledSourceNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_BaseAudioContext() throws Exception { + @Alerts("true/true") + void _EventTarget_BaseAudioContext() throws Exception { test("EventTarget", "BaseAudioContext"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - FF = "false", - FF_ESR = "false") - public void _EventTarget_BatteryManager() throws Exception { + @Alerts(DEFAULT = "true/true", + FF = "false/false", + FF_ESR = "false/false") + void _EventTarget_BatteryManager() throws Exception { test("EventTarget", "BatteryManager"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_BiquadFilterNode() throws Exception { + @Alerts("true/false") + void _EventTarget_BiquadFilterNode() throws Exception { test("EventTarget", "BiquadFilterNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_BroadcastChannel() throws Exception { + @Alerts("true/true") + void _EventTarget_BroadcastChannel() throws Exception { test("EventTarget", "BroadcastChannel"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true", - FF_ESR = "true") - public void _EventTarget_CanvasCaptureMediaStream() throws Exception { + @Alerts(DEFAULT = "false/false", + FF = "true/false", + FF_ESR = "true/false") + void _EventTarget_CanvasCaptureMediaStream() throws Exception { test("EventTarget", "CanvasCaptureMediaStream"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _EventTarget_CanvasCaptureMediaStreamTrack() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _EventTarget_CanvasCaptureMediaStreamTrack() throws Exception { test("EventTarget", "CanvasCaptureMediaStreamTrack"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_CDATASection() throws Exception { + @Alerts("true/false") + void _EventTarget_CDATASection() throws Exception { test("EventTarget", "CDATASection"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_ChannelMergerNode() throws Exception { + @Alerts("true/false") + void _EventTarget_ChannelMergerNode() throws Exception { test("EventTarget", "ChannelMergerNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_ChannelSplitterNode() throws Exception { + @Alerts("true/false") + void _EventTarget_ChannelSplitterNode() throws Exception { test("EventTarget", "ChannelSplitterNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_CharacterData() throws Exception { + @Alerts("true/false") + void _EventTarget_CharacterData() throws Exception { test("EventTarget", "CharacterData"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_Comment() throws Exception { + @Alerts("true/false") + void _EventTarget_Comment() throws Exception { test("EventTarget", "Comment"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_ConstantSourceNode() throws Exception { + @Alerts("true/false") + void _EventTarget_ConstantSourceNode() throws Exception { test("EventTarget", "ConstantSourceNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_ConvolverNode() throws Exception { + @Alerts("true/false") + void _EventTarget_ConvolverNode() throws Exception { test("EventTarget", "ConvolverNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_DelayNode() throws Exception { + @Alerts("true/false") + void _EventTarget_DelayNode() throws Exception { test("EventTarget", "DelayNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_Document() throws Exception { + @Alerts("true/false") + void _EventTarget_Document() throws Exception { test("EventTarget", "Document"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_DocumentFragment() throws Exception { + @Alerts("true/false") + void _EventTarget_DocumentFragment() throws Exception { test("EventTarget", "DocumentFragment"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_DocumentType() throws Exception { + @Alerts("true/false") + void _EventTarget_DocumentType() throws Exception { test("EventTarget", "DocumentType"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _EventTarget_DOMCursor() throws Exception { + @Alerts("false/false") + void _EventTarget_DOMCursor() throws Exception { test("EventTarget", "DOMCursor"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _EventTarget_DOMRequest() throws Exception { + @Alerts("false/false") + void _EventTarget_DOMRequest() throws Exception { test("EventTarget", "DOMRequest"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_DynamicsCompressorNode() throws Exception { + @Alerts("true/false") + void _EventTarget_DynamicsCompressorNode() throws Exception { test("EventTarget", "DynamicsCompressorNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_Element() throws Exception { + @Alerts("true/false") + void _EventTarget_Element() throws Exception { test("EventTarget", "Element"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_EventSource() throws Exception { + @Alerts("true/true") + void _EventTarget_EventSource() throws Exception { test("EventTarget", "EventSource"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_EventTarget() throws Exception { + @Alerts("true/false") + void _EventTarget_EventTarget() throws Exception { test("EventTarget", "EventTarget"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_FileReader() throws Exception { + @Alerts("true/true") + void _EventTarget_FileReader() throws Exception { test("EventTarget", "FileReader"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true", - FF_ESR = "true") - public void _EventTarget_FontFaceSet() throws Exception { + @Alerts(DEFAULT = "false/false", + FF = "true/true", + FF_ESR = "true/true") + void _EventTarget_FontFaceSet() throws Exception { test("EventTarget", "FontFaceSet"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_GainNode() throws Exception { + @Alerts("true/false") + void _EventTarget_GainNode() throws Exception { test("EventTarget", "GainNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLAnchorElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLAnchorElement() throws Exception { test("EventTarget", "HTMLAnchorElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLAreaElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLAreaElement() throws Exception { test("EventTarget", "HTMLAreaElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLAudioElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLAudioElement() throws Exception { test("EventTarget", "HTMLAudioElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLBaseElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLBaseElement() throws Exception { test("EventTarget", "HTMLBaseElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLBodyElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLBodyElement() throws Exception { test("EventTarget", "HTMLBodyElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLBRElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLBRElement() throws Exception { test("EventTarget", "HTMLBRElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLButtonElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLButtonElement() throws Exception { test("EventTarget", "HTMLButtonElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLCanvasElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLCanvasElement() throws Exception { test("EventTarget", "HTMLCanvasElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLDataElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLDataElement() throws Exception { test("EventTarget", "HTMLDataElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLDataListElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLDataListElement() throws Exception { test("EventTarget", "HTMLDataListElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLDetailsElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLDetailsElement() throws Exception { test("EventTarget", "HTMLDetailsElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLDialogElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLDialogElement() throws Exception { test("EventTarget", "HTMLDialogElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLDirectoryElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLDirectoryElement() throws Exception { test("EventTarget", "HTMLDirectoryElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLDivElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLDivElement() throws Exception { test("EventTarget", "HTMLDivElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLDListElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLDListElement() throws Exception { test("EventTarget", "HTMLDListElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLDocument() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLDocument() throws Exception { test("EventTarget", "HTMLDocument"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLElement() throws Exception { test("EventTarget", "HTMLElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLEmbedElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLEmbedElement() throws Exception { test("EventTarget", "HTMLEmbedElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLFieldSetElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLFieldSetElement() throws Exception { test("EventTarget", "HTMLFieldSetElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLFontElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLFontElement() throws Exception { test("EventTarget", "HTMLFontElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLFormElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLFormElement() throws Exception { test("EventTarget", "HTMLFormElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLFrameElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLFrameElement() throws Exception { test("EventTarget", "HTMLFrameElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLFrameSetElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLFrameSetElement() throws Exception { test("EventTarget", "HTMLFrameSetElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLHeadElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLHeadElement() throws Exception { test("EventTarget", "HTMLHeadElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLHeadingElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLHeadingElement() throws Exception { test("EventTarget", "HTMLHeadingElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLHRElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLHRElement() throws Exception { test("EventTarget", "HTMLHRElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLHtmlElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLHtmlElement() throws Exception { test("EventTarget", "HTMLHtmlElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLIFrameElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLIFrameElement() throws Exception { test("EventTarget", "HTMLIFrameElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLImageElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLImageElement() throws Exception { test("EventTarget", "HTMLImageElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLInputElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLInputElement() throws Exception { test("EventTarget", "HTMLInputElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLLabelElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLLabelElement() throws Exception { test("EventTarget", "HTMLLabelElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLLegendElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLLegendElement() throws Exception { test("EventTarget", "HTMLLegendElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLLIElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLLIElement() throws Exception { test("EventTarget", "HTMLLIElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLLinkElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLLinkElement() throws Exception { test("EventTarget", "HTMLLinkElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLMapElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLMapElement() throws Exception { test("EventTarget", "HTMLMapElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLMarqueeElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLMarqueeElement() throws Exception { test("EventTarget", "HTMLMarqueeElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLMediaElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLMediaElement() throws Exception { test("EventTarget", "HTMLMediaElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLMenuElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLMenuElement() throws Exception { test("EventTarget", "HTMLMenuElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _EventTarget_HTMLMenuItemElement() throws Exception { + @Alerts("false/false") + void _EventTarget_HTMLMenuItemElement() throws Exception { test("EventTarget", "HTMLMenuItemElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLMetaElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLMetaElement() throws Exception { test("EventTarget", "HTMLMetaElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLMeterElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLMeterElement() throws Exception { test("EventTarget", "HTMLMeterElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLModElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLModElement() throws Exception { test("EventTarget", "HTMLModElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLObjectElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLObjectElement() throws Exception { test("EventTarget", "HTMLObjectElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLOListElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLOListElement() throws Exception { test("EventTarget", "HTMLOListElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLOptGroupElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLOptGroupElement() throws Exception { test("EventTarget", "HTMLOptGroupElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLOptionElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLOptionElement() throws Exception { test("EventTarget", "HTMLOptionElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLOutputElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLOutputElement() throws Exception { test("EventTarget", "HTMLOutputElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLParagraphElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLParagraphElement() throws Exception { test("EventTarget", "HTMLParagraphElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLParamElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLParamElement() throws Exception { test("EventTarget", "HTMLParamElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLPictureElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLPictureElement() throws Exception { test("EventTarget", "HTMLPictureElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLPreElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLPreElement() throws Exception { test("EventTarget", "HTMLPreElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLProgressElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLProgressElement() throws Exception { test("EventTarget", "HTMLProgressElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLQuoteElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLQuoteElement() throws Exception { test("EventTarget", "HTMLQuoteElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLScriptElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLScriptElement() throws Exception { test("EventTarget", "HTMLScriptElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLSelectElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLSelectElement() throws Exception { test("EventTarget", "HTMLSelectElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLSlotElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLSlotElement() throws Exception { test("EventTarget", "HTMLSlotElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLSourceElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLSourceElement() throws Exception { test("EventTarget", "HTMLSourceElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLSpanElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLSpanElement() throws Exception { test("EventTarget", "HTMLSpanElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLStyleElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLStyleElement() throws Exception { test("EventTarget", "HTMLStyleElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLTableCaptionElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLTableCaptionElement() throws Exception { test("EventTarget", "HTMLTableCaptionElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLTableCellElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLTableCellElement() throws Exception { test("EventTarget", "HTMLTableCellElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLTableColElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLTableColElement() throws Exception { test("EventTarget", "HTMLTableColElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLTableElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLTableElement() throws Exception { test("EventTarget", "HTMLTableElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLTableRowElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLTableRowElement() throws Exception { test("EventTarget", "HTMLTableRowElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLTableSectionElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLTableSectionElement() throws Exception { test("EventTarget", "HTMLTableSectionElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLTemplateElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLTemplateElement() throws Exception { test("EventTarget", "HTMLTemplateElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLTextAreaElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLTextAreaElement() throws Exception { test("EventTarget", "HTMLTextAreaElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLTimeElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLTimeElement() throws Exception { test("EventTarget", "HTMLTimeElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLTitleElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLTitleElement() throws Exception { test("EventTarget", "HTMLTitleElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLTrackElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLTrackElement() throws Exception { test("EventTarget", "HTMLTrackElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLUListElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLUListElement() throws Exception { test("EventTarget", "HTMLUListElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLUnknownElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLUnknownElement() throws Exception { test("EventTarget", "HTMLUnknownElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_HTMLVideoElement() throws Exception { + @Alerts("true/false") + void _EventTarget_HTMLVideoElement() throws Exception { test("EventTarget", "HTMLVideoElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_IDBDatabase() throws Exception { + @Alerts("true/true") + void _EventTarget_IDBDatabase() throws Exception { test("EventTarget", "IDBDatabase"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _EventTarget_IDBMutableFile() throws Exception { + @Alerts("false/false") + void _EventTarget_IDBMutableFile() throws Exception { test("EventTarget", "IDBMutableFile"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_IDBOpenDBRequest() throws Exception { + @Alerts("true/false") + void _EventTarget_IDBOpenDBRequest() throws Exception { test("EventTarget", "IDBOpenDBRequest"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_IDBRequest() throws Exception { + @Alerts("true/true") + void _EventTarget_IDBRequest() throws Exception { test("EventTarget", "IDBRequest"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_IDBTransaction() throws Exception { + @Alerts("true/true") + void _EventTarget_IDBTransaction() throws Exception { test("EventTarget", "IDBTransaction"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_IIRFilterNode() throws Exception { + @Alerts("true/false") + void _EventTarget_IIRFilterNode() throws Exception { test("EventTarget", "IIRFilterNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_Image() throws Exception { + @Alerts("true/false") + void _EventTarget_Image() throws Exception { test("EventTarget", "Image"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _EventTarget_LocalMediaStream() throws Exception { + @Alerts("false/false") + void _EventTarget_LocalMediaStream() throws Exception { test("EventTarget", "LocalMediaStream"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_MediaDevices() throws Exception { + @Alerts("true/true") + void _EventTarget_MediaDevices() throws Exception { test("EventTarget", "MediaDevices"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_MediaElementAudioSourceNode() throws Exception { + @Alerts("true/false") + void _EventTarget_MediaElementAudioSourceNode() throws Exception { test("EventTarget", "MediaElementAudioSourceNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_MediaKeySession() throws Exception { + @Alerts("true/true") + void _EventTarget_MediaKeySession() throws Exception { test("EventTarget", "MediaKeySession"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_MediaQueryList() throws Exception { + @Alerts("true/true") + void _EventTarget_MediaQueryList() throws Exception { test("EventTarget", "MediaQueryList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_MediaRecorder() throws Exception { + @Alerts("true/true") + void _EventTarget_MediaRecorder() throws Exception { test("EventTarget", "MediaRecorder"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_MediaSource() throws Exception { + @Alerts("true/true") + void _EventTarget_MediaSource() throws Exception { test("EventTarget", "MediaSource"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_MediaStream() throws Exception { + @Alerts("true/true") + void _EventTarget_MediaStream() throws Exception { test("EventTarget", "MediaStream"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_MediaStreamAudioDestinationNode() throws Exception { + @Alerts("true/false") + void _EventTarget_MediaStreamAudioDestinationNode() throws Exception { test("EventTarget", "MediaStreamAudioDestinationNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_MediaStreamAudioSourceNode() throws Exception { + @Alerts("true/false") + void _EventTarget_MediaStreamAudioSourceNode() throws Exception { test("EventTarget", "MediaStreamAudioSourceNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_MediaStreamTrack() throws Exception { + @Alerts("true/true") + void _EventTarget_MediaStreamTrack() throws Exception { test("EventTarget", "MediaStreamTrack"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_MessagePort() throws Exception { + @Alerts("true/true") + void _EventTarget_MessagePort() throws Exception { test("EventTarget", "MessagePort"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_MIDIAccess() throws Exception { + @Alerts("true/true") + void _EventTarget_MIDIAccess() throws Exception { test("EventTarget", "MIDIAccess"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_MIDIInput() throws Exception { + @Alerts("true/false") + void _EventTarget_MIDIInput() throws Exception { test("EventTarget", "MIDIInput"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_MIDIOutput() throws Exception { + @Alerts("true/false") + void _EventTarget_MIDIOutput() throws Exception { test("EventTarget", "MIDIOutput"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_MIDIPort() throws Exception { + @Alerts("true/true") + void _EventTarget_MIDIPort() throws Exception { test("EventTarget", "MIDIPort"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _EventTarget_mozRTCPeerConnection() throws Exception { + @Alerts("false/false") + void _EventTarget_mozRTCPeerConnection() throws Exception { test("EventTarget", "mozRTCPeerConnection"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _EventTarget_NetworkInformation() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/true", + EDGE = "true/true") + void _EventTarget_NetworkInformation() throws Exception { test("EventTarget", "NetworkInformation"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_Node() throws Exception { + @Alerts("true/true") + void _EventTarget_Node() throws Exception { test("EventTarget", "Node"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_Notification() throws Exception { + @Alerts("true/true") + void _EventTarget_Notification() throws Exception { test("EventTarget", "Notification"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_OfflineAudioContext() throws Exception { + @Alerts("true/false") + void _EventTarget_OfflineAudioContext() throws Exception { test("EventTarget", "OfflineAudioContext"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _EventTarget_OfflineResourceList() throws Exception { + @Alerts("false/false") + void _EventTarget_OfflineResourceList() throws Exception { test("EventTarget", "OfflineResourceList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_Option() throws Exception { + @Alerts("true/false") + void _EventTarget_Option() throws Exception { test("EventTarget", "Option"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_OscillatorNode() throws Exception { + @Alerts("true/false") + void _EventTarget_OscillatorNode() throws Exception { test("EventTarget", "OscillatorNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_PannerNode() throws Exception { + @Alerts("true/false") + void _EventTarget_PannerNode() throws Exception { test("EventTarget", "PannerNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _EventTarget_PaymentRequest() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/true", + EDGE = "true/true") + void _EventTarget_PaymentRequest() throws Exception { test("EventTarget", "PaymentRequest"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _EventTarget_PaymentResponse() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/true", + EDGE = "true/true") + void _EventTarget_PaymentResponse() throws Exception { test("EventTarget", "PaymentResponse"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_Performance() throws Exception { + @Alerts("true/true") + void _EventTarget_Performance() throws Exception { test("EventTarget", "Performance"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_PermissionStatus() throws Exception { + @Alerts("true/true") + void _EventTarget_PermissionStatus() throws Exception { test("EventTarget", "PermissionStatus"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _EventTarget_PresentationAvailability() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/true", + EDGE = "true/true") + void _EventTarget_PresentationAvailability() throws Exception { test("EventTarget", "PresentationAvailability"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _EventTarget_PresentationConnection() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/true", + EDGE = "true/true") + void _EventTarget_PresentationConnection() throws Exception { test("EventTarget", "PresentationConnection"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _EventTarget_PresentationRequest() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/true", + EDGE = "true/true") + void _EventTarget_PresentationRequest() throws Exception { test("EventTarget", "PresentationRequest"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_ProcessingInstruction() throws Exception { + @Alerts("true/false") + void _EventTarget_ProcessingInstruction() throws Exception { test("EventTarget", "ProcessingInstruction"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _EventTarget_RemotePlayback() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/true", + EDGE = "true/true") + void _EventTarget_RemotePlayback() throws Exception { test("EventTarget", "RemotePlayback"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_RTCPeerConnection() throws Exception { + @Alerts("true/true") + void _EventTarget_RTCPeerConnection() throws Exception { test("EventTarget", "RTCPeerConnection"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_RTCSctpTransport() throws Exception { + @Alerts("true/true") + void _EventTarget_RTCSctpTransport() throws Exception { test("EventTarget", "RTCSctpTransport"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_Screen() throws Exception { + @Alerts("true/true") + void _EventTarget_Screen() throws Exception { test("EventTarget", "Screen"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_ScreenOrientation() throws Exception { + @Alerts("true/true") + void _EventTarget_ScreenOrientation() throws Exception { test("EventTarget", "ScreenOrientation"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_ScriptProcessorNode() throws Exception { + @Alerts("true/false") + void _EventTarget_ScriptProcessorNode() throws Exception { test("EventTarget", "ScriptProcessorNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_ServiceWorker() throws Exception { + @Alerts("true/true") + void _EventTarget_ServiceWorker() throws Exception { test("EventTarget", "ServiceWorker"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_ServiceWorkerContainer() throws Exception { + @Alerts("true/true") + void _EventTarget_ServiceWorkerContainer() throws Exception { test("EventTarget", "ServiceWorkerContainer"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_ServiceWorkerRegistration() throws Exception { + @Alerts("true/true") + void _EventTarget_ServiceWorkerRegistration() throws Exception { test("EventTarget", "ServiceWorkerRegistration"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_ShadowRoot() throws Exception { + @Alerts("true/false") + void _EventTarget_ShadowRoot() throws Exception { test("EventTarget", "ShadowRoot"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SharedWorker() throws Exception { + @Alerts("true/true") + void _EventTarget_SharedWorker() throws Exception { test("EventTarget", "SharedWorker"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SourceBuffer() throws Exception { + @Alerts("true/true") + void _EventTarget_SourceBuffer() throws Exception { test("EventTarget", "SourceBuffer"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SourceBufferList() throws Exception { + @Alerts("true/true") + void _EventTarget_SourceBufferList() throws Exception { test("EventTarget", "SourceBufferList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SpeechSynthesis() throws Exception { + @Alerts("true/true") + void _EventTarget_SpeechSynthesis() throws Exception { test("EventTarget", "SpeechSynthesis"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SpeechSynthesisUtterance() throws Exception { + @Alerts("true/true") + void _EventTarget_SpeechSynthesisUtterance() throws Exception { test("EventTarget", "SpeechSynthesisUtterance"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_StereoPannerNode() throws Exception { + @Alerts("true/false") + void _EventTarget_StereoPannerNode() throws Exception { test("EventTarget", "StereoPannerNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - @HtmlUnitNYI(CHROME = "false", - EDGE = "false") - public void _EventTarget_StorageManager() throws Exception { + @Alerts("false/false") + void _EventTarget_StorageManager() throws Exception { test("EventTarget", "StorageManager"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGAElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGAElement() throws Exception { test("EventTarget", "SVGAElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGAnimateElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGAnimateElement() throws Exception { test("EventTarget", "SVGAnimateElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGAnimateMotionElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGAnimateMotionElement() throws Exception { test("EventTarget", "SVGAnimateMotionElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGAnimateTransformElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGAnimateTransformElement() throws Exception { test("EventTarget", "SVGAnimateTransformElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGAnimationElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGAnimationElement() throws Exception { test("EventTarget", "SVGAnimationElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGCircleElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGCircleElement() throws Exception { test("EventTarget", "SVGCircleElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGClipPathElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGClipPathElement() throws Exception { test("EventTarget", "SVGClipPathElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGComponentTransferFunctionElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGComponentTransferFunctionElement() throws Exception { test("EventTarget", "SVGComponentTransferFunctionElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGDefsElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGDefsElement() throws Exception { test("EventTarget", "SVGDefsElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGDescElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGDescElement() throws Exception { test("EventTarget", "SVGDescElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGElement() throws Exception { + @Alerts("false/false") + void _EventTarget_SVGDiscardElement() throws Exception { + test("EventTarget", "SVGDiscardElement"); + } + + @Alerts("true/false") + void _EventTarget_SVGElement() throws Exception { test("EventTarget", "SVGElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGEllipseElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGEllipseElement() throws Exception { test("EventTarget", "SVGEllipseElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFEBlendElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFEBlendElement() throws Exception { test("EventTarget", "SVGFEBlendElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFEColorMatrixElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFEColorMatrixElement() throws Exception { test("EventTarget", "SVGFEColorMatrixElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFEComponentTransferElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFEComponentTransferElement() throws Exception { test("EventTarget", "SVGFEComponentTransferElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFECompositeElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFECompositeElement() throws Exception { test("EventTarget", "SVGFECompositeElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFEConvolveMatrixElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFEConvolveMatrixElement() throws Exception { test("EventTarget", "SVGFEConvolveMatrixElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFEDiffuseLightingElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFEDiffuseLightingElement() throws Exception { test("EventTarget", "SVGFEDiffuseLightingElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFEDisplacementMapElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFEDisplacementMapElement() throws Exception { test("EventTarget", "SVGFEDisplacementMapElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFEDistantLightElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFEDistantLightElement() throws Exception { test("EventTarget", "SVGFEDistantLightElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFEDropShadowElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFEDropShadowElement() throws Exception { test("EventTarget", "SVGFEDropShadowElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFEFloodElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFEFloodElement() throws Exception { test("EventTarget", "SVGFEFloodElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFEFuncAElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFEFuncAElement() throws Exception { test("EventTarget", "SVGFEFuncAElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFEFuncBElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFEFuncBElement() throws Exception { test("EventTarget", "SVGFEFuncBElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFEFuncGElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFEFuncGElement() throws Exception { test("EventTarget", "SVGFEFuncGElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFEFuncRElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFEFuncRElement() throws Exception { test("EventTarget", "SVGFEFuncRElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFEGaussianBlurElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFEGaussianBlurElement() throws Exception { test("EventTarget", "SVGFEGaussianBlurElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFEImageElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFEImageElement() throws Exception { test("EventTarget", "SVGFEImageElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFEMergeElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFEMergeElement() throws Exception { test("EventTarget", "SVGFEMergeElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFEMergeNodeElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFEMergeNodeElement() throws Exception { test("EventTarget", "SVGFEMergeNodeElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFEMorphologyElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFEMorphologyElement() throws Exception { test("EventTarget", "SVGFEMorphologyElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFEOffsetElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFEOffsetElement() throws Exception { test("EventTarget", "SVGFEOffsetElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFEPointLightElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFEPointLightElement() throws Exception { test("EventTarget", "SVGFEPointLightElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFESpecularLightingElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFESpecularLightingElement() throws Exception { test("EventTarget", "SVGFESpecularLightingElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFESpotLightElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFESpotLightElement() throws Exception { test("EventTarget", "SVGFESpotLightElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFETileElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFETileElement() throws Exception { test("EventTarget", "SVGFETileElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFETurbulenceElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFETurbulenceElement() throws Exception { test("EventTarget", "SVGFETurbulenceElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGFilterElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGFilterElement() throws Exception { test("EventTarget", "SVGFilterElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGForeignObjectElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGForeignObjectElement() throws Exception { test("EventTarget", "SVGForeignObjectElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGGElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGGElement() throws Exception { test("EventTarget", "SVGGElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGGeometryElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGGeometryElement() throws Exception { test("EventTarget", "SVGGeometryElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGGradientElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGGradientElement() throws Exception { test("EventTarget", "SVGGradientElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGGraphicsElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGGraphicsElement() throws Exception { test("EventTarget", "SVGGraphicsElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGImageElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGImageElement() throws Exception { test("EventTarget", "SVGImageElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGLinearGradientElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGLinearGradientElement() throws Exception { test("EventTarget", "SVGLinearGradientElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGLineElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGLineElement() throws Exception { test("EventTarget", "SVGLineElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGMarkerElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGMarkerElement() throws Exception { test("EventTarget", "SVGMarkerElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGMaskElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGMaskElement() throws Exception { test("EventTarget", "SVGMaskElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGMetadataElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGMetadataElement() throws Exception { test("EventTarget", "SVGMetadataElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGMPathElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGMPathElement() throws Exception { test("EventTarget", "SVGMPathElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGPathElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGPathElement() throws Exception { test("EventTarget", "SVGPathElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGPatternElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGPatternElement() throws Exception { test("EventTarget", "SVGPatternElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGPolygonElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGPolygonElement() throws Exception { test("EventTarget", "SVGPolygonElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGPolylineElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGPolylineElement() throws Exception { test("EventTarget", "SVGPolylineElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGRadialGradientElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGRadialGradientElement() throws Exception { test("EventTarget", "SVGRadialGradientElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGRectElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGRectElement() throws Exception { test("EventTarget", "SVGRectElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGScriptElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGScriptElement() throws Exception { test("EventTarget", "SVGScriptElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGSetElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGSetElement() throws Exception { test("EventTarget", "SVGSetElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGStopElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGStopElement() throws Exception { test("EventTarget", "SVGStopElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGStyleElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGStyleElement() throws Exception { test("EventTarget", "SVGStyleElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGSVGElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGSVGElement() throws Exception { test("EventTarget", "SVGSVGElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGSwitchElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGSwitchElement() throws Exception { test("EventTarget", "SVGSwitchElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGSymbolElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGSymbolElement() throws Exception { test("EventTarget", "SVGSymbolElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGTextContentElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGTextContentElement() throws Exception { test("EventTarget", "SVGTextContentElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGTextElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGTextElement() throws Exception { test("EventTarget", "SVGTextElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGTextPathElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGTextPathElement() throws Exception { test("EventTarget", "SVGTextPathElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGTextPositioningElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGTextPositioningElement() throws Exception { test("EventTarget", "SVGTextPositioningElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGTitleElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGTitleElement() throws Exception { test("EventTarget", "SVGTitleElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGTSpanElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGTSpanElement() throws Exception { test("EventTarget", "SVGTSpanElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGUseElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGUseElement() throws Exception { test("EventTarget", "SVGUseElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_SVGViewElement() throws Exception { + @Alerts("true/false") + void _EventTarget_SVGViewElement() throws Exception { test("EventTarget", "SVGViewElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_Text() throws Exception { + @Alerts("true/false") + void _EventTarget_Text() throws Exception { test("EventTarget", "Text"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_TextTrack() throws Exception { + @Alerts("true/true") + void _EventTarget_TextTrack() throws Exception { test("EventTarget", "TextTrack"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_TextTrackCue() throws Exception { + @Alerts("true/true") + void _EventTarget_TextTrackCue() throws Exception { test("EventTarget", "TextTrackCue"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_TextTrackList() throws Exception { + @Alerts("true/true") + void _EventTarget_TextTrackList() throws Exception { test("EventTarget", "TextTrackList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_VTTCue() throws Exception { + @Alerts("true/false") + void _EventTarget_VTTCue() throws Exception { test("EventTarget", "VTTCue"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_WaveShaperNode() throws Exception { + @Alerts("true/false") + void _EventTarget_WaveShaperNode() throws Exception { test("EventTarget", "WaveShaperNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _EventTarget_webkitMediaStream() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/true", + EDGE = "true/true") + void _EventTarget_webkitMediaStream() throws Exception { test("EventTarget", "webkitMediaStream"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _EventTarget_webkitRTCPeerConnection() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/true", + EDGE = "true/true") + void _EventTarget_webkitRTCPeerConnection() throws Exception { test("EventTarget", "webkitRTCPeerConnection"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _EventTarget_webkitSpeechRecognition() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/true", + EDGE = "true/true") + void _EventTarget_webkitSpeechRecognition() throws Exception { test("EventTarget", "webkitSpeechRecognition"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_WebSocket() throws Exception { + @Alerts("true/true") + void _EventTarget_WebSocket() throws Exception { test("EventTarget", "WebSocket"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_Window() throws Exception { + @Alerts("true/true") + void _EventTarget_Window() throws Exception { test("EventTarget", "Window"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_Worker() throws Exception { + @Alerts("true/true") + void _EventTarget_Worker() throws Exception { test("EventTarget", "Worker"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_XMLDocument() throws Exception { + @Alerts("true/false") + void _EventTarget_XMLDocument() throws Exception { test("EventTarget", "XMLDocument"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_XMLHttpRequest() throws Exception { + @Alerts("true/false") + void _EventTarget_XMLHttpRequest() throws Exception { test("EventTarget", "XMLHttpRequest"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_XMLHttpRequestEventTarget() throws Exception { + @Alerts("true/true") + void _EventTarget_XMLHttpRequestEventTarget() throws Exception { test("EventTarget", "XMLHttpRequestEventTarget"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _EventTarget_XMLHttpRequestUpload() throws Exception { + @Alerts("true/false") + void _EventTarget_XMLHttpRequestUpload() throws Exception { test("EventTarget", "XMLHttpRequestUpload"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Event_SpeechSynthesisErrorEvent() throws Exception { + @Alerts("true/false") + void _Event_SpeechSynthesisErrorEvent() throws Exception { test("Event", "SpeechSynthesisErrorEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _EXT_texture_filter_anisotropic_EXT_texture_filter_anisotropic() throws Exception { + @Alerts("false/false") + void _EXT_texture_filter_anisotropic_EXT_texture_filter_anisotropic() throws Exception { test("EXT_texture_filter_anisotropic", "EXT_texture_filter_anisotropic"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _External_External() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _External_External() throws Exception { test("External", "External"); } } diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfFTest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfFTest.java index 569716dad66..6b1f1067ce1 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfFTest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfFTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,11 +16,8 @@ import java.util.Collection; -import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized.Parameters; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.params.provider.Arguments; /** * Tests two Host classes, if one prototype is parent of another. @@ -30,7 +27,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserParameterizedRunner.class) public class HostParentOfFTest extends HostParentOf { /** @@ -38,254 +34,153 @@ public class HostParentOfFTest extends HostParentOf { * @return the parameterized data * @throws Exception if an error occurs */ - @Parameters - public static Collection data() throws Exception { + public static Collection data() throws Exception { return HostParentOf.data(input -> { final char ch = Character.toUpperCase(input.charAt(0)); return ch >= 'F' && ch <= 'G'; }); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _FederatedCredential_FederatedCredential() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _FederatedCredential_FederatedCredential() throws Exception { test("FederatedCredential", "FederatedCredential"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _File_File() throws Exception { + @Alerts("true/false") + void _File_File() throws Exception { test("File", "File"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _FileList_FileList() throws Exception { + @Alerts("true/false") + void _FileList_FileList() throws Exception { test("FileList", "FileList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _FileReader_FileReader() throws Exception { + @Alerts("true/false") + void _FileReader_FileReader() throws Exception { test("FileReader", "FileReader"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true", - FF_ESR = "true") - public void _FileSystem_FileSystem() throws Exception { + @Alerts(DEFAULT = "false/false", + FF = "true/false", + FF_ESR = "true/false") + void _FileSystem_FileSystem() throws Exception { test("FileSystem", "FileSystem"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true", - FF_ESR = "true") - public void _FileSystemDirectoryEntry_FileSystemDirectoryEntry() throws Exception { + @Alerts(DEFAULT = "false/false", + FF = "true/false", + FF_ESR = "true/false") + void _FileSystemDirectoryEntry_FileSystemDirectoryEntry() throws Exception { test("FileSystemDirectoryEntry", "FileSystemDirectoryEntry"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true", - FF_ESR = "true") - public void _FileSystemDirectoryReader_FileSystemDirectoryReader() throws Exception { + @Alerts(DEFAULT = "false/false", + FF = "true/false", + FF_ESR = "true/false") + void _FileSystemDirectoryReader_FileSystemDirectoryReader() throws Exception { test("FileSystemDirectoryReader", "FileSystemDirectoryReader"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true", - FF_ESR = "true") - public void _FileSystemEntry_FileSystemDirectoryEntry() throws Exception { + @Alerts(DEFAULT = "false/false", + FF = "true/true", + FF_ESR = "true/true") + void _FileSystemEntry_FileSystemDirectoryEntry() throws Exception { test("FileSystemEntry", "FileSystemDirectoryEntry"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true", - FF_ESR = "true") - public void _FileSystemEntry_FileSystemEntry() throws Exception { + @Alerts(DEFAULT = "false/false", + FF = "true/false", + FF_ESR = "true/false") + void _FileSystemEntry_FileSystemEntry() throws Exception { test("FileSystemEntry", "FileSystemEntry"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true", - FF_ESR = "true") - public void _FileSystemEntry_FileSystemFileEntry() throws Exception { + @Alerts(DEFAULT = "false/false", + FF = "true/true", + FF_ESR = "true/true") + void _FileSystemEntry_FileSystemFileEntry() throws Exception { test("FileSystemEntry", "FileSystemFileEntry"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true", - FF_ESR = "true") - public void _FileSystemFileEntry_FileSystemFileEntry() throws Exception { + @Alerts(DEFAULT = "false/false", + FF = "true/false", + FF_ESR = "true/false") + void _FileSystemFileEntry_FileSystemFileEntry() throws Exception { test("FileSystemFileEntry", "FileSystemFileEntry"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Float32Array_Float32Array() throws Exception { + @Alerts("true/false") + void _Float32Array_Float32Array() throws Exception { test("Float32Array", "Float32Array"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Float64Array_Float64Array() throws Exception { + @Alerts("true/false") + void _Float64Array_Float64Array() throws Exception { test("Float64Array", "Float64Array"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _FocusEvent_FocusEvent() throws Exception { + @Alerts("true/false") + void _FocusEvent_FocusEvent() throws Exception { test("FocusEvent", "FocusEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _FontFace_FontFace() throws Exception { + @Alerts("true/false") + void _FontFace_FontFace() throws Exception { test("FontFace", "FontFace"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true", - FF_ESR = "true") - public void _FontFaceSet_FontFaceSet() throws Exception { + @Alerts(DEFAULT = "false/false", + FF = "true/false", + FF_ESR = "true/false") + void _FontFaceSet_FontFaceSet() throws Exception { test("FontFaceSet", "FontFaceSet"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _FormData_FormData() throws Exception { + @Alerts("true/false") + void _FormData_FormData() throws Exception { test("FormData", "FormData"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _GainNode_GainNode() throws Exception { + @Alerts("true/false") + void _GainNode_GainNode() throws Exception { test("GainNode", "GainNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Gamepad_Gamepad() throws Exception { + @Alerts("true/false") + void _Gamepad_Gamepad() throws Exception { test("Gamepad", "Gamepad"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _GamepadButton_GamepadButton() throws Exception { + @Alerts("true/false") + void _GamepadButton_GamepadButton() throws Exception { test("GamepadButton", "GamepadButton"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _GamepadEvent_GamepadEvent() throws Exception { + @Alerts("true/false") + void _GamepadEvent_GamepadEvent() throws Exception { test("GamepadEvent", "GamepadEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Geolocation_Geolocation() throws Exception { + @Alerts("true/false") + void _Geolocation_Geolocation() throws Exception { test("Geolocation", "Geolocation"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _GeolocationCoordinates_GeolocationCoordinates() throws Exception { + @Alerts("true/false") + void _GeolocationCoordinates_GeolocationCoordinates() throws Exception { test("GeolocationCoordinates", "GeolocationCoordinates"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _GeolocationPosition_GeolocationPosition() throws Exception { + @Alerts("true/false") + void _GeolocationPosition_GeolocationPosition() throws Exception { test("GeolocationPosition", "GeolocationPosition"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _GeolocationPositionError_GeolocationPositionError() throws Exception { + @Alerts("true/false") + void _GeolocationPositionError_GeolocationPositionError() throws Exception { test("GeolocationPositionError", "GeolocationPositionError"); } } diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfHTest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfHTest.java index c0eb78f9db2..066d4b7d6dc 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfHTest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfHTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,12 +16,9 @@ import java.util.Collection; -import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized.Parameters; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; +import org.junit.jupiter.params.provider.Arguments; /** * Tests two Host classes, if one prototype is parent of another. @@ -31,7 +28,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserParameterizedRunner.class) public class HostParentOfHTest extends HostParentOf { /** @@ -39,1705 +35,955 @@ public class HostParentOfHTest extends HostParentOf { * @return the parameterized data * @throws Exception if an error occurs */ - @Parameters - public static Collection data() throws Exception { + public static Collection data() throws Exception { return HostParentOf.data(input -> { final char ch = Character.toUpperCase(input.charAt(0)); return ch == 'H'; }); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HashChangeEvent_HashChangeEvent() throws Exception { + @Alerts("true/false") + void _HashChangeEvent_HashChangeEvent() throws Exception { test("HashChangeEvent", "HashChangeEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Headers_Headers() throws Exception { + @Alerts("true/false") + void _Headers_Headers() throws Exception { test("Headers", "Headers"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _History_History() throws Exception { + @Alerts("true/false") + void _History_History() throws Exception { test("History", "History"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLAllCollection_HTMLAllCollection() throws Exception { + @Alerts("true/false") + void _HTMLAllCollection_HTMLAllCollection() throws Exception { test("HTMLAllCollection", "HTMLAllCollection"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLAnchorElement_HTMLAnchorElement() throws Exception { + @Alerts("true/false") + void _HTMLAnchorElement_HTMLAnchorElement() throws Exception { test("HTMLAnchorElement", "HTMLAnchorElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLAppletElement_HTMLAppletElement() throws Exception { + @Alerts("false/false") + void _HTMLAppletElement_HTMLAppletElement() throws Exception { test("HTMLAppletElement", "HTMLAppletElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLAreaElement_HTMLAreaElement() throws Exception { + @Alerts("true/false") + void _HTMLAreaElement_HTMLAreaElement() throws Exception { test("HTMLAreaElement", "HTMLAreaElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLAudioElement_Audio() throws Exception { + @Alerts("true/false") + @HtmlUnitNYI(CHROME = "true/true", + EDGE = "true/true", + FF = "true/true", + FF_ESR = "true/true") + void _HTMLAudioElement_Audio() throws Exception { test("HTMLAudioElement", "Audio"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLAudioElement_HTMLAudioElement() throws Exception { + @Alerts("true/false") + void _HTMLAudioElement_HTMLAudioElement() throws Exception { test("HTMLAudioElement", "HTMLAudioElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLBaseElement_HTMLBaseElement() throws Exception { + @Alerts("true/false") + void _HTMLBaseElement_HTMLBaseElement() throws Exception { test("HTMLBaseElement", "HTMLBaseElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLBaseFontElement_HTMLBaseFontElement() throws Exception { + @Alerts("false/false") + void _HTMLBaseFontElement_HTMLBaseFontElement() throws Exception { test("HTMLBaseFontElement", "HTMLBaseFontElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLBGSoundElement_HTMLBGSoundElement() throws Exception { + @Alerts("false/false") + void _HTMLBGSoundElement_HTMLBGSoundElement() throws Exception { test("HTMLBGSoundElement", "HTMLBGSoundElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLBlockElement_HTMLBlockElement() throws Exception { + @Alerts("false/false") + void _HTMLBlockElement_HTMLBlockElement() throws Exception { test("HTMLBlockElement", "HTMLBlockElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLBodyElement_HTMLBodyElement() throws Exception { + @Alerts("true/false") + void _HTMLBodyElement_HTMLBodyElement() throws Exception { test("HTMLBodyElement", "HTMLBodyElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLBRElement_HTMLBRElement() throws Exception { + @Alerts("true/false") + void _HTMLBRElement_HTMLBRElement() throws Exception { test("HTMLBRElement", "HTMLBRElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLButtonElement_HTMLButtonElement() throws Exception { + @Alerts("true/false") + void _HTMLButtonElement_HTMLButtonElement() throws Exception { test("HTMLButtonElement", "HTMLButtonElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLCanvasElement_HTMLCanvasElement() throws Exception { + @Alerts("true/false") + void _HTMLCanvasElement_HTMLCanvasElement() throws Exception { test("HTMLCanvasElement", "HTMLCanvasElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - @HtmlUnitNYI(CHROME = "true", - EDGE = "true", - FF = "true", - FF_ESR = "true") - public void _HTMLCollection_HTMLAllCollection() throws Exception { + @Alerts("false/false") + void _HTMLCollection_HTMLAllCollection() throws Exception { test("HTMLCollection", "HTMLAllCollection"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLCollection_HTMLCollection() throws Exception { + @Alerts("true/false") + void _HTMLCollection_HTMLCollection() throws Exception { test("HTMLCollection", "HTMLCollection"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLCollection_HTMLFormControlsCollection() throws Exception { + @Alerts("true/true") + void _HTMLCollection_HTMLFormControlsCollection() throws Exception { test("HTMLCollection", "HTMLFormControlsCollection"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - @HtmlUnitNYI(CHROME = "false", - EDGE = "false", - FF = "false", - FF_ESR = "false") - public void _HTMLCollection_HTMLOptionsCollection() throws Exception { + @Alerts("true/true") + @HtmlUnitNYI(CHROME = "false/false", + EDGE = "false/false", + FF = "false/false", + FF_ESR = "false/false") + void _HTMLCollection_HTMLOptionsCollection() throws Exception { test("HTMLCollection", "HTMLOptionsCollection"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLDataElement_HTMLDataElement() throws Exception { + @Alerts("true/false") + void _HTMLDataElement_HTMLDataElement() throws Exception { test("HTMLDataElement", "HTMLDataElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLDataListElement_HTMLDataListElement() throws Exception { + @Alerts("true/false") + void _HTMLDataListElement_HTMLDataListElement() throws Exception { test("HTMLDataListElement", "HTMLDataListElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLDDElement_HTMLDDElement() throws Exception { + @Alerts("false/false") + void _HTMLDDElement_HTMLDDElement() throws Exception { test("HTMLDDElement", "HTMLDDElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLDetailsElement_HTMLDetailsElement() throws Exception { + @Alerts("true/false") + void _HTMLDetailsElement_HTMLDetailsElement() throws Exception { test("HTMLDetailsElement", "HTMLDetailsElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLDialogElement_HTMLDialogElement() throws Exception { + @Alerts("true/false") + void _HTMLDialogElement_HTMLDialogElement() throws Exception { test("HTMLDialogElement", "HTMLDialogElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLDirectoryElement_HTMLDirectoryElement() throws Exception { + @Alerts("true/false") + void _HTMLDirectoryElement_HTMLDirectoryElement() throws Exception { test("HTMLDirectoryElement", "HTMLDirectoryElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLDivElement_HTMLDivElement() throws Exception { + @Alerts("true/false") + void _HTMLDivElement_HTMLDivElement() throws Exception { test("HTMLDivElement", "HTMLDivElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLDListElement_HTMLDListElement() throws Exception { + @Alerts("true/false") + void _HTMLDListElement_HTMLDListElement() throws Exception { test("HTMLDListElement", "HTMLDListElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLDocument_HTMLDocument() throws Exception { + @Alerts("true/false") + void _HTMLDocument_HTMLDocument() throws Exception { test("HTMLDocument", "HTMLDocument"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLDTElement_HTMLDTElement() throws Exception { + @Alerts("false/false") + void _HTMLDTElement_HTMLDTElement() throws Exception { test("HTMLDTElement", "HTMLDTElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_Audio() throws Exception { + @Alerts("true/false") + void _HTMLElement_Audio() throws Exception { test("HTMLElement", "Audio"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLAnchorElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLAnchorElement() throws Exception { test("HTMLElement", "HTMLAnchorElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLElement_HTMLAppletElement() throws Exception { + @Alerts("false/false") + void _HTMLElement_HTMLAppletElement() throws Exception { test("HTMLElement", "HTMLAppletElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLAreaElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLAreaElement() throws Exception { test("HTMLElement", "HTMLAreaElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLAudioElement() throws Exception { + @Alerts("true/false") + void _HTMLElement_HTMLAudioElement() throws Exception { test("HTMLElement", "HTMLAudioElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLBaseElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLBaseElement() throws Exception { test("HTMLElement", "HTMLBaseElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLElement_HTMLBaseFontElement() throws Exception { + @Alerts("false/false") + void _HTMLElement_HTMLBaseFontElement() throws Exception { test("HTMLElement", "HTMLBaseFontElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLElement_HTMLBGSoundElement() throws Exception { + @Alerts("false/false") + void _HTMLElement_HTMLBGSoundElement() throws Exception { test("HTMLElement", "HTMLBGSoundElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLElement_HTMLBlockElement() throws Exception { + @Alerts("false/false") + void _HTMLElement_HTMLBlockElement() throws Exception { test("HTMLElement", "HTMLBlockElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLBodyElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLBodyElement() throws Exception { test("HTMLElement", "HTMLBodyElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLBRElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLBRElement() throws Exception { test("HTMLElement", "HTMLBRElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLButtonElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLButtonElement() throws Exception { test("HTMLElement", "HTMLButtonElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLCanvasElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLCanvasElement() throws Exception { test("HTMLElement", "HTMLCanvasElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLDataElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLDataElement() throws Exception { test("HTMLElement", "HTMLDataElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLDataListElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLDataListElement() throws Exception { test("HTMLElement", "HTMLDataListElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLElement_HTMLDDElement() throws Exception { + @Alerts("false/false") + void _HTMLElement_HTMLDDElement() throws Exception { test("HTMLElement", "HTMLDDElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLDetailsElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLDetailsElement() throws Exception { test("HTMLElement", "HTMLDetailsElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLDialogElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLDialogElement() throws Exception { test("HTMLElement", "HTMLDialogElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLDirectoryElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLDirectoryElement() throws Exception { test("HTMLElement", "HTMLDirectoryElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLDivElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLDivElement() throws Exception { test("HTMLElement", "HTMLDivElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLDListElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLDListElement() throws Exception { test("HTMLElement", "HTMLDListElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLElement_HTMLDTElement() throws Exception { + @Alerts("false/false") + void _HTMLElement_HTMLDTElement() throws Exception { test("HTMLElement", "HTMLDTElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLElement() throws Exception { + @Alerts("true/false") + void _HTMLElement_HTMLElement() throws Exception { test("HTMLElement", "HTMLElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLEmbedElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLEmbedElement() throws Exception { test("HTMLElement", "HTMLEmbedElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLFieldSetElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLFieldSetElement() throws Exception { test("HTMLElement", "HTMLFieldSetElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLFontElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLFontElement() throws Exception { test("HTMLElement", "HTMLFontElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLFormElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLFormElement() throws Exception { test("HTMLElement", "HTMLFormElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLFrameElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLFrameElement() throws Exception { test("HTMLElement", "HTMLFrameElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLFrameSetElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLFrameSetElement() throws Exception { test("HTMLElement", "HTMLFrameSetElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLHeadElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLHeadElement() throws Exception { test("HTMLElement", "HTMLHeadElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLHeadingElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLHeadingElement() throws Exception { test("HTMLElement", "HTMLHeadingElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLHRElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLHRElement() throws Exception { test("HTMLElement", "HTMLHRElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLHtmlElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLHtmlElement() throws Exception { test("HTMLElement", "HTMLHtmlElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLIFrameElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLIFrameElement() throws Exception { test("HTMLElement", "HTMLIFrameElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLImageElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLImageElement() throws Exception { test("HTMLElement", "HTMLImageElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLInputElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLInputElement() throws Exception { test("HTMLElement", "HTMLInputElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLElement_HTMLIsIndexElement() throws Exception { + @Alerts("false/false") + void _HTMLElement_HTMLIsIndexElement() throws Exception { test("HTMLElement", "HTMLIsIndexElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLLabelElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLLabelElement() throws Exception { test("HTMLElement", "HTMLLabelElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLLegendElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLLegendElement() throws Exception { test("HTMLElement", "HTMLLegendElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLLIElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLLIElement() throws Exception { test("HTMLElement", "HTMLLIElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLLinkElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLLinkElement() throws Exception { test("HTMLElement", "HTMLLinkElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLMapElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLMapElement() throws Exception { test("HTMLElement", "HTMLMapElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLMarqueeElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLMarqueeElement() throws Exception { test("HTMLElement", "HTMLMarqueeElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLMediaElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLMediaElement() throws Exception { test("HTMLElement", "HTMLMediaElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLMenuElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLMenuElement() throws Exception { test("HTMLElement", "HTMLMenuElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLElement_HTMLMenuItemElement() throws Exception { + @Alerts("false/false") + void _HTMLElement_HTMLMenuItemElement() throws Exception { test("HTMLElement", "HTMLMenuItemElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLMetaElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLMetaElement() throws Exception { test("HTMLElement", "HTMLMetaElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLMeterElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLMeterElement() throws Exception { test("HTMLElement", "HTMLMeterElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLModElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLModElement() throws Exception { test("HTMLElement", "HTMLModElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLElement_HTMLNextIdElement() throws Exception { + @Alerts("false/false") + void _HTMLElement_HTMLNextIdElement() throws Exception { test("HTMLElement", "HTMLNextIdElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLObjectElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLObjectElement() throws Exception { test("HTMLElement", "HTMLObjectElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLOListElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLOListElement() throws Exception { test("HTMLElement", "HTMLOListElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLOptGroupElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLOptGroupElement() throws Exception { test("HTMLElement", "HTMLOptGroupElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLOptionElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLOptionElement() throws Exception { test("HTMLElement", "HTMLOptionElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLOutputElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLOutputElement() throws Exception { test("HTMLElement", "HTMLOutputElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLParagraphElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLParagraphElement() throws Exception { test("HTMLElement", "HTMLParagraphElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLParamElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLParamElement() throws Exception { test("HTMLElement", "HTMLParamElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLElement_HTMLPhraseElement() throws Exception { + @Alerts("false/false") + void _HTMLElement_HTMLPhraseElement() throws Exception { test("HTMLElement", "HTMLPhraseElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLPictureElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLPictureElement() throws Exception { test("HTMLElement", "HTMLPictureElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLPreElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLPreElement() throws Exception { test("HTMLElement", "HTMLPreElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLProgressElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLProgressElement() throws Exception { test("HTMLElement", "HTMLProgressElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLQuoteElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLQuoteElement() throws Exception { test("HTMLElement", "HTMLQuoteElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLScriptElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLScriptElement() throws Exception { test("HTMLElement", "HTMLScriptElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLSelectElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLSelectElement() throws Exception { test("HTMLElement", "HTMLSelectElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLSlotElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLSlotElement() throws Exception { test("HTMLElement", "HTMLSlotElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLSourceElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLSourceElement() throws Exception { test("HTMLElement", "HTMLSourceElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLSpanElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLSpanElement() throws Exception { test("HTMLElement", "HTMLSpanElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLStyleElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLStyleElement() throws Exception { test("HTMLElement", "HTMLStyleElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLTableCaptionElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLTableCaptionElement() throws Exception { test("HTMLElement", "HTMLTableCaptionElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLTableCellElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLTableCellElement() throws Exception { test("HTMLElement", "HTMLTableCellElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLTableColElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLTableColElement() throws Exception { test("HTMLElement", "HTMLTableColElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLElement_HTMLTableDataCellElement() throws Exception { + @Alerts("false/false") + void _HTMLElement_HTMLTableDataCellElement() throws Exception { test("HTMLElement", "HTMLTableDataCellElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLTableElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLTableElement() throws Exception { test("HTMLElement", "HTMLTableElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLElement_HTMLTableHeaderCellElement() throws Exception { + @Alerts("false/false") + void _HTMLElement_HTMLTableHeaderCellElement() throws Exception { test("HTMLElement", "HTMLTableHeaderCellElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLTableRowElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLTableRowElement() throws Exception { test("HTMLElement", "HTMLTableRowElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLTableSectionElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLTableSectionElement() throws Exception { test("HTMLElement", "HTMLTableSectionElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLTemplateElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLTemplateElement() throws Exception { test("HTMLElement", "HTMLTemplateElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLTextAreaElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLTextAreaElement() throws Exception { test("HTMLElement", "HTMLTextAreaElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLTimeElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLTimeElement() throws Exception { test("HTMLElement", "HTMLTimeElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLTitleElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLTitleElement() throws Exception { test("HTMLElement", "HTMLTitleElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLTrackElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLTrackElement() throws Exception { test("HTMLElement", "HTMLTrackElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLUListElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLUListElement() throws Exception { test("HTMLElement", "HTMLUListElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLUnknownElement() throws Exception { + @Alerts("true/true") + void _HTMLElement_HTMLUnknownElement() throws Exception { test("HTMLElement", "HTMLUnknownElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_HTMLVideoElement() throws Exception { + @Alerts("true/false") + void _HTMLElement_HTMLVideoElement() throws Exception { test("HTMLElement", "HTMLVideoElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_Image() throws Exception { + @Alerts("true/false") + void _HTMLElement_Image() throws Exception { test("HTMLElement", "Image"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLElement_Option() throws Exception { + @Alerts("true/false") + void _HTMLElement_Option() throws Exception { test("HTMLElement", "Option"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLEmbedElement_HTMLEmbedElement() throws Exception { + @Alerts("true/false") + void _HTMLEmbedElement_HTMLEmbedElement() throws Exception { test("HTMLEmbedElement", "HTMLEmbedElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLFieldSetElement_HTMLFieldSetElement() throws Exception { + @Alerts("true/false") + void _HTMLFieldSetElement_HTMLFieldSetElement() throws Exception { test("HTMLFieldSetElement", "HTMLFieldSetElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLFontElement_HTMLFontElement() throws Exception { + @Alerts("true/false") + void _HTMLFontElement_HTMLFontElement() throws Exception { test("HTMLFontElement", "HTMLFontElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLFormControlsCollection_HTMLFormControlsCollection() throws Exception { + @Alerts("true/false") + void _HTMLFormControlsCollection_HTMLFormControlsCollection() throws Exception { test("HTMLFormControlsCollection", "HTMLFormControlsCollection"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLFormElement_HTMLFormElement() throws Exception { + @Alerts("true/false") + void _HTMLFormElement_HTMLFormElement() throws Exception { test("HTMLFormElement", "HTMLFormElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLFrameElement_HTMLFrameElement() throws Exception { + @Alerts("true/false") + void _HTMLFrameElement_HTMLFrameElement() throws Exception { test("HTMLFrameElement", "HTMLFrameElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLFrameSetElement_HTMLFrameSetElement() throws Exception { + @Alerts("true/false") + void _HTMLFrameSetElement_HTMLFrameSetElement() throws Exception { test("HTMLFrameSetElement", "HTMLFrameSetElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLHeadElement_HTMLHeadElement() throws Exception { + @Alerts("true/false") + void _HTMLHeadElement_HTMLHeadElement() throws Exception { test("HTMLHeadElement", "HTMLHeadElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLHeadingElement_HTMLHeadingElement() throws Exception { + @Alerts("true/false") + void _HTMLHeadingElement_HTMLHeadingElement() throws Exception { test("HTMLHeadingElement", "HTMLHeadingElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLHRElement_HTMLHRElement() throws Exception { + @Alerts("true/false") + void _HTMLHRElement_HTMLHRElement() throws Exception { test("HTMLHRElement", "HTMLHRElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLHtmlElement_HTMLHtmlElement() throws Exception { + @Alerts("true/false") + void _HTMLHtmlElement_HTMLHtmlElement() throws Exception { test("HTMLHtmlElement", "HTMLHtmlElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLIFrameElement_HTMLIFrameElement() throws Exception { + @Alerts("true/false") + void _HTMLIFrameElement_HTMLIFrameElement() throws Exception { test("HTMLIFrameElement", "HTMLIFrameElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLImageElement_HTMLImageElement() throws Exception { + @Alerts("true/false") + void _HTMLImageElement_HTMLImageElement() throws Exception { test("HTMLImageElement", "HTMLImageElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLImageElement_Image() throws Exception { + @Alerts("true/false") + void _HTMLImageElement_Image() throws Exception { //although Image != HTMLImageElement, they seem to be synonyms!!! test("HTMLImageElement", "Image"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLInputElement_HTMLInputElement() throws Exception { + @Alerts("true/false") + void _HTMLInputElement_HTMLInputElement() throws Exception { test("HTMLInputElement", "HTMLInputElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLIsIndexElement_HTMLIsIndexElement() throws Exception { + @Alerts("false/false") + void _HTMLIsIndexElement_HTMLIsIndexElement() throws Exception { test("HTMLIsIndexElement", "HTMLIsIndexElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLLabelElement_HTMLLabelElement() throws Exception { + @Alerts("true/false") + void _HTMLLabelElement_HTMLLabelElement() throws Exception { test("HTMLLabelElement", "HTMLLabelElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLLegendElement_HTMLLegendElement() throws Exception { + @Alerts("true/false") + void _HTMLLegendElement_HTMLLegendElement() throws Exception { test("HTMLLegendElement", "HTMLLegendElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLLIElement_HTMLLIElement() throws Exception { + @Alerts("true/false") + void _HTMLLIElement_HTMLLIElement() throws Exception { test("HTMLLIElement", "HTMLLIElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLLinkElement_HTMLLinkElement() throws Exception { + @Alerts("true/false") + void _HTMLLinkElement_HTMLLinkElement() throws Exception { test("HTMLLinkElement", "HTMLLinkElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLMapElement_HTMLMapElement() throws Exception { + @Alerts("true/false") + void _HTMLMapElement_HTMLMapElement() throws Exception { test("HTMLMapElement", "HTMLMapElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLMarqueeElement_HTMLMarqueeElement() throws Exception { + @Alerts("true/false") + void _HTMLMarqueeElement_HTMLMarqueeElement() throws Exception { test("HTMLMarqueeElement", "HTMLMarqueeElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLMediaElement_Audio() throws Exception { + @Alerts("true/false") + void _HTMLMediaElement_Audio() throws Exception { test("HTMLMediaElement", "Audio"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLMediaElement_HTMLAudioElement() throws Exception { + @Alerts("true/true") + void _HTMLMediaElement_HTMLAudioElement() throws Exception { test("HTMLMediaElement", "HTMLAudioElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLMediaElement_HTMLMediaElement() throws Exception { + @Alerts("true/false") + void _HTMLMediaElement_HTMLMediaElement() throws Exception { test("HTMLMediaElement", "HTMLMediaElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLMediaElement_HTMLVideoElement() throws Exception { + @Alerts("true/true") + void _HTMLMediaElement_HTMLVideoElement() throws Exception { test("HTMLMediaElement", "HTMLVideoElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLMenuElement_HTMLMenuElement() throws Exception { + @Alerts("true/false") + void _HTMLMenuElement_HTMLMenuElement() throws Exception { test("HTMLMenuElement", "HTMLMenuElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLMenuItemElement_HTMLMenuItemElement() throws Exception { + @Alerts("false/false") + void _HTMLMenuItemElement_HTMLMenuItemElement() throws Exception { test("HTMLMenuItemElement", "HTMLMenuItemElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLMetaElement_HTMLMetaElement() throws Exception { + @Alerts("true/false") + void _HTMLMetaElement_HTMLMetaElement() throws Exception { test("HTMLMetaElement", "HTMLMetaElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLMeterElement_HTMLMeterElement() throws Exception { + @Alerts("true/false") + void _HTMLMeterElement_HTMLMeterElement() throws Exception { test("HTMLMeterElement", "HTMLMeterElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLModElement_HTMLModElement() throws Exception { + @Alerts("true/false") + void _HTMLModElement_HTMLModElement() throws Exception { test("HTMLModElement", "HTMLModElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLNextIdElement_HTMLNextIdElement() throws Exception { + @Alerts("false/false") + void _HTMLNextIdElement_HTMLNextIdElement() throws Exception { test("HTMLNextIdElement", "HTMLNextIdElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLObjectElement_HTMLObjectElement() throws Exception { + @Alerts("true/false") + void _HTMLObjectElement_HTMLObjectElement() throws Exception { test("HTMLObjectElement", "HTMLObjectElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLOListElement_HTMLOListElement() throws Exception { + @Alerts("true/false") + void _HTMLOListElement_HTMLOListElement() throws Exception { test("HTMLOListElement", "HTMLOListElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLOptGroupElement_HTMLOptGroupElement() throws Exception { + @Alerts("true/false") + void _HTMLOptGroupElement_HTMLOptGroupElement() throws Exception { test("HTMLOptGroupElement", "HTMLOptGroupElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLOptionElement_HTMLOptionElement() throws Exception { + @Alerts("true/false") + void _HTMLOptionElement_HTMLOptionElement() throws Exception { test("HTMLOptionElement", "HTMLOptionElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLOptionElement_Option() throws Exception { + @Alerts("true/false") + void _HTMLOptionElement_Option() throws Exception { //although Option != HTMLOptionElement, they seem to be synonyms!!! test("HTMLOptionElement", "Option"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLOptionsCollection_HTMLOptionsCollection() throws Exception { + @Alerts("true/false") + void _HTMLOptionsCollection_HTMLOptionsCollection() throws Exception { test("HTMLOptionsCollection", "HTMLOptionsCollection"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLOutputElement_HTMLOutputElement() throws Exception { + @Alerts("true/false") + void _HTMLOutputElement_HTMLOutputElement() throws Exception { test("HTMLOutputElement", "HTMLOutputElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLParagraphElement_HTMLParagraphElement() throws Exception { + @Alerts("true/false") + void _HTMLParagraphElement_HTMLParagraphElement() throws Exception { test("HTMLParagraphElement", "HTMLParagraphElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLParamElement_HTMLParamElement() throws Exception { + @Alerts("true/false") + void _HTMLParamElement_HTMLParamElement() throws Exception { test("HTMLParamElement", "HTMLParamElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLPhraseElement_HTMLPhraseElement() throws Exception { + @Alerts("false/false") + void _HTMLPhraseElement_HTMLPhraseElement() throws Exception { test("HTMLPhraseElement", "HTMLPhraseElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLPictureElement_HTMLPictureElement() throws Exception { + @Alerts("true/false") + void _HTMLPictureElement_HTMLPictureElement() throws Exception { test("HTMLPictureElement", "HTMLPictureElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLPreElement_HTMLPreElement() throws Exception { + @Alerts("true/false") + void _HTMLPreElement_HTMLPreElement() throws Exception { test("HTMLPreElement", "HTMLPreElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLProgressElement_HTMLProgressElement() throws Exception { + @Alerts("true/false") + void _HTMLProgressElement_HTMLProgressElement() throws Exception { test("HTMLProgressElement", "HTMLProgressElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLQuoteElement_HTMLQuoteElement() throws Exception { + @Alerts("true/false") + void _HTMLQuoteElement_HTMLQuoteElement() throws Exception { test("HTMLQuoteElement", "HTMLQuoteElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLScriptElement_HTMLScriptElement() throws Exception { + @Alerts("true/false") + void _HTMLScriptElement_HTMLScriptElement() throws Exception { test("HTMLScriptElement", "HTMLScriptElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLSelectElement_HTMLSelectElement() throws Exception { + @Alerts("true/false") + void _HTMLSelectElement_HTMLSelectElement() throws Exception { test("HTMLSelectElement", "HTMLSelectElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLSlotElement_HTMLSlotElement() throws Exception { + @Alerts("true/false") + void _HTMLSlotElement_HTMLSlotElement() throws Exception { test("HTMLSlotElement", "HTMLSlotElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLSourceElement_HTMLSourceElement() throws Exception { + @Alerts("true/false") + void _HTMLSourceElement_HTMLSourceElement() throws Exception { test("HTMLSourceElement", "HTMLSourceElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLSpanElement_HTMLSpanElement() throws Exception { + @Alerts("true/false") + void _HTMLSpanElement_HTMLSpanElement() throws Exception { test("HTMLSpanElement", "HTMLSpanElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLStyleElement_HTMLStyleElement() throws Exception { + @Alerts("true/false") + void _HTMLStyleElement_HTMLStyleElement() throws Exception { test("HTMLStyleElement", "HTMLStyleElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLTableCaptionElement_HTMLTableCaptionElement() throws Exception { + @Alerts("true/false") + void _HTMLTableCaptionElement_HTMLTableCaptionElement() throws Exception { test("HTMLTableCaptionElement", "HTMLTableCaptionElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLTableCellElement_HTMLTableCellElement() throws Exception { + @Alerts("true/false") + void _HTMLTableCellElement_HTMLTableCellElement() throws Exception { test("HTMLTableCellElement", "HTMLTableCellElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLTableCellElement_HTMLTableDataCellElement() throws Exception { + @Alerts("false/false") + void _HTMLTableCellElement_HTMLTableDataCellElement() throws Exception { test("HTMLTableCellElement", "HTMLTableDataCellElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLTableCellElement_HTMLTableHeaderCellElement() throws Exception { + @Alerts("false/false") + void _HTMLTableCellElement_HTMLTableHeaderCellElement() throws Exception { test("HTMLTableCellElement", "HTMLTableHeaderCellElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLTableColElement_HTMLTableColElement() throws Exception { + @Alerts("true/false") + void _HTMLTableColElement_HTMLTableColElement() throws Exception { test("HTMLTableColElement", "HTMLTableColElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLTableDataCellElement_HTMLTableDataCellElement() throws Exception { + @Alerts("false/false") + void _HTMLTableDataCellElement_HTMLTableDataCellElement() throws Exception { test("HTMLTableDataCellElement", "HTMLTableDataCellElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLTableElement_HTMLTableElement() throws Exception { + @Alerts("true/false") + void _HTMLTableElement_HTMLTableElement() throws Exception { test("HTMLTableElement", "HTMLTableElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _HTMLTableHeaderCellElement_HTMLTableHeaderCellElement() throws Exception { + @Alerts("false/false") + void _HTMLTableHeaderCellElement_HTMLTableHeaderCellElement() throws Exception { test("HTMLTableHeaderCellElement", "HTMLTableHeaderCellElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLTableRowElement_HTMLTableRowElement() throws Exception { + @Alerts("true/false") + void _HTMLTableRowElement_HTMLTableRowElement() throws Exception { test("HTMLTableRowElement", "HTMLTableRowElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLTableSectionElement_HTMLTableSectionElement() throws Exception { + @Alerts("true/false") + void _HTMLTableSectionElement_HTMLTableSectionElement() throws Exception { test("HTMLTableSectionElement", "HTMLTableSectionElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLTemplateElement_HTMLTemplateElement() throws Exception { + @Alerts("true/false") + void _HTMLTemplateElement_HTMLTemplateElement() throws Exception { test("HTMLTemplateElement", "HTMLTemplateElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLTextAreaElement_HTMLTextAreaElement() throws Exception { + @Alerts("true/false") + void _HTMLTextAreaElement_HTMLTextAreaElement() throws Exception { test("HTMLTextAreaElement", "HTMLTextAreaElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLTimeElement_HTMLTimeElement() throws Exception { + @Alerts("true/false") + void _HTMLTimeElement_HTMLTimeElement() throws Exception { test("HTMLTimeElement", "HTMLTimeElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLTitleElement_HTMLTitleElement() throws Exception { + @Alerts("true/false") + void _HTMLTitleElement_HTMLTitleElement() throws Exception { test("HTMLTitleElement", "HTMLTitleElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLTrackElement_HTMLTrackElement() throws Exception { + @Alerts("true/false") + void _HTMLTrackElement_HTMLTrackElement() throws Exception { test("HTMLTrackElement", "HTMLTrackElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLUListElement_HTMLUListElement() throws Exception { + @Alerts("true/false") + void _HTMLUListElement_HTMLUListElement() throws Exception { test("HTMLUListElement", "HTMLUListElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLUnknownElement_HTMLUnknownElement() throws Exception { + @Alerts("true/false") + void _HTMLUnknownElement_HTMLUnknownElement() throws Exception { test("HTMLUnknownElement", "HTMLUnknownElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _HTMLVideoElement_HTMLVideoElement() throws Exception { + @Alerts("true/false") + void _HTMLVideoElement_HTMLVideoElement() throws Exception { test("HTMLVideoElement", "HTMLVideoElement"); } - } diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfITest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfITest.java index 2046de55e75..91fe147a036 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfITest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfITest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,11 +16,8 @@ import java.util.Collection; -import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized.Parameters; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.params.provider.Arguments; /** * Tests two Host classes, if one prototype is parent of another. @@ -30,7 +27,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserParameterizedRunner.class) public class HostParentOfITest extends HostParentOf { /** @@ -40,336 +36,178 @@ public class HostParentOfITest extends HostParentOf { * @throws Exception * if an error occurs */ - @Parameters - public static Collection data() throws Exception { + public static Collection data() throws Exception { return HostParentOf.data(input -> { final char ch = Character.toUpperCase(input.charAt(0)); return ch >= 'I' && ch <= 'L'; }); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _IDBCursor_IDBCursor() throws Exception { + @Alerts("true/false") + void _IDBCursor_IDBCursor() throws Exception { test("IDBCursor", "IDBCursor"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _IDBCursor_IDBCursorWithValue() throws Exception { + @Alerts("true/true") + void _IDBCursor_IDBCursorWithValue() throws Exception { test("IDBCursor", "IDBCursorWithValue"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _IDBCursorWithValue_IDBCursorWithValue() throws Exception { + @Alerts("true/false") + void _IDBCursorWithValue_IDBCursorWithValue() throws Exception { test("IDBCursorWithValue", "IDBCursorWithValue"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _IDBDatabase_IDBDatabase() throws Exception { + @Alerts("true/false") + void _IDBDatabase_IDBDatabase() throws Exception { test("IDBDatabase", "IDBDatabase"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _IDBFactory_IDBFactory() throws Exception { + @Alerts("true/false") + void _IDBFactory_IDBFactory() throws Exception { test("IDBFactory", "IDBFactory"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _IDBIndex_IDBIndex() throws Exception { + @Alerts("true/false") + void _IDBIndex_IDBIndex() throws Exception { test("IDBIndex", "IDBIndex"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _IDBKeyRange_IDBKeyRange() throws Exception { + @Alerts("true/false") + void _IDBKeyRange_IDBKeyRange() throws Exception { test("IDBKeyRange", "IDBKeyRange"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _IDBMutableFile_IDBMutableFile() throws Exception { + @Alerts("false/false") + void _IDBMutableFile_IDBMutableFile() throws Exception { test("IDBMutableFile", "IDBMutableFile"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _IDBObjectStore_IDBObjectStore() throws Exception { + @Alerts("true/false") + void _IDBObjectStore_IDBObjectStore() throws Exception { test("IDBObjectStore", "IDBObjectStore"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _IDBOpenDBRequest_IDBOpenDBRequest() throws Exception { + @Alerts("true/false") + void _IDBOpenDBRequest_IDBOpenDBRequest() throws Exception { test("IDBOpenDBRequest", "IDBOpenDBRequest"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _IDBRequest_IDBOpenDBRequest() throws Exception { + @Alerts("true/true") + void _IDBRequest_IDBOpenDBRequest() throws Exception { test("IDBRequest", "IDBOpenDBRequest"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _IDBRequest_IDBRequest() throws Exception { + @Alerts("true/false") + void _IDBRequest_IDBRequest() throws Exception { test("IDBRequest", "IDBRequest"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _IDBTransaction_IDBTransaction() throws Exception { + @Alerts("true/false") + void _IDBTransaction_IDBTransaction() throws Exception { test("IDBTransaction", "IDBTransaction"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _IDBVersionChangeEvent_IDBVersionChangeEvent() throws Exception { + @Alerts("true/false") + void _IDBVersionChangeEvent_IDBVersionChangeEvent() throws Exception { test("IDBVersionChangeEvent", "IDBVersionChangeEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _IdleDeadline_IdleDeadline() throws Exception { + @Alerts("true/false") + void _IdleDeadline_IdleDeadline() throws Exception { test("IdleDeadline", "IdleDeadline"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _IIRFilterNode_IIRFilterNode() throws Exception { + @Alerts("true/false") + void _IIRFilterNode_IIRFilterNode() throws Exception { test("IIRFilterNode", "IIRFilterNode"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Image_HTMLImageElement() throws Exception { + @Alerts("true/false") + void _Image_HTMLImageElement() throws Exception { // although Image != HTMLImageElement, they seem to be synonyms!!! test("Image", "HTMLImageElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Image_Image() throws Exception { + @Alerts("true/false") + void _Image_Image() throws Exception { test("Image", "Image"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _ImageBitmap_ImageBitmap() throws Exception { + @Alerts("true/false") + void _ImageBitmap_ImageBitmap() throws Exception { test("ImageBitmap", "ImageBitmap"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _ImageBitmapRenderingContext_ImageBitmapRenderingContext() throws Exception { + @Alerts("true/false") + void _ImageBitmapRenderingContext_ImageBitmapRenderingContext() throws Exception { test("ImageBitmapRenderingContext", "ImageBitmapRenderingContext"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _ImageData_ImageData() throws Exception { + @Alerts("true/false") + void _ImageData_ImageData() throws Exception { test("ImageData", "ImageData"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _InputDeviceCapabilities_InputDeviceCapabilities() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _InputDeviceCapabilities_InputDeviceCapabilities() throws Exception { test("InputDeviceCapabilities", "InputDeviceCapabilities"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _InputEvent_InputEvent() throws Exception { + @Alerts("true/false") + void _InputEvent_InputEvent() throws Exception { test("InputEvent", "InputEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _InstallTrigger_InstallTrigger() throws Exception { + @Alerts("false/false") + void _InstallTrigger_InstallTrigger() throws Exception { test("InstallTrigger", "InstallTrigger"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Int16Array_Int16Array() throws Exception { + @Alerts("true/false") + void _Int16Array_Int16Array() throws Exception { test("Int16Array", "Int16Array"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Int32Array_Int32Array() throws Exception { + @Alerts("true/false") + void _Int32Array_Int32Array() throws Exception { test("Int32Array", "Int32Array"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Int8Array_Int8Array() throws Exception { + @Alerts("true/false") + void _Int8Array_Int8Array() throws Exception { test("Int8Array", "Int8Array"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _IntersectionObserver_IntersectionObserver() throws Exception { + @Alerts("true/false") + void _IntersectionObserver_IntersectionObserver() throws Exception { test("IntersectionObserver", "IntersectionObserver"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _IntersectionObserverEntry_IntersectionObserverEntry() throws Exception { + @Alerts("true/false") + void _IntersectionObserverEntry_IntersectionObserverEntry() throws Exception { test("IntersectionObserverEntry", "IntersectionObserverEntry"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _KeyboardEvent_KeyboardEvent() throws Exception { + @Alerts("true/false") + void _KeyboardEvent_KeyboardEvent() throws Exception { test("KeyboardEvent", "KeyboardEvent"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _KeyframeEffect_KeyframeEffect() throws Exception { + @Alerts("true/false") + void _KeyframeEffect_KeyframeEffect() throws Exception { test("KeyframeEffect", "KeyframeEffect"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("false") - public void _LocalMediaStream_LocalMediaStream() throws Exception { + @Alerts("false/false") + void _LocalMediaStream_LocalMediaStream() throws Exception { test("LocalMediaStream", "LocalMediaStream"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Location_Location() throws Exception { + @Alerts("true/false") + void _Location_Location() throws Exception { test("Location", "Location"); } } diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfMTest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfMTest.java index bdfe2faa99e..9163ce0f8a4 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfMTest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfMTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,11 +16,8 @@ import java.util.Collection; -import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized.Parameters; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.params.provider.Arguments; /** * Tests two Host classes, if one prototype is parent of another. @@ -30,7 +27,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserParameterizedRunner.class) public class HostParentOfMTest extends HostParentOf { /** @@ -40,527 +36,275 @@ public class HostParentOfMTest extends HostParentOf { * @throws Exception * if an error occurs */ - @Parameters - public static Collection data() throws Exception { + public static Collection data() throws Exception { return HostParentOf.data(input -> { final char ch = Character.toUpperCase(input.charAt(0)); return ch == 'M'; }); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MIDIAccess_MIDIAccess() throws Exception { + @Alerts("true/false") + void _MIDIAccess_MIDIAccess() throws Exception { test("MIDIAccess", "MIDIAccess"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MIDIConnectionEvent_MIDIConnectionEvent() throws Exception { + @Alerts("true/false") + void _MIDIConnectionEvent_MIDIConnectionEvent() throws Exception { test("MIDIConnectionEvent", "MIDIConnectionEvent"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MIDIInputMap_MIDIInputMap() throws Exception { + @Alerts("true/false") + void _MIDIInputMap_MIDIInputMap() throws Exception { test("MIDIInputMap", "MIDIInputMap"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MIDIInput_MIDIInput() throws Exception { + @Alerts("true/false") + void _MIDIInput_MIDIInput() throws Exception { test("MIDIInput", "MIDIInput"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MIDIMessageEvent_MIDIMessageEvent() throws Exception { + @Alerts("true/false") + void _MIDIMessageEvent_MIDIMessageEvent() throws Exception { test("MIDIMessageEvent", "MIDIMessageEvent"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MIDIOutputMap_MIDIOutputMap() throws Exception { + @Alerts("true/false") + void _MIDIOutputMap_MIDIOutputMap() throws Exception { test("MIDIOutputMap", "MIDIOutputMap"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MIDIOutput_MIDIOutput() throws Exception { + @Alerts("true/false") + void _MIDIOutput_MIDIOutput() throws Exception { test("MIDIOutput", "MIDIOutput"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MIDIPort_MIDIInput() throws Exception { + @Alerts("true/true") + void _MIDIPort_MIDIInput() throws Exception { test("MIDIPort", "MIDIInput"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MIDIPort_MIDIOutput() throws Exception { + @Alerts("true/true") + void _MIDIPort_MIDIOutput() throws Exception { test("MIDIPort", "MIDIOutput"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MIDIPort_MIDIPort() throws Exception { + @Alerts("true/false") + void _MIDIPort_MIDIPort() throws Exception { test("MIDIPort", "MIDIPort"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MediaDeviceInfo_MediaDeviceInfo() throws Exception { + @Alerts("true/false") + void _MediaDeviceInfo_MediaDeviceInfo() throws Exception { test("MediaDeviceInfo", "MediaDeviceInfo"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MediaDevices_MediaDevices() throws Exception { + @Alerts("true/false") + void _MediaDevices_MediaDevices() throws Exception { test("MediaDevices", "MediaDevices"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MediaElementAudioSourceNode_MediaElementAudioSourceNode() throws Exception { + @Alerts("true/false") + void _MediaElementAudioSourceNode_MediaElementAudioSourceNode() throws Exception { test("MediaElementAudioSourceNode", "MediaElementAudioSourceNode"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MediaEncryptedEvent_MediaEncryptedEvent() throws Exception { + @Alerts("true/false") + void _MediaEncryptedEvent_MediaEncryptedEvent() throws Exception { test("MediaEncryptedEvent", "MediaEncryptedEvent"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MediaError_MediaError() throws Exception { + @Alerts("true/false") + void _MediaError_MediaError() throws Exception { test("MediaError", "MediaError"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true", - FF_ESR = "true") - public void _MediaKeyError_MediaKeyError() throws Exception { + @Alerts(DEFAULT = "false/false", + FF = "true/false", + FF_ESR = "true/false") + void _MediaKeyError_MediaKeyError() throws Exception { test("MediaKeyError", "MediaKeyError"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MediaKeyMessageEvent_MediaKeyMessageEvent() throws Exception { + @Alerts("true/false") + void _MediaKeyMessageEvent_MediaKeyMessageEvent() throws Exception { test("MediaKeyMessageEvent", "MediaKeyMessageEvent"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MediaKeySession_MediaKeySession() throws Exception { + @Alerts("true/false") + void _MediaKeySession_MediaKeySession() throws Exception { test("MediaKeySession", "MediaKeySession"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MediaKeyStatusMap_MediaKeyStatusMap() throws Exception { + @Alerts("true/false") + void _MediaKeyStatusMap_MediaKeyStatusMap() throws Exception { test("MediaKeyStatusMap", "MediaKeyStatusMap"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MediaKeySystemAccess_MediaKeySystemAccess() throws Exception { + @Alerts("true/false") + void _MediaKeySystemAccess_MediaKeySystemAccess() throws Exception { test("MediaKeySystemAccess", "MediaKeySystemAccess"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MediaKeys_MediaKeys() throws Exception { + @Alerts("true/false") + void _MediaKeys_MediaKeys() throws Exception { test("MediaKeys", "MediaKeys"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MediaList_MediaList() throws Exception { + @Alerts("true/false") + void _MediaList_MediaList() throws Exception { test("MediaList", "MediaList"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MediaQueryListEvent_MediaQueryListEvent() throws Exception { + @Alerts("true/false") + void _MediaQueryListEvent_MediaQueryListEvent() throws Exception { test("MediaQueryListEvent", "MediaQueryListEvent"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MediaQueryList_MediaQueryList() throws Exception { + @Alerts("true/false") + void _MediaQueryList_MediaQueryList() throws Exception { test("MediaQueryList", "MediaQueryList"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MediaRecorder_MediaRecorder() throws Exception { + @Alerts("true/false") + void _MediaRecorder_MediaRecorder() throws Exception { test("MediaRecorder", "MediaRecorder"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MediaSource_MediaSource() throws Exception { + @Alerts("true/false") + void _MediaSource_MediaSource() throws Exception { test("MediaSource", "MediaSource"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MediaStreamAudioDestinationNode_MediaStreamAudioDestinationNode() throws Exception { + @Alerts("true/false") + void _MediaStreamAudioDestinationNode_MediaStreamAudioDestinationNode() throws Exception { test("MediaStreamAudioDestinationNode", "MediaStreamAudioDestinationNode"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MediaStreamAudioSourceNode_MediaStreamAudioSourceNode() throws Exception { + @Alerts("true/false") + void _MediaStreamAudioSourceNode_MediaStreamAudioSourceNode() throws Exception { test("MediaStreamAudioSourceNode", "MediaStreamAudioSourceNode"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MediaStreamEvent_MediaStreamEvent() throws Exception { + @Alerts("true/false") + void _MediaStreamEvent_MediaStreamEvent() throws Exception { test("MediaStreamEvent", "MediaStreamEvent"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MediaStreamTrackEvent_MediaStreamTrackEvent() throws Exception { + @Alerts("true/false") + void _MediaStreamTrackEvent_MediaStreamTrackEvent() throws Exception { test("MediaStreamTrackEvent", "MediaStreamTrackEvent"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - FF = "false", - FF_ESR = "false") - public void _MediaStreamTrack_CanvasCaptureMediaStreamTrack() throws Exception { + @Alerts(DEFAULT = "true/true", + FF = "false/false", + FF_ESR = "false/false") + void _MediaStreamTrack_CanvasCaptureMediaStreamTrack() throws Exception { test("MediaStreamTrack", "CanvasCaptureMediaStreamTrack"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MediaStreamTrack_MediaStreamTrack() throws Exception { + @Alerts("true/false") + void _MediaStreamTrack_MediaStreamTrack() throws Exception { test("MediaStreamTrack", "MediaStreamTrack"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MediaStream_MediaStream() throws Exception { + @Alerts("true/false") + void _MediaStream_MediaStream() throws Exception { test("MediaStream", "MediaStream"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true", - FF_ESR = "true") - public void _MediaStream_CanvasCaptureMediaStream() throws Exception { + @Alerts(DEFAULT = "false/false", + FF = "true/true", + FF_ESR = "true/true") + void _MediaStream_CanvasCaptureMediaStream() throws Exception { test("MediaStream", "CanvasCaptureMediaStream"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - FF = "false", - FF_ESR = "false") - public void _MediaStream_webkitMediaStream() throws Exception { + @Alerts(DEFAULT = "true/false", + FF = "false/false", + FF_ESR = "false/false") + void _MediaStream_webkitMediaStream() throws Exception { test("MediaStream", "webkitMediaStream"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MessageChannel_MessageChannel() throws Exception { + @Alerts("true/false") + void _MessageChannel_MessageChannel() throws Exception { test("MessageChannel", "MessageChannel"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MessageEvent_MessageEvent() throws Exception { + @Alerts("true/false") + void _MessageEvent_MessageEvent() throws Exception { test("MessageEvent", "MessageEvent"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MessagePort_MessagePort() throws Exception { + @Alerts("true/false") + void _MessagePort_MessagePort() throws Exception { test("MessagePort", "MessagePort"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MimeTypeArray_MimeTypeArray() throws Exception { + @Alerts("true/false") + void _MimeTypeArray_MimeTypeArray() throws Exception { test("MimeTypeArray", "MimeTypeArray"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MimeType_MimeType() throws Exception { + @Alerts("true/false") + void _MimeType_MimeType() throws Exception { test("MimeType", "MimeType"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MouseEvent_DragEvent() throws Exception { + @Alerts("true/true") + void _MouseEvent_DragEvent() throws Exception { test("MouseEvent", "DragEvent"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MouseEvent_MouseEvent() throws Exception { + @Alerts("true/false") + void _MouseEvent_MouseEvent() throws Exception { test("MouseEvent", "MouseEvent"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true", - FF_ESR = "true") - public void _MouseEvent_MouseScrollEvent() throws Exception { + @Alerts(DEFAULT = "false/false", + FF = "true/true", + FF_ESR = "true/true") + void _MouseEvent_MouseScrollEvent() throws Exception { test("MouseEvent", "MouseScrollEvent"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MouseEvent_PointerEvent() throws Exception { + @Alerts("true/true") + void _MouseEvent_PointerEvent() throws Exception { test("MouseEvent", "PointerEvent"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MouseEvent_WheelEvent() throws Exception { + @Alerts("true/true") + void _MouseEvent_WheelEvent() throws Exception { test("MouseEvent", "WheelEvent"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true", - FF_ESR = "true") - public void _MouseScrollEvent_MouseScrollEvent() throws Exception { + @Alerts(DEFAULT = "false/false", + FF = "true/false", + FF_ESR = "true/false") + void _MouseScrollEvent_MouseScrollEvent() throws Exception { test("MouseScrollEvent", "MouseScrollEvent"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true", - FF_ESR = "true") - public void _MutationEvent_MutationEvent() throws Exception { + @Alerts(DEFAULT = "false/false", + FF_ESR = "true/false") + void _MutationEvent_MutationEvent() throws Exception { test("MutationEvent", "MutationEvent"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MutationObserver_MutationObserver() throws Exception { + @Alerts("true/false") + void _MutationObserver_MutationObserver() throws Exception { test("MutationObserver", "MutationObserver"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - FF = "false", - FF_ESR = "false") - public void _MutationObserver_WebKitMutationObserver() throws Exception { + @Alerts(DEFAULT = "true/false", + FF = "false/false", + FF_ESR = "false/false") + void _MutationObserver_WebKitMutationObserver() throws Exception { test("MutationObserver", "WebKitMutationObserver"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _MutationRecord_MutationRecord() throws Exception { + @Alerts("true/false") + void _MutationRecord_MutationRecord() throws Exception { test("MutationRecord", "MutationRecord"); } } diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfNTest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfNTest.java index 568384ba250..294da7e3f9c 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfNTest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfNTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,12 +16,9 @@ import java.util.Collection; -import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized.Parameters; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; +import org.junit.jupiter.params.provider.Arguments; /** * Tests two Host classes, if one prototype is parent of another. @@ -31,7 +28,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserParameterizedRunner.class) public class HostParentOfNTest extends HostParentOf { /** @@ -41,1903 +37,967 @@ public class HostParentOfNTest extends HostParentOf { * @throws Exception * if an error occurs */ - @Parameters - public static Collection data() throws Exception { + public static Collection data() throws Exception { return HostParentOf.data(input -> { final char ch = Character.toUpperCase(input.charAt(0)); return ch >= 'N' && ch <= 'O'; }); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _NamedNodeMap_NamedNodeMap() throws Exception { + @Alerts("true/false") + void _NamedNodeMap_NamedNodeMap() throws Exception { test("NamedNodeMap", "NamedNodeMap"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Navigator_Navigator() throws Exception { + @Alerts("true/false") + void _Navigator_Navigator() throws Exception { test("Navigator", "Navigator"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _NetworkInformation_NetworkInformation() throws Exception { + @Alerts(DEFAULT = "true/false", + FF = "false/false", + FF_ESR = "false/false") + void _NetworkInformation_NetworkInformation() throws Exception { test("NetworkInformation", "NetworkInformation"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_Attr() throws Exception { + @Alerts("true/true") + void _Node_Attr() throws Exception { test("Node", "Attr"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_Audio() throws Exception { + @Alerts("true/false") + void _Node_Audio() throws Exception { test("Node", "Audio"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_CDATASection() throws Exception { + @Alerts("true/false") + void _Node_CDATASection() throws Exception { test("Node", "CDATASection"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_CharacterData() throws Exception { + @Alerts("true/true") + void _Node_CharacterData() throws Exception { test("Node", "CharacterData"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_Comment() throws Exception { + @Alerts("true/false") + void _Node_Comment() throws Exception { test("Node", "Comment"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_Document() throws Exception { + @Alerts("true/true") + void _Node_Document() throws Exception { test("Node", "Document"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_DocumentFragment() throws Exception { + @Alerts("true/true") + void _Node_DocumentFragment() throws Exception { test("Node", "DocumentFragment"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_DocumentType() throws Exception { + @Alerts("true/true") + void _Node_DocumentType() throws Exception { test("Node", "DocumentType"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_Element() throws Exception { + @Alerts("true/true") + void _Node_Element() throws Exception { test("Node", "Element"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLAnchorElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLAnchorElement() throws Exception { test("Node", "HTMLAnchorElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("false") - public void _Node_HTMLAppletElement() throws Exception { + @Alerts("false/false") + void _Node_HTMLAppletElement() throws Exception { test("Node", "HTMLAppletElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLAreaElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLAreaElement() throws Exception { test("Node", "HTMLAreaElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLAudioElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLAudioElement() throws Exception { test("Node", "HTMLAudioElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLBaseElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLBaseElement() throws Exception { test("Node", "HTMLBaseElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("false") - public void _Node_HTMLBaseFontElement() throws Exception { + @Alerts("false/false") + void _Node_HTMLBaseFontElement() throws Exception { test("Node", "HTMLBaseFontElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("false") - public void _Node_HTMLBGSoundElement() throws Exception { + @Alerts("false/false") + void _Node_HTMLBGSoundElement() throws Exception { test("Node", "HTMLBGSoundElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("false") - public void _Node_HTMLBlockElement() throws Exception { + @Alerts("false/false") + void _Node_HTMLBlockElement() throws Exception { test("Node", "HTMLBlockElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLBodyElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLBodyElement() throws Exception { test("Node", "HTMLBodyElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLBRElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLBRElement() throws Exception { test("Node", "HTMLBRElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLButtonElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLButtonElement() throws Exception { test("Node", "HTMLButtonElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLCanvasElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLCanvasElement() throws Exception { test("Node", "HTMLCanvasElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLDataElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLDataElement() throws Exception { test("Node", "HTMLDataElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLDataListElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLDataListElement() throws Exception { test("Node", "HTMLDataListElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("false") - public void _Node_HTMLDDElement() throws Exception { + @Alerts("false/false") + void _Node_HTMLDDElement() throws Exception { test("Node", "HTMLDDElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLDetailsElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLDetailsElement() throws Exception { test("Node", "HTMLDetailsElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLDialogElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLDialogElement() throws Exception { test("Node", "HTMLDialogElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLDirectoryElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLDirectoryElement() throws Exception { test("Node", "HTMLDirectoryElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLDivElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLDivElement() throws Exception { test("Node", "HTMLDivElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLDListElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLDListElement() throws Exception { test("Node", "HTMLDListElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLDocument() throws Exception { + @Alerts("true/false") + void _Node_HTMLDocument() throws Exception { test("Node", "HTMLDocument"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("false") - public void _Node_HTMLDTElement() throws Exception { + @Alerts("false/false") + void _Node_HTMLDTElement() throws Exception { test("Node", "HTMLDTElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLElement() throws Exception { test("Node", "HTMLElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLEmbedElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLEmbedElement() throws Exception { test("Node", "HTMLEmbedElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLFieldSetElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLFieldSetElement() throws Exception { test("Node", "HTMLFieldSetElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLFontElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLFontElement() throws Exception { test("Node", "HTMLFontElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLFormElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLFormElement() throws Exception { test("Node", "HTMLFormElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLFrameElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLFrameElement() throws Exception { test("Node", "HTMLFrameElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLFrameSetElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLFrameSetElement() throws Exception { test("Node", "HTMLFrameSetElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLHeadElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLHeadElement() throws Exception { test("Node", "HTMLHeadElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLHeadingElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLHeadingElement() throws Exception { test("Node", "HTMLHeadingElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLHRElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLHRElement() throws Exception { test("Node", "HTMLHRElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLHtmlElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLHtmlElement() throws Exception { test("Node", "HTMLHtmlElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLIFrameElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLIFrameElement() throws Exception { test("Node", "HTMLIFrameElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLImageElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLImageElement() throws Exception { test("Node", "HTMLImageElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLInputElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLInputElement() throws Exception { test("Node", "HTMLInputElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("false") - public void _Node_HTMLIsIndexElement() throws Exception { + @Alerts("false/false") + void _Node_HTMLIsIndexElement() throws Exception { test("Node", "HTMLIsIndexElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLLabelElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLLabelElement() throws Exception { test("Node", "HTMLLabelElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLLegendElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLLegendElement() throws Exception { test("Node", "HTMLLegendElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLLIElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLLIElement() throws Exception { test("Node", "HTMLLIElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLLinkElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLLinkElement() throws Exception { test("Node", "HTMLLinkElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLMapElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLMapElement() throws Exception { test("Node", "HTMLMapElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLMarqueeElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLMarqueeElement() throws Exception { test("Node", "HTMLMarqueeElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLMediaElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLMediaElement() throws Exception { test("Node", "HTMLMediaElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLMenuElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLMenuElement() throws Exception { test("Node", "HTMLMenuElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("false") - public void _Node_HTMLMenuItemElement() throws Exception { + @Alerts("false/false") + void _Node_HTMLMenuItemElement() throws Exception { test("Node", "HTMLMenuItemElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLMetaElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLMetaElement() throws Exception { test("Node", "HTMLMetaElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLMeterElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLMeterElement() throws Exception { test("Node", "HTMLMeterElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLModElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLModElement() throws Exception { test("Node", "HTMLModElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("false") - public void _Node_HTMLNextIdElement() throws Exception { + @Alerts("false/false") + void _Node_HTMLNextIdElement() throws Exception { test("Node", "HTMLNextIdElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLObjectElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLObjectElement() throws Exception { test("Node", "HTMLObjectElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLOListElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLOListElement() throws Exception { test("Node", "HTMLOListElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLOptGroupElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLOptGroupElement() throws Exception { test("Node", "HTMLOptGroupElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLOptionElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLOptionElement() throws Exception { test("Node", "HTMLOptionElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLOutputElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLOutputElement() throws Exception { test("Node", "HTMLOutputElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLParagraphElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLParagraphElement() throws Exception { test("Node", "HTMLParagraphElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLParamElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLParamElement() throws Exception { test("Node", "HTMLParamElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("false") - public void _Node_HTMLPhraseElement() throws Exception { + @Alerts("false/false") + void _Node_HTMLPhraseElement() throws Exception { test("Node", "HTMLPhraseElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLPictureElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLPictureElement() throws Exception { test("Node", "HTMLPictureElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLPreElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLPreElement() throws Exception { test("Node", "HTMLPreElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLProgressElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLProgressElement() throws Exception { test("Node", "HTMLProgressElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLQuoteElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLQuoteElement() throws Exception { test("Node", "HTMLQuoteElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLScriptElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLScriptElement() throws Exception { test("Node", "HTMLScriptElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLSelectElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLSelectElement() throws Exception { test("Node", "HTMLSelectElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLSlotElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLSlotElement() throws Exception { test("Node", "HTMLSlotElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLSourceElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLSourceElement() throws Exception { test("Node", "HTMLSourceElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLSpanElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLSpanElement() throws Exception { test("Node", "HTMLSpanElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLStyleElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLStyleElement() throws Exception { test("Node", "HTMLStyleElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLTableCaptionElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLTableCaptionElement() throws Exception { test("Node", "HTMLTableCaptionElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLTableCellElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLTableCellElement() throws Exception { test("Node", "HTMLTableCellElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLTableColElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLTableColElement() throws Exception { test("Node", "HTMLTableColElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("false") - public void _Node_HTMLTableDataCellElement() throws Exception { + @Alerts("false/false") + void _Node_HTMLTableDataCellElement() throws Exception { test("Node", "HTMLTableDataCellElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLTableElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLTableElement() throws Exception { test("Node", "HTMLTableElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("false") - public void _Node_HTMLTableHeaderCellElement() throws Exception { + @Alerts("false/false") + void _Node_HTMLTableHeaderCellElement() throws Exception { test("Node", "HTMLTableHeaderCellElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLTableRowElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLTableRowElement() throws Exception { test("Node", "HTMLTableRowElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLTableSectionElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLTableSectionElement() throws Exception { test("Node", "HTMLTableSectionElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLTemplateElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLTemplateElement() throws Exception { test("Node", "HTMLTemplateElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLTextAreaElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLTextAreaElement() throws Exception { test("Node", "HTMLTextAreaElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLTimeElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLTimeElement() throws Exception { test("Node", "HTMLTimeElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLTitleElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLTitleElement() throws Exception { test("Node", "HTMLTitleElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLTrackElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLTrackElement() throws Exception { test("Node", "HTMLTrackElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLUListElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLUListElement() throws Exception { test("Node", "HTMLUListElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLUnknownElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLUnknownElement() throws Exception { test("Node", "HTMLUnknownElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_HTMLVideoElement() throws Exception { + @Alerts("true/false") + void _Node_HTMLVideoElement() throws Exception { test("Node", "HTMLVideoElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_Image() throws Exception { + @Alerts("true/false") + void _Node_Image() throws Exception { test("Node", "Image"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_Node() throws Exception { + @Alerts("true/false") + void _Node_Node() throws Exception { test("Node", "Node"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_Option() throws Exception { + @Alerts("true/false") + void _Node_Option() throws Exception { test("Node", "Option"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_ProcessingInstruction() throws Exception { + @Alerts("true/false") + void _Node_ProcessingInstruction() throws Exception { test("Node", "ProcessingInstruction"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_ShadowRoot() throws Exception { + @Alerts("true/false") + void _Node_ShadowRoot() throws Exception { test("Node", "ShadowRoot"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGAElement() throws Exception { + @Alerts("true/false") + void _Node_SVGAElement() throws Exception { test("Node", "SVGAElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGAnimateElement() throws Exception { + @Alerts("true/false") + void _Node_SVGAnimateElement() throws Exception { test("Node", "SVGAnimateElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGAnimateMotionElement() throws Exception { + @Alerts("true/false") + void _Node_SVGAnimateMotionElement() throws Exception { test("Node", "SVGAnimateMotionElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGAnimateTransformElement() throws Exception { + @Alerts("true/false") + void _Node_SVGAnimateTransformElement() throws Exception { test("Node", "SVGAnimateTransformElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGAnimationElement() throws Exception { + @Alerts("true/false") + void _Node_SVGAnimationElement() throws Exception { test("Node", "SVGAnimationElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGCircleElement() throws Exception { + @Alerts("true/false") + void _Node_SVGCircleElement() throws Exception { test("Node", "SVGCircleElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGClipPathElement() throws Exception { + @Alerts("true/false") + void _Node_SVGClipPathElement() throws Exception { test("Node", "SVGClipPathElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGComponentTransferFunctionElement() throws Exception { + @Alerts("true/false") + void _Node_SVGComponentTransferFunctionElement() throws Exception { test("Node", "SVGComponentTransferFunctionElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGDefsElement() throws Exception { + @Alerts("true/false") + void _Node_SVGDefsElement() throws Exception { test("Node", "SVGDefsElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGDescElement() throws Exception { + @Alerts("true/false") + void _Node_SVGDescElement() throws Exception { test("Node", "SVGDescElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGElement() throws Exception { + @Alerts("false/false") + void _Node_SVGDiscardElement() throws Exception { + test("Node", "SVGDiscardElement"); + } + + @Alerts("true/false") + void _Node_SVGElement() throws Exception { test("Node", "SVGElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGEllipseElement() throws Exception { + @Alerts("true/false") + void _Node_SVGEllipseElement() throws Exception { test("Node", "SVGEllipseElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEBlendElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFEBlendElement() throws Exception { test("Node", "SVGFEBlendElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEColorMatrixElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFEColorMatrixElement() throws Exception { test("Node", "SVGFEColorMatrixElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEComponentTransferElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFEComponentTransferElement() throws Exception { test("Node", "SVGFEComponentTransferElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFECompositeElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFECompositeElement() throws Exception { test("Node", "SVGFECompositeElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEConvolveMatrixElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFEConvolveMatrixElement() throws Exception { test("Node", "SVGFEConvolveMatrixElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEDiffuseLightingElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFEDiffuseLightingElement() throws Exception { test("Node", "SVGFEDiffuseLightingElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEDisplacementMapElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFEDisplacementMapElement() throws Exception { test("Node", "SVGFEDisplacementMapElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEDistantLightElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFEDistantLightElement() throws Exception { test("Node", "SVGFEDistantLightElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEDropShadowElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFEDropShadowElement() throws Exception { test("Node", "SVGFEDropShadowElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEFloodElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFEFloodElement() throws Exception { test("Node", "SVGFEFloodElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEFuncAElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFEFuncAElement() throws Exception { test("Node", "SVGFEFuncAElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEFuncBElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFEFuncBElement() throws Exception { test("Node", "SVGFEFuncBElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEFuncGElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFEFuncGElement() throws Exception { test("Node", "SVGFEFuncGElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEFuncRElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFEFuncRElement() throws Exception { test("Node", "SVGFEFuncRElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEGaussianBlurElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFEGaussianBlurElement() throws Exception { test("Node", "SVGFEGaussianBlurElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEImageElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFEImageElement() throws Exception { test("Node", "SVGFEImageElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEMergeElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFEMergeElement() throws Exception { test("Node", "SVGFEMergeElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEMergeNodeElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFEMergeNodeElement() throws Exception { test("Node", "SVGFEMergeNodeElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEMorphologyElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFEMorphologyElement() throws Exception { test("Node", "SVGFEMorphologyElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEOffsetElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFEOffsetElement() throws Exception { test("Node", "SVGFEOffsetElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFEPointLightElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFEPointLightElement() throws Exception { test("Node", "SVGFEPointLightElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFESpecularLightingElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFESpecularLightingElement() throws Exception { test("Node", "SVGFESpecularLightingElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFESpotLightElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFESpotLightElement() throws Exception { test("Node", "SVGFESpotLightElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFETileElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFETileElement() throws Exception { test("Node", "SVGFETileElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFETurbulenceElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFETurbulenceElement() throws Exception { test("Node", "SVGFETurbulenceElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGFilterElement() throws Exception { + @Alerts("true/false") + void _Node_SVGFilterElement() throws Exception { test("Node", "SVGFilterElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGForeignObjectElement() throws Exception { + @Alerts("true/false") + void _Node_SVGForeignObjectElement() throws Exception { test("Node", "SVGForeignObjectElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGGElement() throws Exception { + @Alerts("true/false") + void _Node_SVGGElement() throws Exception { test("Node", "SVGGElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGGeometryElement() throws Exception { + @Alerts("true/false") + void _Node_SVGGeometryElement() throws Exception { test("Node", "SVGGeometryElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGGradientElement() throws Exception { + @Alerts("true/false") + void _Node_SVGGradientElement() throws Exception { test("Node", "SVGGradientElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGGraphicsElement() throws Exception { + @Alerts("true/false") + void _Node_SVGGraphicsElement() throws Exception { test("Node", "SVGGraphicsElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGImageElement() throws Exception { + @Alerts("true/false") + void _Node_SVGImageElement() throws Exception { test("Node", "SVGImageElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGLinearGradientElement() throws Exception { + @Alerts("true/false") + void _Node_SVGLinearGradientElement() throws Exception { test("Node", "SVGLinearGradientElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGLineElement() throws Exception { + @Alerts("true/false") + void _Node_SVGLineElement() throws Exception { test("Node", "SVGLineElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGMarkerElement() throws Exception { + @Alerts("true/false") + void _Node_SVGMarkerElement() throws Exception { test("Node", "SVGMarkerElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGMaskElement() throws Exception { + @Alerts("true/false") + void _Node_SVGMaskElement() throws Exception { test("Node", "SVGMaskElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGMetadataElement() throws Exception { + @Alerts("true/false") + void _Node_SVGMetadataElement() throws Exception { test("Node", "SVGMetadataElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGMPathElement() throws Exception { + @Alerts("true/false") + void _Node_SVGMPathElement() throws Exception { test("Node", "SVGMPathElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGPathElement() throws Exception { + @Alerts("true/false") + void _Node_SVGPathElement() throws Exception { test("Node", "SVGPathElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGPatternElement() throws Exception { + @Alerts("true/false") + void _Node_SVGPatternElement() throws Exception { test("Node", "SVGPatternElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGPolygonElement() throws Exception { + @Alerts("true/false") + void _Node_SVGPolygonElement() throws Exception { test("Node", "SVGPolygonElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGPolylineElement() throws Exception { + @Alerts("true/false") + void _Node_SVGPolylineElement() throws Exception { test("Node", "SVGPolylineElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGRadialGradientElement() throws Exception { + @Alerts("true/false") + void _Node_SVGRadialGradientElement() throws Exception { test("Node", "SVGRadialGradientElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGRectElement() throws Exception { + @Alerts("true/false") + void _Node_SVGRectElement() throws Exception { test("Node", "SVGRectElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGScriptElement() throws Exception { + @Alerts("true/false") + void _Node_SVGScriptElement() throws Exception { test("Node", "SVGScriptElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGSetElement() throws Exception { + @Alerts("true/false") + void _Node_SVGSetElement() throws Exception { test("Node", "SVGSetElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGStopElement() throws Exception { + @Alerts("true/false") + void _Node_SVGStopElement() throws Exception { test("Node", "SVGStopElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGStyleElement() throws Exception { + @Alerts("true/false") + void _Node_SVGStyleElement() throws Exception { test("Node", "SVGStyleElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGSVGElement() throws Exception { + @Alerts("true/false") + void _Node_SVGSVGElement() throws Exception { test("Node", "SVGSVGElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGSwitchElement() throws Exception { + @Alerts("true/false") + void _Node_SVGSwitchElement() throws Exception { test("Node", "SVGSwitchElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGSymbolElement() throws Exception { + @Alerts("true/false") + void _Node_SVGSymbolElement() throws Exception { test("Node", "SVGSymbolElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGTextContentElement() throws Exception { + @Alerts("true/false") + void _Node_SVGTextContentElement() throws Exception { test("Node", "SVGTextContentElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGTextElement() throws Exception { + @Alerts("true/false") + void _Node_SVGTextElement() throws Exception { test("Node", "SVGTextElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGTextPathElement() throws Exception { + @Alerts("true/false") + void _Node_SVGTextPathElement() throws Exception { test("Node", "SVGTextPathElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGTextPositioningElement() throws Exception { + @Alerts("true/false") + void _Node_SVGTextPositioningElement() throws Exception { test("Node", "SVGTextPositioningElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGTitleElement() throws Exception { + @Alerts("true/false") + void _Node_SVGTitleElement() throws Exception { test("Node", "SVGTitleElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGTSpanElement() throws Exception { + @Alerts("true/false") + void _Node_SVGTSpanElement() throws Exception { test("Node", "SVGTSpanElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGUseElement() throws Exception { + @Alerts("true/false") + void _Node_SVGUseElement() throws Exception { test("Node", "SVGUseElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_SVGViewElement() throws Exception { + @Alerts("true/false") + void _Node_SVGViewElement() throws Exception { test("Node", "SVGViewElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_Text() throws Exception { + @Alerts("true/false") + void _Node_Text() throws Exception { test("Node", "Text"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Node_XMLDocument() throws Exception { + @Alerts("true/false") + void _Node_XMLDocument() throws Exception { test("Node", "XMLDocument"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("false") - @HtmlUnitNYI(CHROME = "true", - EDGE = "true", - FF = "true", - FF_ESR = "true") - public void _NodeFilter_NodeFilter() throws Exception { + @Alerts("false/false") + @HtmlUnitNYI(CHROME = "true/false", + EDGE = "true/false", + FF = "true/false", + FF_ESR = "true/false") + void _NodeFilter_NodeFilter() throws Exception { test("NodeFilter", "NodeFilter"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _NodeIterator_NodeIterator() throws Exception { + @Alerts("true/false") + void _NodeIterator_NodeIterator() throws Exception { test("NodeIterator", "NodeIterator"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _NodeList_NodeList() throws Exception { + @Alerts("true/false") + void _NodeList_NodeList() throws Exception { test("NodeList", "NodeList"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _NodeList_RadioNodeList() throws Exception { + @Alerts("true/true") + void _NodeList_RadioNodeList() throws Exception { test("NodeList", "RadioNodeList"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Notification_Notification() throws Exception { + @Alerts("true/false") + void _Notification_Notification() throws Exception { test("Notification", "Notification"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _OES_element_index_uint_OES_element_index_uint() throws Exception { + @Alerts("false/false") + void _OES_element_index_uint_OES_element_index_uint() throws Exception { test("OES_element_index_uint", "OES_element_index_uint"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _OES_standard_derivatives_OES_standard_derivatives() throws Exception { + @Alerts("false/false") + void _OES_standard_derivatives_OES_standard_derivatives() throws Exception { test("OES_standard_derivatives", "OES_standard_derivatives"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _OES_texture_float_linear_OES_texture_float_linear() throws Exception { + @Alerts("false/false") + void _OES_texture_float_linear_OES_texture_float_linear() throws Exception { test("OES_texture_float_linear", "OES_texture_float_linear"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _OES_texture_float_OES_texture_float() throws Exception { + @Alerts("false/false") + void _OES_texture_float_OES_texture_float() throws Exception { test("OES_texture_float", "OES_texture_float"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _OfflineAudioCompletionEvent_OfflineAudioCompletionEvent() throws Exception { + @Alerts("true/false") + void _OfflineAudioCompletionEvent_OfflineAudioCompletionEvent() throws Exception { test("OfflineAudioCompletionEvent", "OfflineAudioCompletionEvent"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _OfflineAudioContext_OfflineAudioContext() throws Exception { + @Alerts("true/false") + void _OfflineAudioContext_OfflineAudioContext() throws Exception { test("OfflineAudioContext", "OfflineAudioContext"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("false") - public void _OfflineResourceList_OfflineResourceList() throws Exception { + @Alerts("false/false") + void _OfflineResourceList_OfflineResourceList() throws Exception { test("OfflineResourceList", "OfflineResourceList"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Option_HTMLOptionElement() throws Exception { + @Alerts("true/false") + void _Option_HTMLOptionElement() throws Exception { // although Option != HTMLOptionElement, they seem to be synonyms!!! test("Option", "HTMLOptionElement"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Option_Option() throws Exception { + @Alerts("true/false") + void _Option_Option() throws Exception { test("Option", "Option"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _OscillatorNode_OscillatorNode() throws Exception { + @Alerts("true/false") + void _OscillatorNode_OscillatorNode() throws Exception { test("OscillatorNode", "OscillatorNode"); } diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfPTest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfPTest.java index 66f9966e52a..4411e8de5c7 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfPTest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfPTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,11 +16,8 @@ import java.util.Collection; -import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized.Parameters; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.params.provider.Arguments; /** * Tests two Host classes, if one prototype is parent of another. @@ -30,7 +27,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserParameterizedRunner.class) public class HostParentOfPTest extends HostParentOf { /** @@ -40,649 +36,351 @@ public class HostParentOfPTest extends HostParentOf { * @throws Exception * if an error occurs */ - @Parameters - public static Collection data() throws Exception { + public static Collection data() throws Exception { return HostParentOf.data(input -> { final char ch = Character.toUpperCase(input.charAt(0)); return ch >= 'P' && ch <= 'R'; }); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _PageTransitionEvent_PageTransitionEvent() throws Exception { + @Alerts("true/false") + void _PageTransitionEvent_PageTransitionEvent() throws Exception { test("PageTransitionEvent", "PageTransitionEvent"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _PannerNode_PannerNode() throws Exception { + @Alerts("true/false") + void _PannerNode_PannerNode() throws Exception { test("PannerNode", "PannerNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _PasswordCredential_PasswordCredential() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _PasswordCredential_PasswordCredential() throws Exception { test("PasswordCredential", "PasswordCredential"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Path2D_Path2D() throws Exception { + @Alerts("true/false") + void _Path2D_Path2D() throws Exception { test("Path2D", "Path2D"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _PaymentAddress_PaymentAddress() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _PaymentAddress_PaymentAddress() throws Exception { test("PaymentAddress", "PaymentAddress"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _PaymentRequest_PaymentRequest() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _PaymentRequest_PaymentRequest() throws Exception { test("PaymentRequest", "PaymentRequest"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _PaymentResponse_PaymentResponse() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _PaymentResponse_PaymentResponse() throws Exception { test("PaymentResponse", "PaymentResponse"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Performance_Performance() throws Exception { + @Alerts("true/false") + void _Performance_Performance() throws Exception { test("Performance", "Performance"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _PerformanceEntry_PerformanceEntry() throws Exception { + @Alerts("true/false") + void _PerformanceEntry_PerformanceEntry() throws Exception { test("PerformanceEntry", "PerformanceEntry"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _PerformanceEntry_PerformanceMark() throws Exception { + @Alerts("true/true") + void _PerformanceEntry_PerformanceMark() throws Exception { test("PerformanceEntry", "PerformanceMark"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _PerformanceEntry_PerformanceMeasure() throws Exception { + @Alerts("true/true") + void _PerformanceEntry_PerformanceMeasure() throws Exception { test("PerformanceEntry", "PerformanceMeasure"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _PerformanceEntry_PerformanceNavigationTiming() throws Exception { + @Alerts("true/false") + void _PerformanceEntry_PerformanceNavigationTiming() throws Exception { test("PerformanceEntry", "PerformanceNavigationTiming"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _PerformanceEntry_PerformanceResourceTiming() throws Exception { + @Alerts("true/true") + void _PerformanceEntry_PerformanceResourceTiming() throws Exception { test("PerformanceEntry", "PerformanceResourceTiming"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _PerformanceMark_PerformanceMark() throws Exception { + @Alerts("true/false") + void _PerformanceMark_PerformanceMark() throws Exception { test("PerformanceMark", "PerformanceMark"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _PerformanceMeasure_PerformanceMeasure() throws Exception { + @Alerts("true/false") + void _PerformanceMeasure_PerformanceMeasure() throws Exception { test("PerformanceMeasure", "PerformanceMeasure"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _PerformanceNavigation_PerformanceNavigation() throws Exception { + @Alerts("true/false") + void _PerformanceNavigation_PerformanceNavigation() throws Exception { test("PerformanceNavigation", "PerformanceNavigation"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _PerformanceNavigationTiming_PerformanceNavigationTiming() throws Exception { + @Alerts("true/false") + void _PerformanceNavigationTiming_PerformanceNavigationTiming() throws Exception { test("PerformanceNavigationTiming", "PerformanceNavigationTiming"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _PerformanceObserver_PerformanceObserver() throws Exception { + @Alerts("true/false") + void _PerformanceObserver_PerformanceObserver() throws Exception { test("PerformanceObserver", "PerformanceObserver"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _PerformanceObserverEntryList_PerformanceObserverEntryList() throws Exception { + @Alerts("true/false") + void _PerformanceObserverEntryList_PerformanceObserverEntryList() throws Exception { test("PerformanceObserverEntryList", "PerformanceObserverEntryList"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _PerformanceResourceTiming_PerformanceNavigationTiming() throws Exception { + @Alerts("true/true") + void _PerformanceResourceTiming_PerformanceNavigationTiming() throws Exception { test("PerformanceResourceTiming", "PerformanceNavigationTiming"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _PerformanceResourceTiming_PerformanceResourceTiming() throws Exception { + @Alerts("true/false") + void _PerformanceResourceTiming_PerformanceResourceTiming() throws Exception { test("PerformanceResourceTiming", "PerformanceResourceTiming"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _PerformanceTiming_PerformanceTiming() throws Exception { + @Alerts("true/false") + void _PerformanceTiming_PerformanceTiming() throws Exception { test("PerformanceTiming", "PerformanceTiming"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _PeriodicSyncManager_PeriodicSyncManager() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _PeriodicSyncManager_PeriodicSyncManager() throws Exception { test("PeriodicSyncManager", "PeriodicSyncManager"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _PeriodicWave_PeriodicWave() throws Exception { + @Alerts("true/false") + void _PeriodicWave_PeriodicWave() throws Exception { test("PeriodicWave", "PeriodicWave"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Permissions_Permissions() throws Exception { + @Alerts("true/false") + void _Permissions_Permissions() throws Exception { test("Permissions", "Permissions"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _PermissionStatus_PermissionStatus() throws Exception { + @Alerts("true/false") + void _PermissionStatus_PermissionStatus() throws Exception { test("PermissionStatus", "PermissionStatus"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Plugin_Plugin() throws Exception { + @Alerts("true/false") + void _Plugin_Plugin() throws Exception { test("Plugin", "Plugin"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _PluginArray_PluginArray() throws Exception { + @Alerts("true/false") + void _PluginArray_PluginArray() throws Exception { test("PluginArray", "PluginArray"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _PointerEvent_PointerEvent() throws Exception { + @Alerts("true/false") + void _PointerEvent_PointerEvent() throws Exception { test("PointerEvent", "PointerEvent"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _PopStateEvent_PopStateEvent() throws Exception { + @Alerts("true/false") + void _PopStateEvent_PopStateEvent() throws Exception { test("PopStateEvent", "PopStateEvent"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("false") - public void _Position_Position() throws Exception { + @Alerts("false/false") + void _Position_Position() throws Exception { test("Position", "Position"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("false") - public void _PositionError_PositionError() throws Exception { + @Alerts("false/false") + void _PositionError_PositionError() throws Exception { test("PositionError", "PositionError"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _Presentation_Presentation() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _Presentation_Presentation() throws Exception { test("Presentation", "Presentation"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _PresentationAvailability_PresentationAvailability() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _PresentationAvailability_PresentationAvailability() throws Exception { test("PresentationAvailability", "PresentationAvailability"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _PresentationConnection_PresentationConnection() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _PresentationConnection_PresentationConnection() throws Exception { test("PresentationConnection", "PresentationConnection"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _PresentationConnectionAvailableEvent_PresentationConnectionAvailableEvent() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _PresentationConnectionAvailableEvent_PresentationConnectionAvailableEvent() throws Exception { test("PresentationConnectionAvailableEvent", "PresentationConnectionAvailableEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _PresentationConnectionCloseEvent_PresentationConnectionCloseEvent() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _PresentationConnectionCloseEvent_PresentationConnectionCloseEvent() throws Exception { test("PresentationConnectionCloseEvent", "PresentationConnectionCloseEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _PresentationRequest_PresentationRequest() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _PresentationRequest_PresentationRequest() throws Exception { test("PresentationRequest", "PresentationRequest"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _ProcessingInstruction_ProcessingInstruction() throws Exception { + @Alerts("true/false") + void _ProcessingInstruction_ProcessingInstruction() throws Exception { test("ProcessingInstruction", "ProcessingInstruction"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _ProgressEvent_ProgressEvent() throws Exception { + @Alerts("true/false") + void _ProgressEvent_ProgressEvent() throws Exception { test("ProgressEvent", "ProgressEvent"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Promise_Promise() throws Exception { + @Alerts("true/false") + void _Promise_Promise() throws Exception { test("Promise", "Promise"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _PromiseRejectionEvent_PromiseRejectionEvent() throws Exception { + @Alerts("true/false") + void _PromiseRejectionEvent_PromiseRejectionEvent() throws Exception { test("PromiseRejectionEvent", "PromiseRejectionEvent"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _PushManager_PushManager() throws Exception { + @Alerts("true/false") + void _PushManager_PushManager() throws Exception { test("PushManager", "PushManager"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _PushSubscription_PushSubscription() throws Exception { + @Alerts("true/false") + void _PushSubscription_PushSubscription() throws Exception { test("PushSubscription", "PushSubscription"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _PushSubscriptionOptions_PushSubscriptionOptions() throws Exception { + @Alerts("true/false") + void _PushSubscriptionOptions_PushSubscriptionOptions() throws Exception { test("PushSubscriptionOptions", "PushSubscriptionOptions"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _RadioNodeList_RadioNodeList() throws Exception { + @Alerts("true/false") + void _RadioNodeList_RadioNodeList() throws Exception { test("RadioNodeList", "RadioNodeList"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Range_Range() throws Exception { + @Alerts("true/false") + void _Range_Range() throws Exception { test("Range", "Range"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _ReadableStream_ReadableStream() throws Exception { + @Alerts("true/false") + void _ReadableStream_ReadableStream() throws Exception { test("ReadableStream", "ReadableStream"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _RemotePlayback_RemotePlayback() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _RemotePlayback_RemotePlayback() throws Exception { test("RemotePlayback", "RemotePlayback"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Request_Request() throws Exception { + @Alerts("true/false") + void _Request_Request() throws Exception { test("Request", "Request"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _Response_Response() throws Exception { + @Alerts("true/false") + void _Response_Response() throws Exception { test("Response", "Response"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _RTCCertificate_RTCCertificate() throws Exception { + @Alerts("true/false") + void _RTCCertificate_RTCCertificate() throws Exception { test("RTCCertificate", "RTCCertificate"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _RTCDataChannelEvent_RTCDataChannelEvent() throws Exception { + @Alerts("true/false") + void _RTCDataChannelEvent_RTCDataChannelEvent() throws Exception { test("RTCDataChannelEvent", "RTCDataChannelEvent"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("false") - public void _RTCIceCandidate_mozRTCIceCandidate() throws Exception { + @Alerts("false/false") + void _RTCIceCandidate_mozRTCIceCandidate() throws Exception { test("RTCIceCandidate", "mozRTCIceCandidate"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _RTCIceCandidate_RTCIceCandidate() throws Exception { + @Alerts("true/false") + void _RTCIceCandidate_RTCIceCandidate() throws Exception { test("RTCIceCandidate", "RTCIceCandidate"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _RTCPeerConnection_mozRTCPeerConnection() throws Exception { + @Alerts("false/false") + void _RTCPeerConnection_mozRTCPeerConnection() throws Exception { test("RTCPeerConnection", "mozRTCPeerConnection"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _RTCPeerConnection_RTCPeerConnection() throws Exception { + @Alerts("true/false") + void _RTCPeerConnection_RTCPeerConnection() throws Exception { test("RTCPeerConnection", "RTCPeerConnection"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _RTCPeerConnection_webkitRTCPeerConnection() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _RTCPeerConnection_webkitRTCPeerConnection() throws Exception { test("RTCPeerConnection", "webkitRTCPeerConnection"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _RTCPeerConnectionIceEvent_RTCPeerConnectionIceEvent() throws Exception { + @Alerts("true/false") + void _RTCPeerConnectionIceEvent_RTCPeerConnectionIceEvent() throws Exception { test("RTCPeerConnectionIceEvent", "RTCPeerConnectionIceEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _RTCSctpTransport_RTCSctpTransport() throws Exception { + @Alerts("true/false") + void _RTCSctpTransport_RTCSctpTransport() throws Exception { test("RTCSctpTransport", "RTCSctpTransport"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _RTCSessionDescription_mozRTCSessionDescription() throws Exception { + @Alerts("false/false") + void _RTCSessionDescription_mozRTCSessionDescription() throws Exception { test("RTCSessionDescription", "mozRTCSessionDescription"); } - /** - * @throws Exception - * if the test fails - */ - @Test - @Alerts("true") - public void _RTCSessionDescription_RTCSessionDescription() throws Exception { + @Alerts("true/false") + void _RTCSessionDescription_RTCSessionDescription() throws Exception { test("RTCSessionDescription", "RTCSessionDescription"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _RTCStatsReport_RTCStatsReport() throws Exception { + @Alerts("true/false") + void _RTCStatsReport_RTCStatsReport() throws Exception { test("RTCStatsReport", "RTCStatsReport"); } diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfS2Test.java b/src/test/java/org/htmlunit/general/huge/HostParentOfS2Test.java index de12f48fb1f..c2d685baf76 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfS2Test.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfS2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,12 +17,9 @@ import java.util.Collection; import org.apache.commons.lang3.StringUtils; -import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized.Parameters; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; +import org.junit.jupiter.params.provider.Arguments; /** * Tests two Host classes, if one prototype is parent of another. @@ -32,7 +29,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserParameterizedRunner.class) public class HostParentOfS2Test extends HostParentOf { /** @@ -40,1142 +36,641 @@ public class HostParentOfS2Test extends HostParentOf { * @return the parameterized data * @throws Exception if an error occurs */ - @Parameters - public static Collection data() throws Exception { + public static Collection data() throws Exception { return HostParentOf.data(input -> { final char ch = Character.toUpperCase(input.charAt(0)); return ch == 'S' && StringUtils.compareIgnoreCase(input, "SVGG") >= 0; }); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGElement_SVGGElement() throws Exception { + @Alerts("true/false") + void _SVGGElement_SVGGElement() throws Exception { test("SVGGElement", "SVGGElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGeometryElement_SVGCircleElement() throws Exception { + @Alerts("true/true") + void _SVGGeometryElement_SVGCircleElement() throws Exception { test("SVGGeometryElement", "SVGCircleElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGeometryElement_SVGEllipseElement() throws Exception { + @Alerts("true/true") + void _SVGGeometryElement_SVGEllipseElement() throws Exception { test("SVGGeometryElement", "SVGEllipseElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGeometryElement_SVGGeometryElement() throws Exception { + @Alerts("true/false") + void _SVGGeometryElement_SVGGeometryElement() throws Exception { test("SVGGeometryElement", "SVGGeometryElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGeometryElement_SVGLineElement() throws Exception { + @Alerts("true/true") + void _SVGGeometryElement_SVGLineElement() throws Exception { test("SVGGeometryElement", "SVGLineElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGeometryElement_SVGPathElement() throws Exception { + @Alerts("true/true") + void _SVGGeometryElement_SVGPathElement() throws Exception { test("SVGGeometryElement", "SVGPathElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGeometryElement_SVGPolygonElement() throws Exception { + @Alerts("true/true") + void _SVGGeometryElement_SVGPolygonElement() throws Exception { test("SVGGeometryElement", "SVGPolygonElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGeometryElement_SVGPolylineElement() throws Exception { + @Alerts("true/true") + void _SVGGeometryElement_SVGPolylineElement() throws Exception { test("SVGGeometryElement", "SVGPolylineElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGeometryElement_SVGRectElement() throws Exception { + @Alerts("true/true") + void _SVGGeometryElement_SVGRectElement() throws Exception { test("SVGGeometryElement", "SVGRectElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGradientElement_SVGGradientElement() throws Exception { + @Alerts("true/false") + void _SVGGradientElement_SVGGradientElement() throws Exception { test("SVGGradientElement", "SVGGradientElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGradientElement_SVGLinearGradientElement() throws Exception { + @Alerts("true/true") + void _SVGGradientElement_SVGLinearGradientElement() throws Exception { test("SVGGradientElement", "SVGLinearGradientElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGradientElement_SVGRadialGradientElement() throws Exception { + @Alerts("true/true") + void _SVGGradientElement_SVGRadialGradientElement() throws Exception { test("SVGGradientElement", "SVGRadialGradientElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGraphicsElement_SVGAElement() throws Exception { + @Alerts("true/true") + void _SVGGraphicsElement_SVGAElement() throws Exception { test("SVGGraphicsElement", "SVGAElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGraphicsElement_SVGCircleElement() throws Exception { + @Alerts("true/false") + void _SVGGraphicsElement_SVGCircleElement() throws Exception { test("SVGGraphicsElement", "SVGCircleElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGGraphicsElement_SVGClipPathElement() throws Exception { + @Alerts("false/false") + void _SVGGraphicsElement_SVGClipPathElement() throws Exception { test("SVGGraphicsElement", "SVGClipPathElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGraphicsElement_SVGDefsElement() throws Exception { + @Alerts("true/true") + void _SVGGraphicsElement_SVGDefsElement() throws Exception { test("SVGGraphicsElement", "SVGDefsElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGraphicsElement_SVGEllipseElement() throws Exception { + @Alerts("true/false") + void _SVGGraphicsElement_SVGEllipseElement() throws Exception { test("SVGGraphicsElement", "SVGEllipseElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGraphicsElement_SVGForeignObjectElement() throws Exception { + @Alerts("true/true") + void _SVGGraphicsElement_SVGForeignObjectElement() throws Exception { test("SVGGraphicsElement", "SVGForeignObjectElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGraphicsElement_SVGGElement() throws Exception { + @Alerts("true/true") + void _SVGGraphicsElement_SVGGElement() throws Exception { test("SVGGraphicsElement", "SVGGElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGraphicsElement_SVGGeometryElement() throws Exception { + @Alerts("true/true") + void _SVGGraphicsElement_SVGGeometryElement() throws Exception { test("SVGGraphicsElement", "SVGGeometryElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGraphicsElement_SVGGraphicsElement() throws Exception { + @Alerts("true/false") + void _SVGGraphicsElement_SVGGraphicsElement() throws Exception { test("SVGGraphicsElement", "SVGGraphicsElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGraphicsElement_SVGImageElement() throws Exception { + @Alerts("true/true") + void _SVGGraphicsElement_SVGImageElement() throws Exception { test("SVGGraphicsElement", "SVGImageElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGraphicsElement_SVGLineElement() throws Exception { + @Alerts("true/false") + void _SVGGraphicsElement_SVGLineElement() throws Exception { test("SVGGraphicsElement", "SVGLineElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGraphicsElement_SVGPathElement() throws Exception { + @Alerts("true/false") + void _SVGGraphicsElement_SVGPathElement() throws Exception { test("SVGGraphicsElement", "SVGPathElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGraphicsElement_SVGPolygonElement() throws Exception { + @Alerts("true/false") + void _SVGGraphicsElement_SVGPolygonElement() throws Exception { test("SVGGraphicsElement", "SVGPolygonElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGraphicsElement_SVGPolylineElement() throws Exception { + @Alerts("true/false") + void _SVGGraphicsElement_SVGPolylineElement() throws Exception { test("SVGGraphicsElement", "SVGPolylineElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGraphicsElement_SVGRectElement() throws Exception { + @Alerts("true/false") + void _SVGGraphicsElement_SVGRectElement() throws Exception { test("SVGGraphicsElement", "SVGRectElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGraphicsElement_SVGSVGElement() throws Exception { + @Alerts("true/true") + void _SVGGraphicsElement_SVGSVGElement() throws Exception { test("SVGGraphicsElement", "SVGSVGElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGraphicsElement_SVGSwitchElement() throws Exception { + @Alerts("true/true") + void _SVGGraphicsElement_SVGSwitchElement() throws Exception { test("SVGGraphicsElement", "SVGSwitchElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGraphicsElement_SVGTextContentElement() throws Exception { + @Alerts("true/true") + void _SVGGraphicsElement_SVGTextContentElement() throws Exception { test("SVGGraphicsElement", "SVGTextContentElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGraphicsElement_SVGTextElement() throws Exception { + @Alerts("true/false") + void _SVGGraphicsElement_SVGTextElement() throws Exception { test("SVGGraphicsElement", "SVGTextElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGraphicsElement_SVGTextPathElement() throws Exception { + @Alerts("true/false") + void _SVGGraphicsElement_SVGTextPathElement() throws Exception { test("SVGGraphicsElement", "SVGTextPathElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGraphicsElement_SVGTextPositioningElement() throws Exception { + @Alerts("true/false") + void _SVGGraphicsElement_SVGTextPositioningElement() throws Exception { test("SVGGraphicsElement", "SVGTextPositioningElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGraphicsElement_SVGTSpanElement() throws Exception { + @Alerts("true/false") + void _SVGGraphicsElement_SVGTSpanElement() throws Exception { test("SVGGraphicsElement", "SVGTSpanElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGGraphicsElement_SVGUseElement() throws Exception { + @Alerts("true/true") + void _SVGGraphicsElement_SVGUseElement() throws Exception { test("SVGGraphicsElement", "SVGUseElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGImageElement_SVGImageElement() throws Exception { + @Alerts("true/false") + void _SVGImageElement_SVGImageElement() throws Exception { test("SVGImageElement", "SVGImageElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGLength_SVGLength() throws Exception { + @Alerts("true/false") + void _SVGLength_SVGLength() throws Exception { test("SVGLength", "SVGLength"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGLengthList_SVGLengthList() throws Exception { + @Alerts("true/false") + void _SVGLengthList_SVGLengthList() throws Exception { test("SVGLengthList", "SVGLengthList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGLinearGradientElement_SVGLinearGradientElement() throws Exception { + @Alerts("true/false") + void _SVGLinearGradientElement_SVGLinearGradientElement() throws Exception { test("SVGLinearGradientElement", "SVGLinearGradientElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGLineElement_SVGLineElement() throws Exception { + @Alerts("true/false") + void _SVGLineElement_SVGLineElement() throws Exception { test("SVGLineElement", "SVGLineElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGMarkerElement_SVGMarkerElement() throws Exception { + @Alerts("true/false") + void _SVGMarkerElement_SVGMarkerElement() throws Exception { test("SVGMarkerElement", "SVGMarkerElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGMaskElement_SVGMaskElement() throws Exception { + @Alerts("true/false") + void _SVGMaskElement_SVGMaskElement() throws Exception { test("SVGMaskElement", "SVGMaskElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGMatrix_SVGMatrix() throws Exception { + @Alerts("true/false") + void _SVGMatrix_SVGMatrix() throws Exception { test("SVGMatrix", "SVGMatrix"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGMetadataElement_SVGMetadataElement() throws Exception { + @Alerts("true/false") + void _SVGMetadataElement_SVGMetadataElement() throws Exception { test("SVGMetadataElement", "SVGMetadataElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGMPathElement_SVGMPathElement() throws Exception { + @Alerts("true/false") + void _SVGMPathElement_SVGMPathElement() throws Exception { test("SVGMPathElement", "SVGMPathElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGNumber_SVGNumber() throws Exception { + @Alerts("true/false") + void _SVGNumber_SVGNumber() throws Exception { test("SVGNumber", "SVGNumber"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGNumberList_SVGNumberList() throws Exception { + @Alerts("true/false") + void _SVGNumberList_SVGNumberList() throws Exception { test("SVGNumberList", "SVGNumberList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGPathElement_SVGPathElement() throws Exception { + @Alerts("true/false") + void _SVGPathElement_SVGPathElement() throws Exception { test("SVGPathElement", "SVGPathElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSeg_SVGPathSeg() throws Exception { + @Alerts("false/false") + void _SVGPathSeg_SVGPathSeg() throws Exception { test("SVGPathSeg", "SVGPathSeg"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSeg_SVGPathSegArcAbs() throws Exception { + @Alerts("false/false") + void _SVGPathSeg_SVGPathSegArcAbs() throws Exception { test("SVGPathSeg", "SVGPathSegArcAbs"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSeg_SVGPathSegArcRel() throws Exception { + @Alerts("false/false") + void _SVGPathSeg_SVGPathSegArcRel() throws Exception { test("SVGPathSeg", "SVGPathSegArcRel"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSeg_SVGPathSegClosePath() throws Exception { + @Alerts("false/false") + void _SVGPathSeg_SVGPathSegClosePath() throws Exception { test("SVGPathSeg", "SVGPathSegClosePath"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSeg_SVGPathSegCurvetoCubicAbs() throws Exception { + @Alerts("false/false") + void _SVGPathSeg_SVGPathSegCurvetoCubicAbs() throws Exception { test("SVGPathSeg", "SVGPathSegCurvetoCubicAbs"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSeg_SVGPathSegCurvetoCubicRel() throws Exception { + @Alerts("false/false") + void _SVGPathSeg_SVGPathSegCurvetoCubicRel() throws Exception { test("SVGPathSeg", "SVGPathSegCurvetoCubicRel"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSeg_SVGPathSegCurvetoCubicSmoothAbs() throws Exception { + @Alerts("false/false") + void _SVGPathSeg_SVGPathSegCurvetoCubicSmoothAbs() throws Exception { test("SVGPathSeg", "SVGPathSegCurvetoCubicSmoothAbs"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSeg_SVGPathSegCurvetoCubicSmoothRel() throws Exception { + @Alerts("false/false") + void _SVGPathSeg_SVGPathSegCurvetoCubicSmoothRel() throws Exception { test("SVGPathSeg", "SVGPathSegCurvetoCubicSmoothRel"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSeg_SVGPathSegCurvetoQuadraticAbs() throws Exception { + @Alerts("false/false") + void _SVGPathSeg_SVGPathSegCurvetoQuadraticAbs() throws Exception { test("SVGPathSeg", "SVGPathSegCurvetoQuadraticAbs"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSeg_SVGPathSegCurvetoQuadraticRel() throws Exception { + @Alerts("false/false") + void _SVGPathSeg_SVGPathSegCurvetoQuadraticRel() throws Exception { test("SVGPathSeg", "SVGPathSegCurvetoQuadraticRel"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSeg_SVGPathSegCurvetoQuadraticSmoothAbs() throws Exception { + @Alerts("false/false") + void _SVGPathSeg_SVGPathSegCurvetoQuadraticSmoothAbs() throws Exception { test("SVGPathSeg", "SVGPathSegCurvetoQuadraticSmoothAbs"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSeg_SVGPathSegCurvetoQuadraticSmoothRel() throws Exception { + @Alerts("false/false") + void _SVGPathSeg_SVGPathSegCurvetoQuadraticSmoothRel() throws Exception { test("SVGPathSeg", "SVGPathSegCurvetoQuadraticSmoothRel"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSeg_SVGPathSegLinetoAbs() throws Exception { + @Alerts("false/false") + void _SVGPathSeg_SVGPathSegLinetoAbs() throws Exception { test("SVGPathSeg", "SVGPathSegLinetoAbs"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSeg_SVGPathSegLinetoHorizontalAbs() throws Exception { + @Alerts("false/false") + void _SVGPathSeg_SVGPathSegLinetoHorizontalAbs() throws Exception { test("SVGPathSeg", "SVGPathSegLinetoHorizontalAbs"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSeg_SVGPathSegLinetoHorizontalRel() throws Exception { + @Alerts("false/false") + void _SVGPathSeg_SVGPathSegLinetoHorizontalRel() throws Exception { test("SVGPathSeg", "SVGPathSegLinetoHorizontalRel"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSeg_SVGPathSegLinetoRel() throws Exception { + @Alerts("false/false") + void _SVGPathSeg_SVGPathSegLinetoRel() throws Exception { test("SVGPathSeg", "SVGPathSegLinetoRel"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSeg_SVGPathSegLinetoVerticalAbs() throws Exception { + @Alerts("false/false") + void _SVGPathSeg_SVGPathSegLinetoVerticalAbs() throws Exception { test("SVGPathSeg", "SVGPathSegLinetoVerticalAbs"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSeg_SVGPathSegLinetoVerticalRel() throws Exception { + @Alerts("false/false") + void _SVGPathSeg_SVGPathSegLinetoVerticalRel() throws Exception { test("SVGPathSeg", "SVGPathSegLinetoVerticalRel"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSeg_SVGPathSegMovetoAbs() throws Exception { + @Alerts("false/false") + void _SVGPathSeg_SVGPathSegMovetoAbs() throws Exception { test("SVGPathSeg", "SVGPathSegMovetoAbs"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSeg_SVGPathSegMovetoRel() throws Exception { + @Alerts("false/false") + void _SVGPathSeg_SVGPathSegMovetoRel() throws Exception { test("SVGPathSeg", "SVGPathSegMovetoRel"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSegArcAbs_SVGPathSegArcAbs() throws Exception { + @Alerts("false/false") + void _SVGPathSegArcAbs_SVGPathSegArcAbs() throws Exception { test("SVGPathSegArcAbs", "SVGPathSegArcAbs"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSegArcRel_SVGPathSegArcRel() throws Exception { + @Alerts("false/false") + void _SVGPathSegArcRel_SVGPathSegArcRel() throws Exception { test("SVGPathSegArcRel", "SVGPathSegArcRel"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSegClosePath_SVGPathSegClosePath() throws Exception { + @Alerts("false/false") + void _SVGPathSegClosePath_SVGPathSegClosePath() throws Exception { test("SVGPathSegClosePath", "SVGPathSegClosePath"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSegCurvetoCubicAbs_SVGPathSegCurvetoCubicAbs() throws Exception { + @Alerts("false/false") + void _SVGPathSegCurvetoCubicAbs_SVGPathSegCurvetoCubicAbs() throws Exception { test("SVGPathSegCurvetoCubicAbs", "SVGPathSegCurvetoCubicAbs"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSegCurvetoCubicRel_SVGPathSegCurvetoCubicRel() throws Exception { + @Alerts("false/false") + void _SVGPathSegCurvetoCubicRel_SVGPathSegCurvetoCubicRel() throws Exception { test("SVGPathSegCurvetoCubicRel", "SVGPathSegCurvetoCubicRel"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSegCurvetoCubicSmoothAbs_SVGPathSegCurvetoCubicSmoothAbs() throws Exception { + @Alerts("false/false") + void _SVGPathSegCurvetoCubicSmoothAbs_SVGPathSegCurvetoCubicSmoothAbs() throws Exception { test("SVGPathSegCurvetoCubicSmoothAbs", "SVGPathSegCurvetoCubicSmoothAbs"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSegCurvetoCubicSmoothRel_SVGPathSegCurvetoCubicSmoothRel() throws Exception { + @Alerts("false/false") + void _SVGPathSegCurvetoCubicSmoothRel_SVGPathSegCurvetoCubicSmoothRel() throws Exception { test("SVGPathSegCurvetoCubicSmoothRel", "SVGPathSegCurvetoCubicSmoothRel"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSegCurvetoQuadraticAbs_SVGPathSegCurvetoQuadraticAbs() throws Exception { + @Alerts("false/false") + void _SVGPathSegCurvetoQuadraticAbs_SVGPathSegCurvetoQuadraticAbs() throws Exception { test("SVGPathSegCurvetoQuadraticAbs", "SVGPathSegCurvetoQuadraticAbs"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSegCurvetoQuadraticRel_SVGPathSegCurvetoQuadraticRel() throws Exception { + @Alerts("false/false") + void _SVGPathSegCurvetoQuadraticRel_SVGPathSegCurvetoQuadraticRel() throws Exception { test("SVGPathSegCurvetoQuadraticRel", "SVGPathSegCurvetoQuadraticRel"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSegCurvetoQuadraticSmoothAbs_SVGPathSegCurvetoQuadraticSmoothAbs() throws Exception { + @Alerts("false/false") + void _SVGPathSegCurvetoQuadraticSmoothAbs_SVGPathSegCurvetoQuadraticSmoothAbs() throws Exception { test("SVGPathSegCurvetoQuadraticSmoothAbs", "SVGPathSegCurvetoQuadraticSmoothAbs"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSegCurvetoQuadraticSmoothRel_SVGPathSegCurvetoQuadraticSmoothRel() throws Exception { + @Alerts("false/false") + void _SVGPathSegCurvetoQuadraticSmoothRel_SVGPathSegCurvetoQuadraticSmoothRel() throws Exception { test("SVGPathSegCurvetoQuadraticSmoothRel", "SVGPathSegCurvetoQuadraticSmoothRel"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSegLinetoAbs_SVGPathSegLinetoAbs() throws Exception { + @Alerts("false/false") + void _SVGPathSegLinetoAbs_SVGPathSegLinetoAbs() throws Exception { test("SVGPathSegLinetoAbs", "SVGPathSegLinetoAbs"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSegLinetoHorizontalAbs_SVGPathSegLinetoHorizontalAbs() throws Exception { + @Alerts("false/false") + void _SVGPathSegLinetoHorizontalAbs_SVGPathSegLinetoHorizontalAbs() throws Exception { test("SVGPathSegLinetoHorizontalAbs", "SVGPathSegLinetoHorizontalAbs"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSegLinetoHorizontalRel_SVGPathSegLinetoHorizontalRel() throws Exception { + @Alerts("false/false") + void _SVGPathSegLinetoHorizontalRel_SVGPathSegLinetoHorizontalRel() throws Exception { test("SVGPathSegLinetoHorizontalRel", "SVGPathSegLinetoHorizontalRel"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSegLinetoRel_SVGPathSegLinetoRel() throws Exception { + @Alerts("false/false") + void _SVGPathSegLinetoRel_SVGPathSegLinetoRel() throws Exception { test("SVGPathSegLinetoRel", "SVGPathSegLinetoRel"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSegLinetoVerticalAbs_SVGPathSegLinetoVerticalAbs() throws Exception { + @Alerts("false/false") + void _SVGPathSegLinetoVerticalAbs_SVGPathSegLinetoVerticalAbs() throws Exception { test("SVGPathSegLinetoVerticalAbs", "SVGPathSegLinetoVerticalAbs"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSegLinetoVerticalRel_SVGPathSegLinetoVerticalRel() throws Exception { + @Alerts("false/false") + void _SVGPathSegLinetoVerticalRel_SVGPathSegLinetoVerticalRel() throws Exception { test("SVGPathSegLinetoVerticalRel", "SVGPathSegLinetoVerticalRel"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSegList_SVGPathSegList() throws Exception { + @Alerts("false/false") + void _SVGPathSegList_SVGPathSegList() throws Exception { test("SVGPathSegList", "SVGPathSegList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSegMovetoAbs_SVGPathSegMovetoAbs() throws Exception { + @Alerts("false/false") + void _SVGPathSegMovetoAbs_SVGPathSegMovetoAbs() throws Exception { test("SVGPathSegMovetoAbs", "SVGPathSegMovetoAbs"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGPathSegMovetoRel_SVGPathSegMovetoRel() throws Exception { + @Alerts("false/false") + void _SVGPathSegMovetoRel_SVGPathSegMovetoRel() throws Exception { test("SVGPathSegMovetoRel", "SVGPathSegMovetoRel"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGPatternElement_SVGPatternElement() throws Exception { + @Alerts("true/false") + void _SVGPatternElement_SVGPatternElement() throws Exception { test("SVGPatternElement", "SVGPatternElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGPoint_SVGPoint() throws Exception { + @Alerts("true/false") + void _SVGPoint_SVGPoint() throws Exception { test("SVGPoint", "SVGPoint"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGPointList_SVGPointList() throws Exception { + @Alerts("true/false") + void _SVGPointList_SVGPointList() throws Exception { test("SVGPointList", "SVGPointList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGPolygonElement_SVGPolygonElement() throws Exception { + @Alerts("true/false") + void _SVGPolygonElement_SVGPolygonElement() throws Exception { test("SVGPolygonElement", "SVGPolygonElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGPolylineElement_SVGPolylineElement() throws Exception { + @Alerts("true/false") + void _SVGPolylineElement_SVGPolylineElement() throws Exception { test("SVGPolylineElement", "SVGPolylineElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGPreserveAspectRatio_SVGPreserveAspectRatio() throws Exception { + @Alerts("true/false") + void _SVGPreserveAspectRatio_SVGPreserveAspectRatio() throws Exception { test("SVGPreserveAspectRatio", "SVGPreserveAspectRatio"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGRadialGradientElement_SVGRadialGradientElement() throws Exception { + @Alerts("true/false") + void _SVGRadialGradientElement_SVGRadialGradientElement() throws Exception { test("SVGRadialGradientElement", "SVGRadialGradientElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGRect_SVGRect() throws Exception { + @Alerts("true/false") + void _SVGRect_SVGRect() throws Exception { test("SVGRect", "SVGRect"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGRectElement_SVGRectElement() throws Exception { + @Alerts("true/false") + void _SVGRectElement_SVGRectElement() throws Exception { test("SVGRectElement", "SVGRectElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGScriptElement_SVGScriptElement() throws Exception { + @Alerts("true/false") + void _SVGScriptElement_SVGScriptElement() throws Exception { test("SVGScriptElement", "SVGScriptElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGSetElement_SVGSetElement() throws Exception { + @Alerts("true/false") + void _SVGSetElement_SVGSetElement() throws Exception { test("SVGSetElement", "SVGSetElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGStopElement_SVGStopElement() throws Exception { + @Alerts("true/false") + void _SVGStopElement_SVGStopElement() throws Exception { test("SVGStopElement", "SVGStopElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGStringList_SVGStringList() throws Exception { + @Alerts("true/false") + void _SVGStringList_SVGStringList() throws Exception { test("SVGStringList", "SVGStringList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGStyleElement_SVGStyleElement() throws Exception { + @Alerts("true/false") + void _SVGStyleElement_SVGStyleElement() throws Exception { test("SVGStyleElement", "SVGStyleElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGSVGElement_SVGSVGElement() throws Exception { + @Alerts("true/false") + void _SVGSVGElement_SVGSVGElement() throws Exception { test("SVGSVGElement", "SVGSVGElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGSwitchElement_SVGSwitchElement() throws Exception { + @Alerts("true/false") + void _SVGSwitchElement_SVGSwitchElement() throws Exception { test("SVGSwitchElement", "SVGSwitchElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGSymbolElement_SVGSymbolElement() throws Exception { + @Alerts("true/false") + void _SVGSymbolElement_SVGSymbolElement() throws Exception { test("SVGSymbolElement", "SVGSymbolElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGTextContentElement_SVGTextContentElement() throws Exception { + @Alerts("true/false") + void _SVGTextContentElement_SVGTextContentElement() throws Exception { test("SVGTextContentElement", "SVGTextContentElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGTextContentElement_SVGTextElement() throws Exception { + @Alerts("true/false") + void _SVGTextContentElement_SVGTextElement() throws Exception { test("SVGTextContentElement", "SVGTextElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGTextContentElement_SVGTextPathElement() throws Exception { + @Alerts("true/true") + void _SVGTextContentElement_SVGTextPathElement() throws Exception { test("SVGTextContentElement", "SVGTextPathElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGTextContentElement_SVGTextPositioningElement() throws Exception { + @Alerts("true/true") + void _SVGTextContentElement_SVGTextPositioningElement() throws Exception { test("SVGTextContentElement", "SVGTextPositioningElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGTextContentElement_SVGTSpanElement() throws Exception { + @Alerts("true/false") + void _SVGTextContentElement_SVGTSpanElement() throws Exception { test("SVGTextContentElement", "SVGTSpanElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGTextElement_SVGTextElement() throws Exception { + @Alerts("true/false") + void _SVGTextElement_SVGTextElement() throws Exception { test("SVGTextElement", "SVGTextElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGTextPathElement_SVGTextPathElement() throws Exception { + @Alerts("true/false") + void _SVGTextPathElement_SVGTextPathElement() throws Exception { test("SVGTextPathElement", "SVGTextPathElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGTextPositioningElement_SVGTextElement() throws Exception { + @Alerts("true/true") + void _SVGTextPositioningElement_SVGTextElement() throws Exception { test("SVGTextPositioningElement", "SVGTextElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGTextPositioningElement_SVGTextPositioningElement() throws Exception { + @Alerts("true/false") + void _SVGTextPositioningElement_SVGTextPositioningElement() throws Exception { test("SVGTextPositioningElement", "SVGTextPositioningElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGTextPositioningElement_SVGTSpanElement() throws Exception { + @Alerts("true/true") + void _SVGTextPositioningElement_SVGTSpanElement() throws Exception { test("SVGTextPositioningElement", "SVGTSpanElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGTitleElement_SVGTitleElement() throws Exception { + @Alerts("true/false") + void _SVGTitleElement_SVGTitleElement() throws Exception { test("SVGTitleElement", "SVGTitleElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGTransform_SVGTransform() throws Exception { + @Alerts("true/false") + void _SVGTransform_SVGTransform() throws Exception { test("SVGTransform", "SVGTransform"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGTransformList_SVGTransformList() throws Exception { + @Alerts("true/false") + void _SVGTransformList_SVGTransformList() throws Exception { test("SVGTransformList", "SVGTransformList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGTSpanElement_SVGTSpanElement() throws Exception { + @Alerts("true/false") + void _SVGTSpanElement_SVGTSpanElement() throws Exception { test("SVGTSpanElement", "SVGTSpanElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - @HtmlUnitNYI(FF = "true", - FF_ESR = "true") - public void _SVGUnitTypes_SVGUnitTypes() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + @HtmlUnitNYI(FF = "true/false", + FF_ESR = "true/false") + void _SVGUnitTypes_SVGUnitTypes() throws Exception { test("SVGUnitTypes", "SVGUnitTypes"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGUseElement_SVGUseElement() throws Exception { + @Alerts("true/false") + void _SVGUseElement_SVGUseElement() throws Exception { test("SVGUseElement", "SVGUseElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGViewElement_SVGViewElement() throws Exception { + @Alerts("true/false") + void _SVGViewElement_SVGViewElement() throws Exception { test("SVGViewElement", "SVGViewElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SVGZoomEvent_SVGZoomEvent() throws Exception { + @Alerts("false/false") + void _SVGZoomEvent_SVGZoomEvent() throws Exception { test("SVGZoomEvent", "SVGZoomEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Symbol_Symbol() throws Exception { + @Alerts("true/false") + void _Symbol_Symbol() throws Exception { test("Symbol", "Symbol"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _SyncManager_SyncManager() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _SyncManager_SyncManager() throws Exception { test("SyncManager", "SyncManager"); } } diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfSTest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfSTest.java index 743d951e28b..538e75d3cfd 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfSTest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfSTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,11 +17,8 @@ import java.util.Collection; import org.apache.commons.lang3.StringUtils; -import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized.Parameters; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.params.provider.Arguments; /** * Tests two Host classes, if one prototype is parent of another. @@ -31,7 +28,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserParameterizedRunner.class) public class HostParentOfSTest extends HostParentOf { /** @@ -39,1451 +35,825 @@ public class HostParentOfSTest extends HostParentOf { * @return the parameterized data * @throws Exception if an error occurs */ - @Parameters - public static Collection data() throws Exception { + public static Collection data() throws Exception { return HostParentOf.data(input -> { final char ch = Character.toUpperCase(input.charAt(0)); return ch == 'S' && StringUtils.compareIgnoreCase(input, "SVGG") < 0; }); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Screen_Screen() throws Exception { + @Alerts("true/false") + void _Screen_Screen() throws Exception { test("Screen", "Screen"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _ScreenOrientation_ScreenOrientation() throws Exception { + @Alerts("true/false") + void _ScreenOrientation_ScreenOrientation() throws Exception { test("ScreenOrientation", "ScreenOrientation"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _ScriptProcessorNode_ScriptProcessorNode() throws Exception { + @Alerts("true/false") + void _ScriptProcessorNode_ScriptProcessorNode() throws Exception { test("ScriptProcessorNode", "ScriptProcessorNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SecurityPolicyViolationEvent_SecurityPolicyViolationEvent() throws Exception { + @Alerts("true/false") + void _SecurityPolicyViolationEvent_SecurityPolicyViolationEvent() throws Exception { test("SecurityPolicyViolationEvent", "SecurityPolicyViolationEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Selection_Selection() throws Exception { + @Alerts("true/false") + void _Selection_Selection() throws Exception { test("Selection", "Selection"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _ServiceWorker_ServiceWorker() throws Exception { + @Alerts("true/false") + void _ServiceWorker_ServiceWorker() throws Exception { test("ServiceWorker", "ServiceWorker"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _ServiceWorkerContainer_ServiceWorkerContainer() throws Exception { + @Alerts("true/false") + void _ServiceWorkerContainer_ServiceWorkerContainer() throws Exception { test("ServiceWorkerContainer", "ServiceWorkerContainer"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _ServiceWorkerRegistration_ServiceWorkerRegistration() throws Exception { + @Alerts("true/false") + void _ServiceWorkerRegistration_ServiceWorkerRegistration() throws Exception { test("ServiceWorkerRegistration", "ServiceWorkerRegistration"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Set_Set() throws Exception { + @Alerts("true/false") + void _Set_Set() throws Exception { test("Set", "Set"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _SharedArrayBuffer_SharedArrayBuffer() throws Exception { + @Alerts("false/false") + void _SharedArrayBuffer_SharedArrayBuffer() throws Exception { test("SharedArrayBuffer", "SharedArrayBuffer"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _ShadowRoot_ShadowRoot() throws Exception { + @Alerts("true/false") + void _ShadowRoot_ShadowRoot() throws Exception { test("ShadowRoot", "ShadowRoot"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SharedWorker_SharedWorker() throws Exception { + @Alerts("true/false") + void _SharedWorker_SharedWorker() throws Exception { test("SharedWorker", "SharedWorker"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SourceBuffer_SourceBuffer() throws Exception { + @Alerts("true/false") + void _SourceBuffer_SourceBuffer() throws Exception { test("SourceBuffer", "SourceBuffer"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SourceBufferList_SourceBufferList() throws Exception { + @Alerts("true/false") + void _SourceBufferList_SourceBufferList() throws Exception { test("SourceBufferList", "SourceBufferList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SpeechSynthesis_SpeechSynthesis() throws Exception { + @Alerts("true/false") + void _SpeechSynthesis_SpeechSynthesis() throws Exception { test("SpeechSynthesis", "SpeechSynthesis"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SpeechSynthesisErrorEvent_SpeechSynthesisErrorEvent() throws Exception { + @Alerts("true/false") + void _SpeechSynthesisErrorEvent_SpeechSynthesisErrorEvent() throws Exception { test("SpeechSynthesisErrorEvent", "SpeechSynthesisErrorEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SpeechSynthesisEvent_SpeechSynthesisErrorEvent() throws Exception { + @Alerts("true/true") + void _SpeechSynthesisEvent_SpeechSynthesisErrorEvent() throws Exception { test("SpeechSynthesisEvent", "SpeechSynthesisErrorEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SpeechSynthesisEvent_SpeechSynthesisEvent() throws Exception { + @Alerts("true/false") + void _SpeechSynthesisEvent_SpeechSynthesisEvent() throws Exception { test("SpeechSynthesisEvent", "SpeechSynthesisEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SpeechSynthesisUtterance_SpeechSynthesisUtterance() throws Exception { + @Alerts("true/false") + void _SpeechSynthesisUtterance_SpeechSynthesisUtterance() throws Exception { test("SpeechSynthesisUtterance", "SpeechSynthesisUtterance"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SpeechSynthesisVoice_SpeechSynthesisVoice() throws Exception { + @Alerts("true/false") + void _SpeechSynthesisVoice_SpeechSynthesisVoice() throws Exception { test("SpeechSynthesisVoice", "SpeechSynthesisVoice"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _StereoPannerNode_StereoPannerNode() throws Exception { + @Alerts("true/false") + void _StereoPannerNode_StereoPannerNode() throws Exception { test("StereoPannerNode", "StereoPannerNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Storage_Storage() throws Exception { + @Alerts("true/false") + void _Storage_Storage() throws Exception { test("Storage", "Storage"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _StorageEvent_StorageEvent() throws Exception { + @Alerts("true/false") + void _StorageEvent_StorageEvent() throws Exception { test("StorageEvent", "StorageEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _StorageManager_StorageManager() throws Exception { + @Alerts("true/false") + void _StorageManager_StorageManager() throws Exception { test("StorageManager", "StorageManager"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _StyleMedia_StyleMedia() throws Exception { + @Alerts("false/false") + void _StyleMedia_StyleMedia() throws Exception { test("StyleMedia", "StyleMedia"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _StyleSheet_CSSStyleSheet() throws Exception { + @Alerts("true/true") + void _StyleSheet_CSSStyleSheet() throws Exception { test("StyleSheet", "CSSStyleSheet"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _StyleSheet_StyleSheet() throws Exception { + @Alerts("true/false") + void _StyleSheet_StyleSheet() throws Exception { test("StyleSheet", "StyleSheet"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _StyleSheetList_StyleSheetList() throws Exception { + @Alerts("true/false") + void _StyleSheetList_StyleSheetList() throws Exception { test("StyleSheetList", "StyleSheetList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SubmitEvent_SubmitEvent() throws Exception { + @Alerts("true/false") + void _SubmitEvent_SubmitEvent() throws Exception { test("SubmitEvent", "SubmitEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SubtleCrypto_SubtleCrypto() throws Exception { + @Alerts("true/false") + void _SubtleCrypto_SubtleCrypto() throws Exception { test("SubtleCrypto", "SubtleCrypto"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGAElement_SVGAElement() throws Exception { + @Alerts("true/false") + void _SVGAElement_SVGAElement() throws Exception { test("SVGAElement", "SVGAElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGAngle_SVGAngle() throws Exception { + @Alerts("true/false") + void _SVGAngle_SVGAngle() throws Exception { test("SVGAngle", "SVGAngle"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGAnimatedAngle_SVGAnimatedAngle() throws Exception { + @Alerts("true/false") + void _SVGAnimatedAngle_SVGAnimatedAngle() throws Exception { test("SVGAnimatedAngle", "SVGAnimatedAngle"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGAnimatedBoolean_SVGAnimatedBoolean() throws Exception { + @Alerts("true/false") + void _SVGAnimatedBoolean_SVGAnimatedBoolean() throws Exception { test("SVGAnimatedBoolean", "SVGAnimatedBoolean"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGAnimatedEnumeration_SVGAnimatedEnumeration() throws Exception { + @Alerts("true/false") + void _SVGAnimatedEnumeration_SVGAnimatedEnumeration() throws Exception { test("SVGAnimatedEnumeration", "SVGAnimatedEnumeration"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGAnimatedInteger_SVGAnimatedInteger() throws Exception { + @Alerts("true/false") + void _SVGAnimatedInteger_SVGAnimatedInteger() throws Exception { test("SVGAnimatedInteger", "SVGAnimatedInteger"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGAnimatedLength_SVGAnimatedLength() throws Exception { + @Alerts("true/false") + void _SVGAnimatedLength_SVGAnimatedLength() throws Exception { test("SVGAnimatedLength", "SVGAnimatedLength"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGAnimatedLengthList_SVGAnimatedLengthList() throws Exception { + @Alerts("true/false") + void _SVGAnimatedLengthList_SVGAnimatedLengthList() throws Exception { test("SVGAnimatedLengthList", "SVGAnimatedLengthList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGAnimatedNumber_SVGAnimatedNumber() throws Exception { + @Alerts("true/false") + void _SVGAnimatedNumber_SVGAnimatedNumber() throws Exception { test("SVGAnimatedNumber", "SVGAnimatedNumber"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGAnimatedNumberList_SVGAnimatedNumberList() throws Exception { + @Alerts("true/false") + void _SVGAnimatedNumberList_SVGAnimatedNumberList() throws Exception { test("SVGAnimatedNumberList", "SVGAnimatedNumberList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGAnimatedPreserveAspectRatio_SVGAnimatedPreserveAspectRatio() throws Exception { + @Alerts("true/false") + void _SVGAnimatedPreserveAspectRatio_SVGAnimatedPreserveAspectRatio() throws Exception { test("SVGAnimatedPreserveAspectRatio", "SVGAnimatedPreserveAspectRatio"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGAnimatedRect_SVGAnimatedRect() throws Exception { + @Alerts("true/false") + void _SVGAnimatedRect_SVGAnimatedRect() throws Exception { test("SVGAnimatedRect", "SVGAnimatedRect"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGAnimatedString_SVGAnimatedString() throws Exception { + @Alerts("true/false") + void _SVGAnimatedString_SVGAnimatedString() throws Exception { test("SVGAnimatedString", "SVGAnimatedString"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGAnimatedTransformList_SVGAnimatedTransformList() throws Exception { + @Alerts("true/false") + void _SVGAnimatedTransformList_SVGAnimatedTransformList() throws Exception { test("SVGAnimatedTransformList", "SVGAnimatedTransformList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGAnimateElement_SVGAnimateElement() throws Exception { + @Alerts("true/false") + void _SVGAnimateElement_SVGAnimateElement() throws Exception { test("SVGAnimateElement", "SVGAnimateElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGAnimateMotionElement_SVGAnimateMotionElement() throws Exception { + @Alerts("true/false") + void _SVGAnimateMotionElement_SVGAnimateMotionElement() throws Exception { test("SVGAnimateMotionElement", "SVGAnimateMotionElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGAnimateTransformElement_SVGAnimateTransformElement() throws Exception { + @Alerts("true/false") + void _SVGAnimateTransformElement_SVGAnimateTransformElement() throws Exception { test("SVGAnimateTransformElement", "SVGAnimateTransformElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGAnimationElement_SVGAnimateElement() throws Exception { + @Alerts("true/true") + void _SVGAnimationElement_SVGAnimateElement() throws Exception { test("SVGAnimationElement", "SVGAnimateElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGAnimationElement_SVGAnimateMotionElement() throws Exception { + @Alerts("true/true") + void _SVGAnimationElement_SVGAnimateMotionElement() throws Exception { test("SVGAnimationElement", "SVGAnimateMotionElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGAnimationElement_SVGAnimateTransformElement() throws Exception { + @Alerts("true/true") + void _SVGAnimationElement_SVGAnimateTransformElement() throws Exception { test("SVGAnimationElement", "SVGAnimateTransformElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGAnimationElement_SVGAnimationElement() throws Exception { + @Alerts("true/false") + void _SVGAnimationElement_SVGAnimationElement() throws Exception { test("SVGAnimationElement", "SVGAnimationElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGAnimationElement_SVGSetElement() throws Exception { + @Alerts("false/false") + void _SVGAnimationElement_SVGDiscardElement() throws Exception { + test("SVGAnimationElement", "SVGDiscardElement"); + } + + @Alerts("true/true") + void _SVGAnimationElement_SVGSetElement() throws Exception { test("SVGAnimationElement", "SVGSetElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGCircleElement_SVGCircleElement() throws Exception { + @Alerts("true/false") + void _SVGCircleElement_SVGCircleElement() throws Exception { test("SVGCircleElement", "SVGCircleElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGClipPathElement_SVGClipPathElement() throws Exception { + @Alerts("true/false") + void _SVGClipPathElement_SVGClipPathElement() throws Exception { test("SVGClipPathElement", "SVGClipPathElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGComponentTransferFunctionElement_SVGComponentTransferFunctionElement() throws Exception { + @Alerts("true/false") + void _SVGComponentTransferFunctionElement_SVGComponentTransferFunctionElement() throws Exception { test("SVGComponentTransferFunctionElement", "SVGComponentTransferFunctionElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGComponentTransferFunctionElement_SVGFEFuncAElement() throws Exception { + @Alerts("true/true") + void _SVGComponentTransferFunctionElement_SVGFEFuncAElement() throws Exception { test("SVGComponentTransferFunctionElement", "SVGFEFuncAElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGComponentTransferFunctionElement_SVGFEFuncBElement() throws Exception { + @Alerts("true/true") + void _SVGComponentTransferFunctionElement_SVGFEFuncBElement() throws Exception { test("SVGComponentTransferFunctionElement", "SVGFEFuncBElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGComponentTransferFunctionElement_SVGFEFuncGElement() throws Exception { + @Alerts("true/true") + void _SVGComponentTransferFunctionElement_SVGFEFuncGElement() throws Exception { test("SVGComponentTransferFunctionElement", "SVGFEFuncGElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGComponentTransferFunctionElement_SVGFEFuncRElement() throws Exception { + @Alerts("true/true") + void _SVGComponentTransferFunctionElement_SVGFEFuncRElement() throws Exception { test("SVGComponentTransferFunctionElement", "SVGFEFuncRElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGDefsElement_SVGDefsElement() throws Exception { + @Alerts("true/false") + void _SVGDefsElement_SVGDefsElement() throws Exception { test("SVGDefsElement", "SVGDefsElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGDescElement_SVGDescElement() throws Exception { + @Alerts("true/false") + void _SVGDescElement_SVGDescElement() throws Exception { test("SVGDescElement", "SVGDescElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGAElement() throws Exception { + @Alerts("false/false") + void _SVGDiscardElement_SVGDiscardElement() throws Exception { + test("SVGDiscardElement", "SVGDiscardElement"); + } + + @Alerts("true/false") + void _SVGElement_SVGAElement() throws Exception { test("SVGElement", "SVGAElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGAnimateElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGAnimateElement() throws Exception { test("SVGElement", "SVGAnimateElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGAnimateMotionElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGAnimateMotionElement() throws Exception { test("SVGElement", "SVGAnimateMotionElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGAnimateTransformElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGAnimateTransformElement() throws Exception { test("SVGElement", "SVGAnimateTransformElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGAnimationElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGAnimationElement() throws Exception { test("SVGElement", "SVGAnimationElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGCircleElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGCircleElement() throws Exception { test("SVGElement", "SVGCircleElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGClipPathElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGClipPathElement() throws Exception { test("SVGElement", "SVGClipPathElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGComponentTransferFunctionElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGComponentTransferFunctionElement() throws Exception { test("SVGElement", "SVGComponentTransferFunctionElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGDefsElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGDefsElement() throws Exception { test("SVGElement", "SVGDefsElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGDescElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGDescElement() throws Exception { test("SVGElement", "SVGDescElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGElement() throws Exception { + @Alerts("false/false") + void _SVGElement_SVGDiscardElement() throws Exception { + test("SVGElement", "SVGDiscardElement"); + } + + @Alerts("true/false") + void _SVGElement_SVGElement() throws Exception { test("SVGElement", "SVGElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGEllipseElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGEllipseElement() throws Exception { test("SVGElement", "SVGEllipseElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFEBlendElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGFEBlendElement() throws Exception { test("SVGElement", "SVGFEBlendElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFEColorMatrixElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGFEColorMatrixElement() throws Exception { test("SVGElement", "SVGFEColorMatrixElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFEComponentTransferElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGFEComponentTransferElement() throws Exception { test("SVGElement", "SVGFEComponentTransferElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFECompositeElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGFECompositeElement() throws Exception { test("SVGElement", "SVGFECompositeElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFEConvolveMatrixElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGFEConvolveMatrixElement() throws Exception { test("SVGElement", "SVGFEConvolveMatrixElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFEDiffuseLightingElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGFEDiffuseLightingElement() throws Exception { test("SVGElement", "SVGFEDiffuseLightingElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFEDisplacementMapElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGFEDisplacementMapElement() throws Exception { test("SVGElement", "SVGFEDisplacementMapElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFEDistantLightElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGFEDistantLightElement() throws Exception { test("SVGElement", "SVGFEDistantLightElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFEDropShadowElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGFEDropShadowElement() throws Exception { test("SVGElement", "SVGFEDropShadowElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFEFloodElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGFEFloodElement() throws Exception { test("SVGElement", "SVGFEFloodElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFEFuncAElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGFEFuncAElement() throws Exception { test("SVGElement", "SVGFEFuncAElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFEFuncBElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGFEFuncBElement() throws Exception { test("SVGElement", "SVGFEFuncBElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFEFuncGElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGFEFuncGElement() throws Exception { test("SVGElement", "SVGFEFuncGElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFEFuncRElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGFEFuncRElement() throws Exception { test("SVGElement", "SVGFEFuncRElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFEGaussianBlurElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGFEGaussianBlurElement() throws Exception { test("SVGElement", "SVGFEGaussianBlurElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFEImageElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGFEImageElement() throws Exception { test("SVGElement", "SVGFEImageElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFEMergeElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGFEMergeElement() throws Exception { test("SVGElement", "SVGFEMergeElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFEMergeNodeElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGFEMergeNodeElement() throws Exception { test("SVGElement", "SVGFEMergeNodeElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFEMorphologyElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGFEMorphologyElement() throws Exception { test("SVGElement", "SVGFEMorphologyElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFEOffsetElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGFEOffsetElement() throws Exception { test("SVGElement", "SVGFEOffsetElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFEPointLightElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGFEPointLightElement() throws Exception { test("SVGElement", "SVGFEPointLightElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFESpecularLightingElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGFESpecularLightingElement() throws Exception { test("SVGElement", "SVGFESpecularLightingElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFESpotLightElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGFESpotLightElement() throws Exception { test("SVGElement", "SVGFESpotLightElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFETileElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGFETileElement() throws Exception { test("SVGElement", "SVGFETileElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFETurbulenceElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGFETurbulenceElement() throws Exception { test("SVGElement", "SVGFETurbulenceElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGFilterElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGFilterElement() throws Exception { test("SVGElement", "SVGFilterElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGForeignObjectElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGForeignObjectElement() throws Exception { test("SVGElement", "SVGForeignObjectElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGGElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGGElement() throws Exception { test("SVGElement", "SVGGElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGGeometryElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGGeometryElement() throws Exception { test("SVGElement", "SVGGeometryElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGGradientElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGGradientElement() throws Exception { test("SVGElement", "SVGGradientElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGGraphicsElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGGraphicsElement() throws Exception { test("SVGElement", "SVGGraphicsElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGImageElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGImageElement() throws Exception { test("SVGElement", "SVGImageElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGLinearGradientElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGLinearGradientElement() throws Exception { test("SVGElement", "SVGLinearGradientElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGLineElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGLineElement() throws Exception { test("SVGElement", "SVGLineElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGMarkerElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGMarkerElement() throws Exception { test("SVGElement", "SVGMarkerElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGMaskElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGMaskElement() throws Exception { test("SVGElement", "SVGMaskElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGMetadataElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGMetadataElement() throws Exception { test("SVGElement", "SVGMetadataElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGMPathElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGMPathElement() throws Exception { test("SVGElement", "SVGMPathElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGPathElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGPathElement() throws Exception { test("SVGElement", "SVGPathElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGPatternElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGPatternElement() throws Exception { test("SVGElement", "SVGPatternElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGPolygonElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGPolygonElement() throws Exception { test("SVGElement", "SVGPolygonElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGPolylineElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGPolylineElement() throws Exception { test("SVGElement", "SVGPolylineElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGRadialGradientElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGRadialGradientElement() throws Exception { test("SVGElement", "SVGRadialGradientElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGRectElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGRectElement() throws Exception { test("SVGElement", "SVGRectElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGScriptElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGScriptElement() throws Exception { test("SVGElement", "SVGScriptElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGSetElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGSetElement() throws Exception { test("SVGElement", "SVGSetElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGStopElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGStopElement() throws Exception { test("SVGElement", "SVGStopElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGStyleElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGStyleElement() throws Exception { test("SVGElement", "SVGStyleElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGSVGElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGSVGElement() throws Exception { test("SVGElement", "SVGSVGElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGSwitchElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGSwitchElement() throws Exception { test("SVGElement", "SVGSwitchElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGSymbolElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGSymbolElement() throws Exception { test("SVGElement", "SVGSymbolElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGTextContentElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGTextContentElement() throws Exception { test("SVGElement", "SVGTextContentElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGTextElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGTextElement() throws Exception { test("SVGElement", "SVGTextElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGTextPathElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGTextPathElement() throws Exception { test("SVGElement", "SVGTextPathElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGTextPositioningElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGTextPositioningElement() throws Exception { test("SVGElement", "SVGTextPositioningElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGTitleElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGTitleElement() throws Exception { test("SVGElement", "SVGTitleElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGTSpanElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGTSpanElement() throws Exception { test("SVGElement", "SVGTSpanElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGUseElement() throws Exception { + @Alerts("true/false") + void _SVGElement_SVGUseElement() throws Exception { test("SVGElement", "SVGUseElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGElement_SVGViewElement() throws Exception { + @Alerts("true/true") + void _SVGElement_SVGViewElement() throws Exception { test("SVGElement", "SVGViewElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGEllipseElement_SVGEllipseElement() throws Exception { + @Alerts("true/false") + void _SVGEllipseElement_SVGEllipseElement() throws Exception { test("SVGEllipseElement", "SVGEllipseElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFEBlendElement_SVGFEBlendElement() throws Exception { + @Alerts("true/false") + void _SVGFEBlendElement_SVGFEBlendElement() throws Exception { test("SVGFEBlendElement", "SVGFEBlendElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFEColorMatrixElement_SVGFEColorMatrixElement() throws Exception { + @Alerts("true/false") + void _SVGFEColorMatrixElement_SVGFEColorMatrixElement() throws Exception { test("SVGFEColorMatrixElement", "SVGFEColorMatrixElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFEComponentTransferElement_SVGFEComponentTransferElement() throws Exception { + @Alerts("true/false") + void _SVGFEComponentTransferElement_SVGFEComponentTransferElement() throws Exception { test("SVGFEComponentTransferElement", "SVGFEComponentTransferElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFECompositeElement_SVGFECompositeElement() throws Exception { + @Alerts("true/false") + void _SVGFECompositeElement_SVGFECompositeElement() throws Exception { test("SVGFECompositeElement", "SVGFECompositeElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFEConvolveMatrixElement_SVGFEConvolveMatrixElement() throws Exception { + @Alerts("true/false") + void _SVGFEConvolveMatrixElement_SVGFEConvolveMatrixElement() throws Exception { test("SVGFEConvolveMatrixElement", "SVGFEConvolveMatrixElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFEDiffuseLightingElement_SVGFEDiffuseLightingElement() throws Exception { + @Alerts("true/false") + void _SVGFEDiffuseLightingElement_SVGFEDiffuseLightingElement() throws Exception { test("SVGFEDiffuseLightingElement", "SVGFEDiffuseLightingElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFEDisplacementMapElement_SVGFEDisplacementMapElement() throws Exception { + @Alerts("true/false") + void _SVGFEDisplacementMapElement_SVGFEDisplacementMapElement() throws Exception { test("SVGFEDisplacementMapElement", "SVGFEDisplacementMapElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFEDistantLightElement_SVGFEDistantLightElement() throws Exception { + @Alerts("true/false") + void _SVGFEDistantLightElement_SVGFEDistantLightElement() throws Exception { test("SVGFEDistantLightElement", "SVGFEDistantLightElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFEDropShadowElement_SVGFEDropShadowElement() throws Exception { + @Alerts("true/false") + void _SVGFEDropShadowElement_SVGFEDropShadowElement() throws Exception { test("SVGFEDropShadowElement", "SVGFEDropShadowElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFEFloodElement_SVGFEFloodElement() throws Exception { + @Alerts("true/false") + void _SVGFEFloodElement_SVGFEFloodElement() throws Exception { test("SVGFEFloodElement", "SVGFEFloodElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFEFuncAElement_SVGFEFuncAElement() throws Exception { + @Alerts("true/false") + void _SVGFEFuncAElement_SVGFEFuncAElement() throws Exception { test("SVGFEFuncAElement", "SVGFEFuncAElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFEFuncBElement_SVGFEFuncBElement() throws Exception { + @Alerts("true/false") + void _SVGFEFuncBElement_SVGFEFuncBElement() throws Exception { test("SVGFEFuncBElement", "SVGFEFuncBElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFEFuncGElement_SVGFEFuncGElement() throws Exception { + @Alerts("true/false") + void _SVGFEFuncGElement_SVGFEFuncGElement() throws Exception { test("SVGFEFuncGElement", "SVGFEFuncGElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFEFuncRElement_SVGFEFuncRElement() throws Exception { + @Alerts("true/false") + void _SVGFEFuncRElement_SVGFEFuncRElement() throws Exception { test("SVGFEFuncRElement", "SVGFEFuncRElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFEGaussianBlurElement_SVGFEGaussianBlurElement() throws Exception { + @Alerts("true/false") + void _SVGFEGaussianBlurElement_SVGFEGaussianBlurElement() throws Exception { test("SVGFEGaussianBlurElement", "SVGFEGaussianBlurElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFEImageElement_SVGFEImageElement() throws Exception { + @Alerts("true/false") + void _SVGFEImageElement_SVGFEImageElement() throws Exception { test("SVGFEImageElement", "SVGFEImageElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFEMergeElement_SVGFEMergeElement() throws Exception { + @Alerts("true/false") + void _SVGFEMergeElement_SVGFEMergeElement() throws Exception { test("SVGFEMergeElement", "SVGFEMergeElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFEMergeNodeElement_SVGFEMergeNodeElement() throws Exception { + @Alerts("true/false") + void _SVGFEMergeNodeElement_SVGFEMergeNodeElement() throws Exception { test("SVGFEMergeNodeElement", "SVGFEMergeNodeElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFEMorphologyElement_SVGFEMorphologyElement() throws Exception { + @Alerts("true/false") + void _SVGFEMorphologyElement_SVGFEMorphologyElement() throws Exception { test("SVGFEMorphologyElement", "SVGFEMorphologyElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFEOffsetElement_SVGFEOffsetElement() throws Exception { + @Alerts("true/false") + void _SVGFEOffsetElement_SVGFEOffsetElement() throws Exception { test("SVGFEOffsetElement", "SVGFEOffsetElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFEPointLightElement_SVGFEPointLightElement() throws Exception { + @Alerts("true/false") + void _SVGFEPointLightElement_SVGFEPointLightElement() throws Exception { test("SVGFEPointLightElement", "SVGFEPointLightElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFESpecularLightingElement_SVGFESpecularLightingElement() throws Exception { + @Alerts("true/false") + void _SVGFESpecularLightingElement_SVGFESpecularLightingElement() throws Exception { test("SVGFESpecularLightingElement", "SVGFESpecularLightingElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFESpotLightElement_SVGFESpotLightElement() throws Exception { + @Alerts("true/false") + void _SVGFESpotLightElement_SVGFESpotLightElement() throws Exception { test("SVGFESpotLightElement", "SVGFESpotLightElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFETileElement_SVGFETileElement() throws Exception { + @Alerts("true/false") + void _SVGFETileElement_SVGFETileElement() throws Exception { test("SVGFETileElement", "SVGFETileElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFETurbulenceElement_SVGFETurbulenceElement() throws Exception { + @Alerts("true/false") + void _SVGFETurbulenceElement_SVGFETurbulenceElement() throws Exception { test("SVGFETurbulenceElement", "SVGFETurbulenceElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGFilterElement_SVGFilterElement() throws Exception { + @Alerts("true/false") + void _SVGFilterElement_SVGFilterElement() throws Exception { test("SVGFilterElement", "SVGFilterElement"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _SVGForeignObjectElement_SVGForeignObjectElement() throws Exception { + @Alerts("true/false") + void _SVGForeignObjectElement_SVGForeignObjectElement() throws Exception { test("SVGForeignObjectElement", "SVGForeignObjectElement"); } } diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfTTest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfTTest.java index f05ec67af60..eefa9f1775f 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfTTest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfTTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,11 +16,8 @@ import java.util.Collection; -import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized.Parameters; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.params.provider.Arguments; /** * Tests two Host classes, if one prototype is parent of another. @@ -30,7 +27,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserParameterizedRunner.class) public class HostParentOfTTest extends HostParentOf { /** @@ -38,448 +34,259 @@ public class HostParentOfTTest extends HostParentOf { * @return the parameterized data * @throws Exception if an error occurs */ - @Parameters - public static Collection data() throws Exception { + public static Collection data() throws Exception { return HostParentOf.data(input -> { final char ch = Character.toUpperCase(input.charAt(0)); return ch >= 'T' && ch <= 'V'; }); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Text_CDATASection() throws Exception { + @Alerts("true/true") + void _Text_CDATASection() throws Exception { test("Text", "CDATASection"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Text_Text() throws Exception { + @Alerts("true/false") + void _Text_Text() throws Exception { test("Text", "Text"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _TextDecoder_TextDecoder() throws Exception { + @Alerts("true/false") + void _TextDecoder_TextDecoder() throws Exception { test("TextDecoder", "TextDecoder"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _TextEncoder_TextEncoder() throws Exception { + @Alerts("true/false") + void _TextEncoder_TextEncoder() throws Exception { test("TextEncoder", "TextEncoder"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - FF_ESR = "false") - public void _TextEvent_TextEvent() throws Exception { + @Alerts(DEFAULT = "true/false", + FF_ESR = "false/false") + void _TextEvent_TextEvent() throws Exception { test("TextEvent", "TextEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _TextMetrics_TextMetrics() throws Exception { + @Alerts("true/false") + void _TextMetrics_TextMetrics() throws Exception { test("TextMetrics", "TextMetrics"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _TextRange_TextRange() throws Exception { + @Alerts("false/false") + void _TextRange_TextRange() throws Exception { test("TextRange", "TextRange"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _TextTrack_TextTrack() throws Exception { + @Alerts("true/false") + void _TextTrack_TextTrack() throws Exception { test("TextTrack", "TextTrack"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _TextTrackCue_TextTrackCue() throws Exception { + @Alerts("true/false") + void _TextTrackCue_TextTrackCue() throws Exception { test("TextTrackCue", "TextTrackCue"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _TextTrackCue_VTTCue() throws Exception { + @Alerts("true/true") + void _TextTrackCue_VTTCue() throws Exception { test("TextTrackCue", "VTTCue"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _TextTrackCueList_TextTrackCueList() throws Exception { + @Alerts("true/false") + void _TextTrackCueList_TextTrackCueList() throws Exception { test("TextTrackCueList", "TextTrackCueList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _TextTrackList_TextTrackList() throws Exception { + @Alerts("true/false") + void _TextTrackList_TextTrackList() throws Exception { test("TextTrackList", "TextTrackList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true", - FF_ESR = "true") - public void _TimeEvent_TimeEvent() throws Exception { + @Alerts(DEFAULT = "false/false", + FF = "true/false", + FF_ESR = "true/false") + void _TimeEvent_TimeEvent() throws Exception { test("TimeEvent", "TimeEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _TimeRanges_TimeRanges() throws Exception { + @Alerts("true/false") + void _TimeRanges_TimeRanges() throws Exception { test("TimeRanges", "TimeRanges"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _Touch_Touch() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _Touch_Touch() throws Exception { test("Touch", "Touch"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _TouchEvent_TouchEvent() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _TouchEvent_TouchEvent() throws Exception { test("TouchEvent", "TouchEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _TouchList_TouchList() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _TouchList_TouchList() throws Exception { test("TouchList", "TouchList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _TrackEvent_TrackEvent() throws Exception { + @Alerts("true/false") + void _TrackEvent_TrackEvent() throws Exception { test("TrackEvent", "TrackEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _TransitionEvent_TransitionEvent() throws Exception { + @Alerts("true/false") + void _TransitionEvent_TransitionEvent() throws Exception { test("TransitionEvent", "TransitionEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _TreeWalker_TreeWalker() throws Exception { + @Alerts("true/false") + void _TreeWalker_TreeWalker() throws Exception { test("TreeWalker", "TreeWalker"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _UIEvent_CompositionEvent() throws Exception { + @Alerts("true/true") + void _UIEvent_CompositionEvent() throws Exception { test("UIEvent", "CompositionEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _UIEvent_DragEvent() throws Exception { + @Alerts("true/false") + void _UIEvent_DragEvent() throws Exception { test("UIEvent", "DragEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _UIEvent_FocusEvent() throws Exception { + @Alerts("true/true") + void _UIEvent_FocusEvent() throws Exception { test("UIEvent", "FocusEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _UIEvent_InputEvent() throws Exception { + @Alerts("true/true") + void _UIEvent_InputEvent() throws Exception { test("UIEvent", "InputEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _UIEvent_KeyboardEvent() throws Exception { + @Alerts("true/true") + void _UIEvent_KeyboardEvent() throws Exception { test("UIEvent", "KeyboardEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _UIEvent_MouseEvent() throws Exception { + @Alerts("true/true") + void _UIEvent_MouseEvent() throws Exception { test("UIEvent", "MouseEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - FF = "true", - FF_ESR = "true") - public void _UIEvent_MouseScrollEvent() throws Exception { + @Alerts(DEFAULT = "false/false", + FF = "true/false", + FF_ESR = "true/false") + void _UIEvent_MouseScrollEvent() throws Exception { test("UIEvent", "MouseScrollEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _UIEvent_MouseWheelEvent() throws Exception { + @Alerts("false/false") + void _UIEvent_MouseWheelEvent() throws Exception { test("UIEvent", "MouseWheelEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _UIEvent_MSGestureEvent() throws Exception { + @Alerts("false/false") + void _UIEvent_MSGestureEvent() throws Exception { test("UIEvent", "MSGestureEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _UIEvent_PointerEvent() throws Exception { + @Alerts("true/false") + void _UIEvent_PointerEvent() throws Exception { test("UIEvent", "PointerEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _UIEvent_SVGZoomEvent() throws Exception { + @Alerts("false/false") + void _UIEvent_SVGZoomEvent() throws Exception { test("UIEvent", "SVGZoomEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "true", - FF_ESR = "false") - public void _UIEvent_TextEvent() throws Exception { + @Alerts(DEFAULT = "true/true", + FF_ESR = "false/false") + void _UIEvent_TextEvent() throws Exception { test("UIEvent", "TextEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _UIEvent_TouchEvent() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/true", + EDGE = "true/true") + void _UIEvent_TouchEvent() throws Exception { test("UIEvent", "TouchEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _UIEvent_UIEvent() throws Exception { + @Alerts("true/false") + void _UIEvent_UIEvent() throws Exception { test("UIEvent", "UIEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _UIEvent_WheelEvent() throws Exception { + @Alerts("true/false") + void _UIEvent_WheelEvent() throws Exception { test("UIEvent", "WheelEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Uint16Array_Uint16Array() throws Exception { + @Alerts("true/false") + void _Uint16Array_Uint16Array() throws Exception { test("Uint16Array", "Uint16Array"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Uint32Array_Uint32Array() throws Exception { + @Alerts("true/false") + void _Uint32Array_Uint32Array() throws Exception { test("Uint32Array", "Uint32Array"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Uint8Array_Uint8Array() throws Exception { + @Alerts("true/false") + void _Uint8Array_Uint8Array() throws Exception { test("Uint8Array", "Uint8Array"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Uint8ClampedArray_Uint8ClampedArray() throws Exception { + @Alerts("true/false") + void _Uint8ClampedArray_Uint8ClampedArray() throws Exception { test("Uint8ClampedArray", "Uint8ClampedArray"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _URIError_URIError() throws Exception { + @Alerts("true/false") + void _URIError_URIError() throws Exception { test("URIError", "URIError"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _URL_URL() throws Exception { + @Alerts("true/false") + void _URL_URL() throws Exception { test("URL", "URL"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _URL_webkitURL() throws Exception { + @Alerts("true/false") + void _URL_webkitURL() throws Exception { test("URL", "webkitURL"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _URLSearchParams_URLSearchParams() throws Exception { + @Alerts("true/false") + void _URLSearchParams_URLSearchParams() throws Exception { test("URLSearchParams", "URLSearchParams"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _UserProximityEvent_UserProximityEvent() throws Exception { + @Alerts("false/false") + void _UserProximityEvent_UserProximityEvent() throws Exception { test("UserProximityEvent", "UserProximityEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _ValidityState_ValidityState() throws Exception { + @Alerts("true/false") + void _ValidityState_ValidityState() throws Exception { test("ValidityState", "ValidityState"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _VideoPlaybackQuality_VideoPlaybackQuality() throws Exception { + @Alerts("true/false") + void _VideoPlaybackQuality_VideoPlaybackQuality() throws Exception { test("VideoPlaybackQuality", "VideoPlaybackQuality"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _VTTCue_VTTCue() throws Exception { + @Alerts("true/false") + void _VTTCue_VTTCue() throws Exception { test("VTTCue", "VTTCue"); } } diff --git a/src/test/java/org/htmlunit/general/huge/HostParentOfWTest.java b/src/test/java/org/htmlunit/general/huge/HostParentOfWTest.java index 9c188ea1df8..0654405ea0d 100644 --- a/src/test/java/org/htmlunit/general/huge/HostParentOfWTest.java +++ b/src/test/java/org/htmlunit/general/huge/HostParentOfWTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,11 +16,8 @@ import java.util.Collection; -import org.htmlunit.junit.BrowserParameterizedRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized.Parameters; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.params.provider.Arguments; /** * Tests two Host classes, if one prototype is parent of another. @@ -30,7 +27,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserParameterizedRunner.class) public class HostParentOfWTest extends HostParentOf { /** @@ -38,501 +34,292 @@ public class HostParentOfWTest extends HostParentOf { * @return the parameterized data * @throws Exception if an error occurs */ - @Parameters - public static Collection data() throws Exception { + public static Collection data() throws Exception { return HostParentOf.data(input -> { final char ch = Character.toUpperCase(input.charAt(0)); return ch >= 'W' && ch <= 'Z'; }); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _WaveShaperNode_WaveShaperNode() throws Exception { + @Alerts("true/false") + void _WaveShaperNode_WaveShaperNode() throws Exception { test("WaveShaperNode", "WaveShaperNode"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _WeakMap_WeakMap() throws Exception { + @Alerts("true/false") + void _WeakMap_WeakMap() throws Exception { test("WeakMap", "WeakMap"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _WeakSet_WeakSet() throws Exception { + @Alerts("true/false") + void _WeakSet_WeakSet() throws Exception { test("WeakSet", "WeakSet"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _WEBGL_compressed_texture_s3tc_WEBGL_compressed_texture_s3tc() throws Exception { + @Alerts("false/false") + void _WEBGL_compressed_texture_s3tc_WEBGL_compressed_texture_s3tc() throws Exception { test("WEBGL_compressed_texture_s3tc", "WEBGL_compressed_texture_s3tc"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("false") - public void _WEBGL_debug_renderer_info_WEBGL_debug_renderer_info() throws Exception { + @Alerts("false/false") + void _WEBGL_debug_renderer_info_WEBGL_debug_renderer_info() throws Exception { test("WEBGL_debug_renderer_info", "WEBGL_debug_renderer_info"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _WebGL2RenderingContext_WebGL2RenderingContext() throws Exception { + @Alerts("true/false") + void _WebGL2RenderingContext_WebGL2RenderingContext() throws Exception { test("WebGL2RenderingContext", "WebGL2RenderingContext"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _WebGLActiveInfo_WebGLActiveInfo() throws Exception { + @Alerts("true/false") + void _WebGLActiveInfo_WebGLActiveInfo() throws Exception { test("WebGLActiveInfo", "WebGLActiveInfo"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _WebGLBuffer_WebGLBuffer() throws Exception { + @Alerts("true/false") + void _WebGLBuffer_WebGLBuffer() throws Exception { test("WebGLBuffer", "WebGLBuffer"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _WebGLContextEvent_WebGLContextEvent() throws Exception { + @Alerts("true/false") + void _WebGLContextEvent_WebGLContextEvent() throws Exception { test("WebGLContextEvent", "WebGLContextEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _WebGLFramebuffer_WebGLFramebuffer() throws Exception { + @Alerts("true/false") + void _WebGLFramebuffer_WebGLFramebuffer() throws Exception { test("WebGLFramebuffer", "WebGLFramebuffer"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _WebGLProgram_WebGLProgram() throws Exception { + @Alerts("true/false") + void _WebGLProgram_WebGLProgram() throws Exception { test("WebGLProgram", "WebGLProgram"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _WebGLQuery_WebGLQuery() throws Exception { + @Alerts("true/false") + void _WebGLQuery_WebGLQuery() throws Exception { test("WebGLQuery", "WebGLQuery"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _WebGLRenderbuffer_WebGLRenderbuffer() throws Exception { + @Alerts("true/false") + void _WebGLRenderbuffer_WebGLRenderbuffer() throws Exception { test("WebGLRenderbuffer", "WebGLRenderbuffer"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _WebGLRenderingContext_WebGLRenderingContext() throws Exception { + @Alerts("true/false") + void _WebGLRenderingContext_WebGLRenderingContext() throws Exception { test("WebGLRenderingContext", "WebGLRenderingContext"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _WebGLSampler_WebGLSampler() throws Exception { + @Alerts("true/false") + void _WebGLSampler_WebGLSampler() throws Exception { test("WebGLSampler", "WebGLSampler"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _WebGLShader_WebGLShader() throws Exception { + @Alerts("true/false") + void _WebGLShader_WebGLShader() throws Exception { test("WebGLShader", "WebGLShader"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _WebGLShaderPrecisionFormat_WebGLShaderPrecisionFormat() throws Exception { + @Alerts("true/false") + void _WebGLShaderPrecisionFormat_WebGLShaderPrecisionFormat() throws Exception { test("WebGLShaderPrecisionFormat", "WebGLShaderPrecisionFormat"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _WebGLSync_WebGLSync() throws Exception { + @Alerts("true/false") + void _WebGLSync_WebGLSync() throws Exception { test("WebGLSync", "WebGLSync"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _WebGLTexture_WebGLTexture() throws Exception { + @Alerts("true/false") + void _WebGLTexture_WebGLTexture() throws Exception { test("WebGLTexture", "WebGLTexture"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _WebGLTransformFeedback_WebGLTransformFeedback() throws Exception { + @Alerts("true/false") + void _WebGLTransformFeedback_WebGLTransformFeedback() throws Exception { test("WebGLTransformFeedback", "WebGLTransformFeedback"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _WebGLUniformLocation_WebGLUniformLocation() throws Exception { + @Alerts("true/false") + void _WebGLUniformLocation_WebGLUniformLocation() throws Exception { test("WebGLUniformLocation", "WebGLUniformLocation"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _WebGLVertexArrayObject_WebGLVertexArrayObject() throws Exception { + @Alerts("true/false") + void _WebGLVertexArrayObject_WebGLVertexArrayObject() throws Exception { test("WebGLVertexArrayObject", "WebGLVertexArrayObject"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _WebKitCSSMatrix_DOMMatrix() throws Exception { + @Alerts("true/false") + void _WebKitCSSMatrix_DOMMatrix() throws Exception { test("WebKitCSSMatrix", "DOMMatrix"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _WebKitCSSMatrix_WebKitCSSMatrix() throws Exception { + @Alerts("true/false") + void _WebKitCSSMatrix_WebKitCSSMatrix() throws Exception { test("WebKitCSSMatrix", "WebKitCSSMatrix"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _webkitMediaStream_MediaStream() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _webkitMediaStream_MediaStream() throws Exception { test("webkitMediaStream", "MediaStream"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _webkitMediaStream_webkitMediaStream() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _webkitMediaStream_webkitMediaStream() throws Exception { test("webkitMediaStream", "webkitMediaStream"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _WebKitMutationObserver_MutationObserver() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _WebKitMutationObserver_MutationObserver() throws Exception { test("WebKitMutationObserver", "MutationObserver"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _WebKitMutationObserver_WebKitMutationObserver() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _WebKitMutationObserver_WebKitMutationObserver() throws Exception { test("WebKitMutationObserver", "WebKitMutationObserver"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _webkitRTCPeerConnection_RTCPeerConnection() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _webkitRTCPeerConnection_RTCPeerConnection() throws Exception { test("webkitRTCPeerConnection", "RTCPeerConnection"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _webkitRTCPeerConnection_webkitRTCPeerConnection() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _webkitRTCPeerConnection_webkitRTCPeerConnection() throws Exception { test("webkitRTCPeerConnection", "webkitRTCPeerConnection"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _webkitSpeechGrammar_webkitSpeechGrammar() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _webkitSpeechGrammar_webkitSpeechGrammar() throws Exception { test("webkitSpeechGrammar", "webkitSpeechGrammar"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _webkitSpeechGrammarList_webkitSpeechGrammarList() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _webkitSpeechGrammarList_webkitSpeechGrammarList() throws Exception { test("webkitSpeechGrammarList", "webkitSpeechGrammarList"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _webkitSpeechRecognition_webkitSpeechRecognition() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _webkitSpeechRecognition_webkitSpeechRecognition() throws Exception { test("webkitSpeechRecognition", "webkitSpeechRecognition"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _webkitSpeechRecognitionError_webkitSpeechRecognitionError() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _webkitSpeechRecognitionError_webkitSpeechRecognitionError() throws Exception { test("webkitSpeechRecognitionError", "webkitSpeechRecognitionError"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts(DEFAULT = "false", - CHROME = "true", - EDGE = "true") - public void _webkitSpeechRecognitionEvent_webkitSpeechRecognitionEvent() throws Exception { + @Alerts(DEFAULT = "false/false", + CHROME = "true/false", + EDGE = "true/false") + void _webkitSpeechRecognitionEvent_webkitSpeechRecognitionEvent() throws Exception { test("webkitSpeechRecognitionEvent", "webkitSpeechRecognitionEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _webkitURL_URL() throws Exception { + @Alerts("true/false") + void _webkitURL_URL() throws Exception { test("webkitURL", "URL"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _webkitURL_webkitURL() throws Exception { + @Alerts("true/false") + void _webkitURL_webkitURL() throws Exception { test("webkitURL", "webkitURL"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _WebSocket_WebSocket() throws Exception { + @Alerts("true/false") + void _WebSocket_WebSocket() throws Exception { test("WebSocket", "WebSocket"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _WheelEvent_WheelEvent() throws Exception { + @Alerts("true/false") + void _WheelEvent_WheelEvent() throws Exception { test("WheelEvent", "WheelEvent"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Window_Window() throws Exception { + @Alerts("true/false") + void _Window_Window() throws Exception { test("Window", "Window"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _Worker_Worker() throws Exception { + @Alerts("true/false") + void _Worker_Worker() throws Exception { test("Worker", "Worker"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _XMLDocument_XMLDocument() throws Exception { + @Alerts("true/false") + void _XMLDocument_XMLDocument() throws Exception { test("XMLDocument", "XMLDocument"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _XMLHttpRequest_XMLHttpRequest() throws Exception { + @Alerts("true/false") + void _XMLHttpRequest_XMLHttpRequest() throws Exception { test("XMLHttpRequest", "XMLHttpRequest"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _XMLHttpRequestEventTarget_XMLHttpRequest() throws Exception { + @Alerts("true/true") + void _XMLHttpRequestEventTarget_XMLHttpRequest() throws Exception { test("XMLHttpRequestEventTarget", "XMLHttpRequest"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _XMLHttpRequestEventTarget_XMLHttpRequestEventTarget() throws Exception { + @Alerts("true/false") + void _XMLHttpRequestEventTarget_XMLHttpRequestEventTarget() throws Exception { test("XMLHttpRequestEventTarget", "XMLHttpRequestEventTarget"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _XMLHttpRequestEventTarget_XMLHttpRequestUpload() throws Exception { + @Alerts("true/true") + void _XMLHttpRequestEventTarget_XMLHttpRequestUpload() throws Exception { test("XMLHttpRequestEventTarget", "XMLHttpRequestUpload"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _XMLHttpRequestUpload_XMLHttpRequestUpload() throws Exception { + @Alerts("true/false") + void _XMLHttpRequestUpload_XMLHttpRequestUpload() throws Exception { test("XMLHttpRequestUpload", "XMLHttpRequestUpload"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _XMLSerializer_XMLSerializer() throws Exception { + @Alerts("true/false") + void _XMLSerializer_XMLSerializer() throws Exception { test("XMLSerializer", "XMLSerializer"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _XPathEvaluator_XPathEvaluator() throws Exception { + @Alerts("true/false") + void _XPathEvaluator_XPathEvaluator() throws Exception { test("XPathEvaluator", "XPathEvaluator"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _XPathExpression_XPathExpression() throws Exception { + @Alerts("true/false") + void _XPathExpression_XPathExpression() throws Exception { test("XPathExpression", "XPathExpression"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _XPathResult_XPathResult() throws Exception { + @Alerts("true/false") + void _XPathResult_XPathResult() throws Exception { test("XPathResult", "XPathResult"); } - /** - * @throws Exception if the test fails - */ - @Test - @Alerts("true") - public void _XSLTProcessor_XSLTProcessor() throws Exception { + @Alerts("true/false") + void _XSLTProcessor_XSLTProcessor() throws Exception { test("XSLTProcessor", "XSLTProcessor"); } } diff --git a/src/test/java/org/htmlunit/html/AttributesTest.java b/src/test/java/org/htmlunit/html/AttributesTest.java index c95dd11ecb5..effe3504b2b 100644 --- a/src/test/java/org/htmlunit/html/AttributesTest.java +++ b/src/test/java/org/htmlunit/html/AttributesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,16 +19,16 @@ import java.util.HashSet; import java.util.List; import java.util.Locale; +import java.util.stream.Stream; import org.htmlunit.BrowserVersion; import org.htmlunit.MockWebConnection; import org.htmlunit.WebClient; import org.htmlunit.WebTestCase; import org.htmlunit.html.parser.HTMLParser; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.DynamicTest; +import org.junit.jupiter.api.TestFactory; /** *

Tests for all the generated attribute accessors. This test case will @@ -46,11 +46,7 @@ * @author Ronald Brill * @author Frank Danek */ -public class AttributesTest extends TestCase { - - private final Class classUnderTest_; - private final Method method_; - private final String attributeName_; +public class AttributesTest { private static final List EXCLUDED_METHODS = new ArrayList<>(); static { @@ -61,13 +57,13 @@ public class AttributesTest extends TestCase { } /** - * Returns a test suite containing a separate test for each attribute on each element. + * Creates dynamic tests for each attribute on each element. * - * @return the test suite + * @return stream of dynamic tests * @throws Exception if the tests cannot be created */ - public static Test suite() throws Exception { - final TestSuite suite = new TestSuite(); + @TestFactory + Stream attributeTests() throws Exception { final String[] classesToTest = { "HtmlAbbreviated", "HtmlAcronym", "HtmlAnchor", "HtmlAddress", "HtmlArea", @@ -123,10 +119,11 @@ public static Test suite() throws Exception { }; final HashSet supportedTags = new HashSet<>(DefaultElementFactory.SUPPORTED_TAGS_); + final List tests = new ArrayList<>(); for (final String testClass : classesToTest) { final Class clazz = Class.forName("org.htmlunit.html." + testClass); - addTestsForClass(clazz, suite); + tests.addAll(createTestsForClass(clazz)); String tag; if (DomComment.class == clazz) { @@ -150,72 +147,78 @@ public static Test suite() throws Exception { if (!supportedTags.isEmpty()) { throw new RuntimeException("Missing tag class(es) " + supportedTags); } - return suite; + return tests.stream(); } /** - * Adds all the tests for a given class. + * Creates all the tests for a given class. * * @param clazz the class to create tests for - * @param page the page that will be passed into the constructor of the objects to be tested - * @param suite the suite that all the tests will be placed inside * @throws Exception if the tests cannot be created */ - private static void addTestsForClass(final Class clazz, final TestSuite suite) - throws Exception { - + private List createTestsForClass(final Class clazz) throws Exception { + final List tests = new ArrayList<>(); final Method[] methods = clazz.getMethods(); + for (final Method method : methods) { final String methodName = method.getName(); if (methodName.startsWith("get") && methodName.endsWith("Attribute") && !EXCLUDED_METHODS.contains(methodName)) { - String attributeName = methodName.substring(3, methodName.length() - 9).toLowerCase(Locale.ROOT); - if ("xmllang".equals(attributeName)) { - attributeName = "xml:lang"; - } - else if ("columns".equals(attributeName)) { - attributeName = "cols"; - } - else if ("columnspan".equals(attributeName)) { - attributeName = "colspan"; - } - else if ("textdirection".equals(attributeName)) { - attributeName = "dir"; - } - else if ("httpequiv".equals(attributeName)) { - attributeName = "http-equiv"; - } - else if ("acceptcharset".equals(attributeName)) { - attributeName = "accept-charset"; - } - else if ("htmlfor".equals(attributeName)) { - attributeName = "for"; - } - suite.addTest(new AttributesTest(attributeName, clazz, method)); + final String attributeName = + normalizeAttributeName( + methodName.substring(3, methodName.length() - 9).toLowerCase(Locale.ROOT)); + + final String testName = createTestName(clazz, method); + tests.add(DynamicTest.dynamicTest(testName, () -> { + executeAttributeTest(clazz, method, attributeName); + })); } } + return tests; } /** - * Creates an instance of the test. This will test one specific attribute - * on one specific class. - * @param attributeName the name of the attribute to test - * @param classUnderTest the class containing the attribute - * @param method the "getter" method for the specified attribute + * Normalizes attribute names for special cases. */ - public AttributesTest( - final String attributeName, - final Class classUnderTest, - final Method method) { + private static String normalizeAttributeName(final String attributeName) { + switch (attributeName) { + case "xmllang": return "xml:lang"; + case "columns": return "cols"; + case "columnspan": return "colspan"; + case "textdirection": return "dir"; + case "httpequiv": return "http-equiv"; + case "acceptcharset": return "accept-charset"; + case "htmlfor": return "for"; + default: return attributeName; + } + } - super(createTestName(classUnderTest, method)); - classUnderTest_ = classUnderTest; - method_ = method; - attributeName_ = attributeName; + /** + * Executes the actual test for a specific attribute. + * @param classUnderTest the class under test + * @param method the getter method + * @param attributeName the attribute name + * @throws Exception if the test fails + */ + private static void executeAttributeTest(final Class classUnderTest, + final Method method, final String attributeName) throws Exception { + try (WebClient webClient = new WebClient(BrowserVersion.BEST_SUPPORTED)) { + final MockWebConnection connection = new MockWebConnection(); + connection.setDefaultResponse("foo"); + webClient.setWebConnection(connection); + final HtmlPage page = webClient.getPage(WebTestCase.URL_FIRST); + final String value = "value"; + final DomElement objectToTest = getNewInstanceForClassUnderTest(classUnderTest, page); + objectToTest.setAttribute(attributeName, value); + final Object[] noObjects = new Object[0]; + final Object result = method.invoke(objectToTest, noObjects); + Assertions.assertSame(value, result); + } } + /** * Creates a name for this particular test that reflects the attribute being tested. * @param clazz the class containing the attribute @@ -230,51 +233,29 @@ private static String createTestName(final Class clazz, final Method method) return "testAttributes_" + className + '_' + method.getName(); } - /** - * Runs the actual test. - * @throws Exception if the test fails - */ - @Override - protected void runTest() throws Exception { - try (WebClient webClient = new WebClient(BrowserVersion.BEST_SUPPORTED)) { - final MockWebConnection connection = new MockWebConnection(); - connection.setDefaultResponse("foo"); - webClient.setWebConnection(connection); - final HtmlPage page = webClient.getPage(WebTestCase.URL_FIRST); - - final String value = "value"; - - final DomElement objectToTest = getNewInstanceForClassUnderTest(page); - objectToTest.setAttribute(attributeName_, value); - - final Object[] noObjects = new Object[0]; - final Object result = method_.invoke(objectToTest, noObjects); - assertSame(value, result); - } - } - /** * Creates a new instance of the class being tested. * @return the new instance * @throws Exception if the new object cannot be created */ - private DomElement getNewInstanceForClassUnderTest(final HtmlPage page) throws Exception { + private static DomElement getNewInstanceForClassUnderTest( + final Class classUnderTest, final HtmlPage page) throws Exception { final HTMLParser htmlParser = page.getWebClient().getPageCreator().getHtmlParser(); final DomElement newInstance; - if (classUnderTest_ == HtmlTableRow.class) { + if (classUnderTest == HtmlTableRow.class) { newInstance = htmlParser.getFactory(HtmlTableRow.TAG_NAME) .createElement(page, HtmlTableRow.TAG_NAME, null); } - else if (classUnderTest_ == HtmlTableHeaderCell.class) { + else if (classUnderTest == HtmlTableHeaderCell.class) { newInstance = htmlParser.getFactory(HtmlTableHeaderCell.TAG_NAME) .createElement(page, HtmlTableHeaderCell.TAG_NAME, null); } - else if (classUnderTest_ == HtmlTableDataCell.class) { + else if (classUnderTest == HtmlTableDataCell.class) { newInstance = htmlParser.getFactory(HtmlTableDataCell.TAG_NAME) .createElement(page, HtmlTableDataCell.TAG_NAME, null); } else { - final String tagName = (String) classUnderTest_.getField("TAG_NAME").get(null); + final String tagName = (String) classUnderTest.getField("TAG_NAME").get(null); newInstance = htmlParser.getFactory(tagName).createElement(page, tagName, null); } diff --git a/src/test/java/org/htmlunit/html/BaseFrameElement2Test.java b/src/test/java/org/htmlunit/html/BaseFrameElement2Test.java index 5cb9f97088a..73b0d7b1352 100644 --- a/src/test/java/org/htmlunit/html/BaseFrameElement2Test.java +++ b/src/test/java/org/htmlunit/html/BaseFrameElement2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,8 @@ package org.htmlunit.html; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; import org.openqa.selenium.WebDriver; /** @@ -27,7 +25,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class BaseFrameElement2Test extends WebDriverTestCase { /** @@ -36,8 +33,8 @@ public class BaseFrameElement2Test extends WebDriverTestCase { @Test @Alerts("posted called") public void windowEventListenersContainer() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" @@ -58,21 +55,23 @@ public void clickOnFocus() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("click click dblclick ") + @Alerts({"click", "click", "dblclick"}) public void dblClick() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" + "\n" - + "\n" + + LOG_TEXTAREA + ""; final WebDriver driver = loadPage2(content); @@ -81,6 +80,6 @@ public void dblClick() throws Exception { action.doubleClick(driver.findElement(By.id("myBody"))); action.perform(); - assertEquals(getExpectedAlerts()[0], driver.findElement(By.id("myTextarea")).getAttribute("value")); + verifyTextArea2(driver, getExpectedAlerts()); } } diff --git a/src/test/java/org/htmlunit/html/ClickableElementTest.java b/src/test/java/org/htmlunit/html/ClickableElementTest.java index b88d905e90b..05a81e65ad1 100644 --- a/src/test/java/org/htmlunit/html/ClickableElementTest.java +++ b/src/test/java/org/htmlunit/html/ClickableElementTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,11 +21,9 @@ import org.htmlunit.MockWebConnection; import org.htmlunit.SimpleWebTestCase; import org.htmlunit.WebClient; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.BuggyWebDriver; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.BuggyWebDriver; +import org.junit.jupiter.api.Test; /** * Tests for various clickable elements. @@ -35,16 +33,16 @@ * @author Marc Guillemot * @author Ahmed Ashour * @author Frank Danek + * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class ClickableElementTest extends SimpleWebTestCase { /** * Full page driver for onClick tests. * * @param htmlContent HTML fragment for body of page with clickable element - * identified by clickId ID attribute. Must have onClick that raises - * an alert of "foo". + * identified by clickId ID attribute. Must have onClick that raises + * an alert of "foo". * @throws Exception if the test fails */ private void onClickPageTest(final String htmlContent) throws Exception { @@ -56,7 +54,7 @@ private void onClickPageTest(final String htmlContent) throws Exception { * Full page driver for onClick tests. * * @param htmlContent HTML fragment for body of page with clickable element - * identified by clickId ID attribute. + * identified by clickId ID attribute. * @param numClicks number of times to click element * @param expectedAlerts array of expected popup values * @throws Exception if the test fails @@ -71,7 +69,7 @@ private void onClickPageTest(final String htmlContent, final int numClicks) thro * @param htmlContent HTML fragment for body of page with clickable element identified by clickId ID attribute * @param numClicks number of times to click element * @param expectedAlerts array of expected popup values - * @param exceptionOnError + * @param exceptionOnError indicate to throw on error * @throws Exception if the test fails */ private void onClickPageTest(final String htmlContent, final int numClicks, @@ -104,7 +102,7 @@ private void onClickPageTest(final String htmlContent, final int numClicks, * @throws Exception if the test fails */ private void onClickBodyTest(final String htmlBody) throws Exception { - onClickPageTest("foo\n" + htmlBody + onClickPageTest(DOCTYPE_HTML + "foo\n" + htmlBody + ""); } @@ -309,7 +307,8 @@ public void definitionDescription_onClick() throws Exception { */ @Test public void javaScriptError_onClick() throws Exception { - onClickPageTest("\n" + onClickPageTest(DOCTYPE_HTML + + "\n" + "

\n" + "", 1, false); @@ -577,7 +576,8 @@ public void object_onClick() throws Exception { @BuggyWebDriver(CHROME = "") // ChromeDriver does not generate a "foo" but it occurs manually public void option_onClick() throws Exception { - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "
\n" + ""; @@ -825,7 +825,8 @@ public void tableRow_onClick() throws Exception { */ @Test public void tableRow_onClickSetOnLoad() throws Exception { - onClickPageTest("\n" + onClickPageTest(DOCTYPE_HTML + + "\n" + "\n" @@ -60,9 +59,10 @@ public void appendChild_recursive() throws Exception { * @throws Exception on test failure */ @Test - @Alerts({"true", "exception", "1", "0"}) + @Alerts({"true", "HierarchyRequestError/DOMException", "1", "0"}) public void appendChild_recursive_parent() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -56,7 +52,8 @@ public void nextNode() throws Exception { final HtmlPage page = (HtmlPage) getEnclosedPage(); final NodeIterator iterator = page.createNodeIterator(page.getDocumentElement(), NodeFilter.SHOW_ALL, null, true); - assertThat(iterator.nextNode(), instanceOf(HtmlHtml.class)); + final Node node = iterator.nextNode(); + assertTrue(node.getClass().getName(), node instanceof HtmlHtml); } } } diff --git a/src/test/java/org/htmlunit/html/DomNodeListTest.java b/src/test/java/org/htmlunit/html/DomNodeListTest.java index 0721b58b617..f4c584c28bf 100644 --- a/src/test/java/org/htmlunit/html/DomNodeListTest.java +++ b/src/test/java/org/htmlunit/html/DomNodeListTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,17 +18,15 @@ import java.util.ListIterator; import org.htmlunit.SimpleWebTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Tests for {@link DomNodeList}. * * @author Tom Anderson * @author Frank Danek + * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class DomNodeListTest extends SimpleWebTestCase { /** @@ -36,8 +34,8 @@ public class DomNodeListTest extends SimpleWebTestCase { */ @Test public void getElementsByTagName() throws Exception { - final String firstContent - = "First\n" + final String firstContent = DOCTYPE_HTML + + "First\n" + "\n" + "
\n" + "
a
b
c
\n" @@ -61,8 +59,8 @@ public void getElementsByTagName() throws Exception { */ @Test public void getChildNodes() throws Exception { - final String firstContent - = "First\n" + final String firstContent = DOCTYPE_HTML + + "First\n" + "\n" + "
\n" + "
a
b
c
\n" diff --git a/src/test/java/org/htmlunit/html/DomNodeTest.java b/src/test/java/org/htmlunit/html/DomNodeTest.java index b01d3340ad2..94d2a1d651c 100644 --- a/src/test/java/org/htmlunit/html/DomNodeTest.java +++ b/src/test/java/org/htmlunit/html/DomNodeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,6 @@ */ package org.htmlunit.html; -import static org.junit.Assert.fail; - import java.util.ArrayList; import java.util.List; @@ -23,12 +21,11 @@ import org.htmlunit.SimpleWebTestCase; import org.htmlunit.WebClient; import org.htmlunit.html.DomNode.DescendantHtmlElementsIterator; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.htmlunit.util.MimeType; import org.htmlunit.xml.XmlPage; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.xml.sax.helpers.AttributesImpl; /** @@ -38,7 +35,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class DomNodeTest extends SimpleWebTestCase { /** @@ -47,7 +43,7 @@ public class DomNodeTest extends SimpleWebTestCase { */ @Test public void elementHasAttributesWith() throws Exception { - final String content = "text"; + final String content = DOCTYPE_HTML + "text"; final HtmlPage page = loadPage(content); final DomNode node = page.getElementById("tag"); @@ -60,7 +56,7 @@ public void elementHasAttributesWith() throws Exception { */ @Test public void elementHasAttributesNone() throws Exception { - final String content = "text"; + final String content = DOCTYPE_HTML + "text"; final HtmlPage page = loadPage(content); final DomNode node = page.getElementById("tag"); @@ -74,7 +70,7 @@ public void elementHasAttributesNone() throws Exception { */ @Test public void nonElementHasAttributes() throws Exception { - final String content = "text"; + final String content = DOCTYPE_HTML + "text"; final HtmlPage page = loadPage(content); final DomNode node = page.getElementById("tag"); @@ -88,7 +84,7 @@ public void nonElementHasAttributes() throws Exception { */ @Test public void nonElementGetPrefix() throws Exception { - final String content = "text"; + final String content = DOCTYPE_HTML + "text"; final HtmlPage page = loadPage(content); final DomNode node = page.getElementById("tag"); @@ -102,7 +98,7 @@ public void nonElementGetPrefix() throws Exception { */ @Test public void nonElementGetNamespaceURI() throws Exception { - final String content = "text"; + final String content = DOCTYPE_HTML + "text"; final HtmlPage page = loadPage(content); final DomNode node = page.getElementById("tag"); @@ -116,7 +112,7 @@ public void nonElementGetNamespaceURI() throws Exception { */ @Test public void nonElementGetLocalName() throws Exception { - final String content = "text"; + final String content = DOCTYPE_HTML + "text"; final HtmlPage page = loadPage(content); final DomNode node = page.getElementById("tag"); @@ -130,7 +126,7 @@ public void nonElementGetLocalName() throws Exception { */ @Test public void nonElementSetPrefix() throws Exception { - final String content = "text"; + final String content = DOCTYPE_HTML + "text"; final HtmlPage page = loadPage(content); final DomNode node = page.getElementById("tag"); @@ -144,8 +140,8 @@ public void nonElementSetPrefix() throws Exception { */ @Test public void removeAllChildren() throws Exception { - final String content - = "\n" + final String content = DOCTYPE_HTML + + "\n" + "

\n" + "\n" + "\n" @@ -162,8 +158,8 @@ public void removeAllChildren() throws Exception { */ @Test public void replace() throws Exception { - final String content - = "\n" + final String content = DOCTYPE_HTML + + "\n" + "

"; final HtmlPage page = loadPage(content); @@ -202,8 +198,8 @@ public void replace() throws Exception { */ @Test public void getNewNodeById() throws Exception { - final String content - = "\n" + final String content = DOCTYPE_HTML + + "\n" + "
"; final HtmlPage page = loadPage(content); @@ -216,7 +212,7 @@ public void getNewNodeById() throws Exception { .createElement(page, HtmlDivision.TAG_NAME, attributes); try { page.getHtmlElementById("newElt"); - fail("Element should not exist yet"); + Assertions.fail("Element should not exist yet"); } catch (final ElementNotFoundException e) { // nothing to do, it's ok @@ -227,7 +223,7 @@ public void getNewNodeById() throws Exception { page.getHtmlElementById("newElt"); try { page.getHtmlElementById("tag"); - fail("Element should not exist anymore"); + Assertions.fail("Element should not exist anymore"); } catch (final ElementNotFoundException e) { // nothing to do, it's ok @@ -242,8 +238,8 @@ public void getNewNodeById() throws Exception { */ @Test public void appendChild() throws Exception { - final String content - = "\n" + final String content = DOCTYPE_HTML + + "\n" + "

"; final HtmlPage page = loadPage(content); @@ -272,8 +268,8 @@ public void appendChild() throws Exception { */ @Test public void insertBefore() throws Exception { - final String content - = "\n" + final String content = DOCTYPE_HTML + + "\n" + "

"; final HtmlPage page = loadPage(content); @@ -320,8 +316,8 @@ private static int readPositionAmongParentChildren(final DomNode node) { */ @Test public void getByXPath() throws Exception { - final String htmlContent - = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + " \n" + " my title\n" + " " @@ -362,8 +358,8 @@ public void getByXPath() throws Exception { */ @Test public void getByXPathSelectedNode() throws Exception { - final String htmlContent - = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + " \n" + " my title\n" + " " @@ -388,7 +384,8 @@ public void getByXPathSelectedNode() throws Exception { */ @Test public void getByXPath_trim_namespace() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "
bla
\n" + ""; @@ -404,8 +401,8 @@ public void getByXPath_trim_namespace() throws Exception { */ @Test public void getFirstByXPathDisplayNone() throws Exception { - final String htmlContent - = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + " \n" + " my title\n" + " " @@ -416,11 +413,11 @@ public void getFirstByXPathDisplayNone() throws Exception { final HtmlPage page = loadPage(htmlContent); HtmlElement span = page.getFirstByXPath("//div/span"); - assertEquals("\r\n bla\r\n\r\n", span.asXml()); + assertEquals("bla", span.asXml()); assertFalse(span.isDisplayed()); span = page.getFirstByXPath("//span[text()=\"bla\"]"); - assertEquals("\r\n bla\r\n\r\n", span.asXml()); + assertEquals("bla", span.asXml()); assertFalse(span.isDisplayed()); } @@ -429,8 +426,8 @@ public void getFirstByXPathDisplayNone() throws Exception { */ @Test public void getFirstByXPath() throws Exception { - final String htmlContent - = "my title\n" + final String htmlContent = DOCTYPE_HTML + + "my title\n" + "
  • foo 1
  • foo 2
\n" + "
bla
\n" + ""; @@ -459,7 +456,8 @@ public void getFirstByXPath() throws Exception { */ @Test public void getHtmlElementDescendantsOrder() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -489,8 +487,8 @@ public void getHtmlElementDescendantsOrder() throws Exception { */ @Test public void getDescendants_remove() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "
a
b
a
c
a
d
\n" + ""; final HtmlPage page = loadPage(html); @@ -528,8 +526,8 @@ List getCollectedValues() { */ @Test public void domChangeListenerTestImpl_insertBefore() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "a1\n" + "a2\n" + "a3\n" @@ -349,7 +346,8 @@ public void click_javascriptUrl_encoded() throws Exception { */ @Test public void openLinkInNewWindow() throws Exception { - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "link to foo1\n" + ""; @@ -378,11 +376,12 @@ public void openLinkInNewWindow() throws Exception { */ @Test public void correctLinkTargetWhenOnclickOpensWindow() throws Exception { - final String firstContent = "First\n" + final String firstContent = DOCTYPE_HTML + + "First\n" + "X\n" + ""; - final String html2 = "Second"; - final String htmlPopup = "Popup"; + final String html2 = DOCTYPE_HTML + "Second"; + final String htmlPopup = DOCTYPE_HTML + "Popup"; final WebClient client = getWebClient(); final List collectedAlerts = new ArrayList<>(); @@ -410,8 +409,8 @@ public void correctLinkTargetWhenOnclickOpensWindow() throws Exception { */ @Test public void preventDefault1() throws Exception { - final String html = - "\n" + "\n" @@ -450,7 +447,8 @@ public void setText() throws Exception { @Test @Alerts("foo") public void innerHtmlHrefQuotedEvenInIE() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -465,16 +463,16 @@ public void innerHtmlHrefQuotedEvenInIE() throws Exception { */ @Test public void click() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "link to foo1\n" + "link to foo2\n" + ""; - final String secondContent - = "Second"; + final String secondContent = DOCTYPE_HTML + + "Second"; final MockWebConnection webConnection = getMockWebConnection(); webConnection.setDefaultResponse(secondContent); @@ -497,8 +495,8 @@ public void click() throws Exception { */ @Test public void clickAnchorName() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + " link to foo1\n" @@ -519,8 +517,8 @@ public void clickAnchorName() throws Exception { @Test @Alerts({"", "#anchor", "#!bang"}) public void dontReloadHashBang() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " link1\n" @@ -560,8 +558,8 @@ public void dontReloadHashBang() throws Exception { @Test @Alerts({"#!board/WebDev", "#!article/WebDev/35", "#!article/WebDev/35"}) public void dontReloadHashBang2() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " link1\n" @@ -599,23 +597,26 @@ public void dontReloadHashBang2() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("click href click doubleClick href ") - @BuggyWebDriver( - FF = "click click doubleClick href href ", - FF_ESR = "click click doubleClick href href ") - @HtmlUnitNYI(CHROME = "click href click href doubleClick ", - EDGE = "click href click href doubleClick ", - FF = "click href click href doubleClick ", - FF_ESR = "click href click href doubleClick ") + @Alerts({"click", "href", "click", "doubleClick", "href"}) + @BuggyWebDriver(FF_ESR = {"click", "click", "doubleClick", "href", "href"}) + @HtmlUnitNYI(CHROME = {"click", "href", "click", "href", "doubleClick"}, + EDGE = {"click", "href", "click", "href", "doubleClick"}, + FF = {"click", "href", "click", "href", "doubleClick"}, + FF_ESR = {"click", "href", "click", "href", "doubleClick"}) public void doubleClick() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + + "\n" + + "\n" + + "\n" + "\n" + " foo\n" - + " \n" + + "href=\"javascript:log('href');void(0);\" " + + "onClick=\"log('click');\" " + + "onDblClick=\"log('doubleClick');\">foo\n" + + LOG_TEXTAREA + ""; final WebDriver driver = loadPage2(html); @@ -624,7 +625,7 @@ public void doubleClick() throws Exception { action.doubleClick(driver.findElement(By.id("myAnchor"))); action.perform(); - assertEquals(getExpectedAlerts()[0], driver.findElement(By.id("myTextarea")).getAttribute("value")); + verifyTextArea2(driver, getExpectedAlerts()); } /** @@ -635,8 +636,8 @@ public void doubleClick() throws Exception { public void encoding() throws Exception { final String href = "bug.html?" + URLEncoder.encode("h\u00F6", "UTF-8") + '=' + URLEncoder.encode("G\u00FCnter", "UTF-8"); - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" @@ -664,8 +665,8 @@ public void encoding() throws Exception { */ @Test public void javascriptWithReturn() throws Exception { - final String html - = "First\n" + final String html = DOCTYPE_HTML + + "First\n" + " hi\n" + ""; final WebDriver webDriver = loadPage2(html); @@ -677,8 +678,8 @@ public void javascriptWithReturn() throws Exception { */ @Test public void javascriptWithReturnWhitespace() throws Exception { - final String html - = "First\n" + final String html = DOCTYPE_HTML + + "First\n" + " hi\n" + ""; final WebDriver webDriver = loadPage2(html); @@ -691,7 +692,8 @@ public void javascriptWithReturnWhitespace() throws Exception { @Test @Alerts({"1", "First"}) public void shiftClick() throws Exception { - final String html = "First\n" + final String html = DOCTYPE_HTML + + "First\n" + "Click Me\n" + ""; @@ -721,7 +723,8 @@ public void shiftClick() throws Exception { @Test @Alerts({"1", "First"}) public void ctrlClick() throws Exception { - final String html = "First\n" + final String html = DOCTYPE_HTML + + "First\n" + "Click Me\n" + ""; @@ -739,7 +742,7 @@ public void ctrlClick() throws Exception { .keyUp(Keys.CONTROL) .perform(); - Thread.sleep(DEFAULT_WAIT_TIME); + Thread.sleep(DEFAULT_WAIT_TIME.toMillis()); assertEquals("Should have opened a new window", windowsSize + Integer.parseInt(getExpectedAlerts()[0]), driver.getWindowHandles().size()); assertEquals("Should not have navigated away", getExpectedAlerts()[1], driver.getTitle()); @@ -752,12 +755,12 @@ public void ctrlClick() throws Exception { @Test @Alerts("§§URL§§index.html?test") public void click_refererHeader() throws Exception { - final String firstContent - = "Page A\n" + final String firstContent = DOCTYPE_HTML + + "Page A\n" + "link\n" + ""; - final String secondContent - = "Page B\n" + final String secondContent = DOCTYPE_HTML + + "Page B\n" + "\n" + ""; @@ -783,12 +786,12 @@ public void click_refererHeader() throws Exception { */ @Test public void click_refererHeaderNoReferrer() throws Exception { - final String firstContent - = "Page A\n" + final String firstContent = DOCTYPE_HTML + + "Page A\n" + "link\n" + ""; - final String secondContent - = "Page B\n" + final String secondContent = DOCTYPE_HTML + + "Page B\n" + "\n" + ""; @@ -812,12 +815,12 @@ public void click_refererHeaderNoReferrer() throws Exception { */ @Test public void click_refererHeaderNoReferrerCaseSensitive() throws Exception { - final String firstContent - = "Page A\n" + final String firstContent = DOCTYPE_HTML + + "Page A\n" + "link\n" + ""; - final String secondContent - = "Page B\n" + final String secondContent = DOCTYPE_HTML + + "Page B\n" + "\n" + ""; @@ -841,14 +844,14 @@ public void click_refererHeaderNoReferrerCaseSensitive() throws Exception { @Test @Alerts("§§URL§§index.html?test") public void controlClick_refererHeader() throws Exception { - final String firstContent - = "Page A\n" + final String firstContent = DOCTYPE_HTML + + "Page A\n" + "\n" + " link\n" + "\n" + ""; - final String secondContent - = "Page B\n" + final String secondContent = DOCTYPE_HTML + + "Page B\n" + "\n" + ""; @@ -866,7 +869,7 @@ public void controlClick_refererHeader() throws Exception { .keyUp(Keys.CONTROL) .build().perform(); - Thread.sleep(DEFAULT_WAIT_TIME / 10); + Thread.sleep(DEFAULT_WAIT_TIME.toMillis() / 10); assertEquals(2, getMockWebConnection().getRequestCount()); diff --git a/src/test/java/org/htmlunit/html/HtmlArea2Test.java b/src/test/java/org/htmlunit/html/HtmlArea2Test.java index ef831423fca..75b670ba0ce 100644 --- a/src/test/java/org/htmlunit/html/HtmlArea2Test.java +++ b/src/test/java/org/htmlunit/html/HtmlArea2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,9 +26,7 @@ import org.htmlunit.MockWebConnection; import org.htmlunit.SimpleWebTestCase; import org.htmlunit.WebClient; -import org.htmlunit.junit.BrowserRunner; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Tests for {@link HtmlArea}. @@ -38,7 +36,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class HtmlArea2Test extends SimpleWebTestCase { private WebClient createWebClient(final String onClick) throws IOException { @@ -50,16 +47,16 @@ private WebClient createWebClient(final String onClick) throws IOException { webConnection.setResponse(urlImage, directBytes, 200, "ok", "image/jpg", Collections.emptyList()); } - final String firstContent - = "first\n" + final String firstContent = DOCTYPE_HTML + + "first\n" + "\n" + "\n" + "\n" + "\n" + ""; - final String secondContent = "second"; - final String thirdContent = "third"; + final String secondContent = DOCTYPE_HTML + "second"; + final String thirdContent = DOCTYPE_HTML + "third"; final WebClient client = getWebClient(); @@ -126,8 +123,8 @@ public void click_onclickReturnsTrue() throws Exception { */ @Test public void click_javascriptUrl_javascriptDisabled() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + ""; final WebClient client = getWebClient(); diff --git a/src/test/java/org/htmlunit/html/HtmlAreaTest.java b/src/test/java/org/htmlunit/html/HtmlAreaTest.java index 226c1bd77f3..aeba85ea893 100644 --- a/src/test/java/org/htmlunit/html/HtmlAreaTest.java +++ b/src/test/java/org/htmlunit/html/HtmlAreaTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,11 +23,9 @@ import org.htmlunit.HttpHeader; import org.htmlunit.Page; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.BuggyWebDriver; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.BuggyWebDriver; +import org.junit.jupiter.api.Test; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriverException; @@ -39,7 +37,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class HtmlAreaTest extends WebDriverTestCase { private WebDriver createWebClient(final String onClick) throws Exception { @@ -49,8 +46,8 @@ private WebDriver createWebClient(final String onClick) throws Exception { getMockWebConnection().setResponse(urlImage, directBytes, 200, "ok", "image/jpg", Collections.emptyList()); } - final String firstContent - = "first\n" + final String firstContent = DOCTYPE_HTML + + "first\n" + "\n" + " \n" + " \n" @@ -59,8 +56,8 @@ private WebDriver createWebClient(final String onClick) throws Exception { + " \n" + " \n" + ""; - final String secondContent = "second"; - final String thirdContent = "third"; + final String secondContent = DOCTYPE_HTML + "second"; + final String thirdContent = DOCTYPE_HTML + "third"; getMockWebConnection().setResponse(URL_SECOND, secondContent); getMockWebConnection().setResponse(URL_THIRD, thirdContent); @@ -97,7 +94,8 @@ public void referer() throws Exception { */ @Test public void isDisplayedRect() throws Exception { - final String html = "Page A\n" + final String html = DOCTYPE_HTML + + "Page A\n" + "\n" + " \n" + " \n" @@ -375,8 +381,8 @@ public void click_javascriptUrl() throws Exception { getMockWebConnection().setResponse(urlImage, directBytes, 200, "ok", "image/jpg", Collections.emptyList()); } - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " \n" @@ -415,8 +421,8 @@ public void click_javascriptUrlMixedCase() throws Exception { getMockWebConnection().setResponse(urlImage, directBytes, 200, "ok", "image/jpg", Collections.emptyList()); } - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " \n" @@ -456,8 +462,8 @@ public void click_javascriptUrlLeadingWhitespace() throws Exception { getMockWebConnection().setResponse(urlImage, directBytes, 200, "ok", "image/jpg", Collections.emptyList()); } - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " \n" @@ -497,8 +503,8 @@ public void thisInJavascriptHref() throws Exception { getMockWebConnection().setResponse(urlImage, directBytes, 200, "ok", "image/jpg", Collections.emptyList()); } - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " \n" diff --git a/src/test/java/org/htmlunit/html/HtmlAttrTest.java b/src/test/java/org/htmlunit/html/HtmlAttrTest.java index 181433f254f..f86a239fb73 100644 --- a/src/test/java/org/htmlunit/html/HtmlAttrTest.java +++ b/src/test/java/org/htmlunit/html/HtmlAttrTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,9 +20,7 @@ import java.util.Map; import org.htmlunit.SimpleWebTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Tests for {@link DomAttr}. @@ -31,8 +29,8 @@ * @author Ahmed Ashour * @author David K. Taylor * @author Frank Danek + * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class HtmlAttrTest extends SimpleWebTestCase { /** Test object. */ @@ -128,7 +126,8 @@ public void getParent() { */ @Test public void nodeType() throws Exception { - final String content = "foo\n" + "\n" + "
\n" - + "\n" + + " \n" + "\n" - + "\n" + + LOG_TEXTAREA + ""; final WebDriver driver = loadPage2(html); driver.findElement(By.id("chkbox")).click(); - assertEquals(Arrays.asList(getExpectedAlerts()).toString(), - '[' + driver.findElement(By.id("myTextarea")).getAttribute("value") + ']'); + verifyTextArea2(driver, getExpectedAlerts()); } /** * @throws Exception if the test fails */ @Test - @Alerts("foo,change,boo,blur,") + @Alerts({"onchange change", "onblur blur"}) public void onchangeFires2() throws Exception { - final String html = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "foo\n" + "\n" + "\n" + "
\n" + "\n" + "\n" + "\n" - + "\n" + + LOG_TEXTAREA + ""; final WebDriver driver = loadPage2(html); driver.findElement(By.id("chkbox")).click(); driver.findElement(By.id("chkbox2")).click(); - assertEquals(Arrays.asList(getExpectedAlerts()).toString(), - '[' + driver.findElement(By.id("myTextarea")).getAttribute("value") + ']'); + verifyTextArea2(driver, getExpectedAlerts()); } /** @@ -521,15 +506,14 @@ public void onchangeFires2() throws Exception { @Test @Alerts("Second") public void setChecked() throws Exception { - final String firstHtml = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String firstHtml = DOCTYPE_HTML + "First\n" + "
\n" + "\n" + "\n" + ""; - final String secondHtml - = "Second"; + final String secondHtml = DOCTYPE_HTML + + "Second"; getMockWebConnection().setDefaultResponse(secondHtml); final WebDriver driver = loadPage2(firstHtml); @@ -544,16 +528,15 @@ public void setChecked() throws Exception { @Test @Alerts("Second") public void setChecked2() throws Exception { - final String firstHtml = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String firstHtml = DOCTYPE_HTML + "First\n" + "
\n" + "\n" + "\n" + "\n" + ""; - final String secondHtml - = "Second"; + final String secondHtml = DOCTYPE_HTML + + "Second"; getMockWebConnection().setDefaultResponse(secondHtml); final WebDriver driver = loadPage2(firstHtml); @@ -567,8 +550,7 @@ public void setChecked2() throws Exception { */ @Test public void preventDefault() throws Exception { - final String html = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" @@ -519,9 +519,9 @@ public void selection() throws Exception { * @throws Exception if test fails */ @Test - @Alerts({"null,null", "exception value", "null,null", - "exception", "null,null", - "exception", "null,null"}) + @Alerts({"null,null", "InvalidStateError/DOMException", "null,null", + "InvalidStateError/DOMException", "null,null", + "InvalidStateError/DOMException", "null,null"}) public void selection2_1() throws Exception { selection2(3, 10); } @@ -530,9 +530,9 @@ public void selection2_1() throws Exception { * @throws Exception if test fails */ @Test - @Alerts({"null,null", "exception value", "null,null", - "exception", "null,null", - "exception", "null,null"}) + @Alerts({"null,null", "InvalidStateError/DOMException", "null,null", + "InvalidStateError/DOMException", "null,null", + "InvalidStateError/DOMException", "null,null"}) public void selection2_2() throws Exception { selection2(-3, 15); } @@ -541,15 +541,16 @@ public void selection2_2() throws Exception { * @throws Exception if test fails */ @Test - @Alerts({"null,null", "exception value", "null,null", - "exception", "null,null", - "exception", "null,null"}) + @Alerts({"null,null", "InvalidStateError/DOMException", "null,null", + "InvalidStateError/DOMException", "null,null", + "InvalidStateError/DOMException", "null,null"}) public void selection2_3() throws Exception { selection2(10, 5); } private void selection2(final int selectionStart, final int selectionEnd) throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" + "\n" + ""; @@ -591,9 +592,10 @@ private void selection2(final int selectionStart, final int selectionEnd) throws * @throws Exception if test fails */ @Test - @Alerts({"null,null", "exception"}) + @Alerts({"null,null", "InvalidStateError/DOMException"}) public void selectionOnUpdate() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" + "\n" + ""; @@ -631,7 +633,8 @@ public void selectionOnUpdate() throws Exception { @Test @Alerts({"changed2", "changed"}) public void firingOnchange() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -657,7 +660,8 @@ public void firingOnchange() throws Exception { @Test @Alerts({"true", "true"}) public void nonZeroWidthHeight() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "

hello world

\n" @@ -152,17 +149,17 @@ public void asFunction() throws Exception { @Test @Alerts("TypeError") public void asFunctionFormsFunction() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "

hello world

\n" @@ -180,19 +177,23 @@ public void asFunctionFormsFunction() throws Exception { */ @Test public void base() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + "\n" + "
\n" + " \n" + ""; - getMockWebConnection().setDefaultResponse("foo"); + getMockWebConnection().setDefaultResponse(DOCTYPE_HTML + "foo"); final WebDriver driver = loadPage2(html); driver.findElement(new ByTagName("input")).click(); + if (useRealBrowser()) { + Thread.sleep(400); + } + assertEquals(2, getMockWebConnection().getRequestCount()); final URL requestedUrl = getMockWebConnection().getLastWebRequest().getUrl(); final URL expectedUrl = new URL(URL_SECOND, "two.html"); assertEquals(expectedUrl, requestedUrl); @@ -203,19 +204,23 @@ public void base() throws Exception { */ @Test public void emptyActionWithBase() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + "\n" + "
\n" + " \n" + ""; - getMockWebConnection().setDefaultResponse("foo"); + getMockWebConnection().setDefaultResponse(DOCTYPE_HTML + "foo"); final WebDriver driver = loadPage2(html); driver.findElement(new ByTagName("input")).click(); + if (useRealBrowser()) { + Thread.sleep(400); + } + assertEquals(2, getMockWebConnection().getRequestCount()); final URL requestedUrl = getMockWebConnection().getLastWebRequest().getUrl(); assertEquals(URL_FIRST.toExternalForm(), requestedUrl); } @@ -225,8 +230,8 @@ public void emptyActionWithBase() throws Exception { */ @Test public void emptyActionWithBase2() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + "\n" + "
\n" @@ -234,27 +239,28 @@ public void emptyActionWithBase2() throws Exception { + " \n" + ""; - getMockWebConnection().setDefaultResponse("foo"); + getMockWebConnection().setDefaultResponse(DOCTYPE_HTML + "foo"); final WebDriver driver = loadPage2(html); driver.findElement(new ByTagName("input")).click(); + assertEquals(1, getMockWebConnection().getRequestCount()); final URL requestedUrl = getMockWebConnection().getLastWebRequest().getUrl(); assertEquals(URL_FIRST.toExternalForm(), requestedUrl); } /** - * Simulates a bug report where using JavaScript to submit a form that contains a - * JavaScript action causes a an "IllegalArgumentException: JavaScript URLs can only - * be used to load content into frames and iframes". - * - * @throws Exception if the test fails - */ + * Simulates a bug report where using JavaScript to submit a form that contains a + * JavaScript action causes a an "IllegalArgumentException: JavaScript URLs can only + * be used to load content into frames and iframes". + * + * @throws Exception if the test fails + */ @Test @Alerts("clicked") public void jSSubmit_JavaScriptAction() throws Exception { - final String html - = "First\n" + final String html = DOCTYPE_HTML + + "First\n" + "\n" + "
\n" @@ -269,8 +275,8 @@ public void jSSubmit_JavaScriptAction() throws Exception { @Test @Alerts({"1", "val2", "3", "3"}) public void malformedHtml_nestedForms() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" + "Click me\n" + ""; - final String secondHtml = "Second"; + final String secondHtml = DOCTYPE_HTML + "Second"; final WebClient client = getWebClientWithMockWebConnection(); final List collectedAlerts = new ArrayList<>(); @@ -542,8 +538,8 @@ public void submit_AnchorCausesSubmit_onSubmitHandler_returnFalse() throws Excep */ @Test public void submit_CheckboxClicked() throws Exception { - final String html - = "foo\n" + final String html = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + ""; - final String secondHtml = "\n" + final String secondHtml = DOCTYPE_HTML + + "\n" + "\n" @@ -68,12 +66,13 @@ public void crossFrameJavascript() throws Exception { */ @Test @Alerts(DEFAULT = "1", - CHROME = {"1", "1"}, - EDGE = {"1", "1"}) + CHROME = {"2", "1", "1"}, + EDGE = {"2", "1", "1"}) @HtmlUnitNYI(CHROME = "1", EDGE = "1") public void iframeOnloadCalledOnlyOnce() throws Exception { - final String firstHtml = "\n" + final String firstHtml = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -88,9 +87,14 @@ public void iframeOnloadCalledOnlyOnce() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("1") + @Alerts(DEFAULT = {"2", "1"}, + FF = "1", + FF_ESR = "1") + @HtmlUnitNYI(CHROME = "1", + EDGE = "1") public void iframeOnloadAboutBlank() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -114,12 +118,14 @@ public void postponeLoading() throws Exception { + " \n" + ""; - final String secondHtml = "\n" + final String secondHtml = DOCTYPE_HTML + + "\n" + "\n" + "

second

\n" + ""; - final String thirdHtml = "\n" + final String thirdHtml = DOCTYPE_HTML + + "\n" + "\n" + "
\n" + " \n" @@ -145,12 +151,14 @@ public void frameOnload() throws Exception { + " \n" + ""; - final String secondHtml = "\n" + final String secondHtml = DOCTYPE_HTML + + "\n" + "\n" + "

second

\n" + ""; - final String thirdHtml = "\n" + final String thirdHtml = DOCTYPE_HTML + + "\n" + "\n" + "

third

\n" + ""; @@ -168,14 +176,18 @@ public void frameOnload() throws Exception { */ @Test @Alerts("second fourth third first") - @NotYetImplemented + @HtmlUnitNYI(CHROME = "fourth second third first", + EDGE = "fourth second third first", + FF = "fourth second third first", + FF_ESR = "fourth second third first") public void frameOnloadFrameInFrame() throws Exception { final String html = "\n" + " \n" + " \n" + ""; - final String secondHtml = "\n" + final String secondHtml = DOCTYPE_HTML + + "\n" + "\n" + "

second

\n" + ""; @@ -184,7 +196,8 @@ public void frameOnloadFrameInFrame() throws Exception { + " \n" + ""; - final String fourthHtml = "\n" + final String fourthHtml = DOCTYPE_HTML + + "\n" + "\n" + "

fourth

\n" + ""; @@ -207,7 +220,8 @@ public void frameOnloadFrameInFrame() throws Exception { @Test @Alerts("myInputName") public void iframeContentNotLoaded() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "FooBar\n" + "\n" + "\n" @@ -248,16 +262,18 @@ public void iframeContentNotLoaded() throws Exception { @Test @Alerts("foo") public void onloadInNavigatedFrame() throws Exception { - final String html = "first\n" + final String html = DOCTYPE_HTML + + "first\n" + "\n" + " \n" + ""; - final String firstHtml = "\n" + final String firstHtml = DOCTYPE_HTML + + "\n" + "hello\n" + ""; - final String secondHtml = ""; + final String secondHtml = DOCTYPE_HTML + ""; final MockWebConnection webConnection = getMockWebConnection(); webConnection.setResponse(new URL(URL_FIRST, "frame1.html"), firstHtml); @@ -277,8 +293,8 @@ public void onloadInNavigatedFrame() throws Exception { @Test @Alerts("loaded") public void lineBreaksInUrl() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "Test\n" + ""; @@ -286,8 +302,8 @@ public void lineBreaksInUrl() throws Exception { getMockWebConnection().setResponse(new URL(URL_SECOND, "abcd"), html); expandExpectedAlertsVariables(URL_SECOND); - final String frame - = "\n" + final String frame = DOCTYPE_HTML + + "\n" + " \n" + " \n" + " "; @@ -302,8 +318,8 @@ public void lineBreaksInUrl() throws Exception { @Test @Alerts("loaded") public void lineBreaksInUrlIFrame() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "Test\n" + ""; @@ -311,8 +327,8 @@ public void lineBreaksInUrlIFrame() throws Exception { getMockWebConnection().setResponse(new URL(URL_SECOND, "abcd"), html); expandExpectedAlertsVariables(URL_SECOND); - final String frame - = "\n" + final String frame = DOCTYPE_HTML + + "\n" + " \n" + " \n" + " \n" diff --git a/src/test/java/org/htmlunit/html/HtmlFrameSetTest.java b/src/test/java/org/htmlunit/html/HtmlFrameSetTest.java index 5fa2da8f657..2b2837b973a 100644 --- a/src/test/java/org/htmlunit/html/HtmlFrameSetTest.java +++ b/src/test/java/org/htmlunit/html/HtmlFrameSetTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,10 +25,9 @@ import org.htmlunit.SimpleWebTestCase; import org.htmlunit.WebClient; import org.htmlunit.WebWindow; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.NotYetImplemented; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; +import org.junit.jupiter.api.Test; /** * Tests for {@link HtmlFrameSet}. @@ -37,8 +36,8 @@ * @author Marc Guillemot * @author Hans Donner * @author Ahmed Ashour + * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class HtmlFrameSetTest extends SimpleWebTestCase { /** @@ -46,8 +45,8 @@ public class HtmlFrameSetTest extends SimpleWebTestCase { */ @Test public void loadingFrameSet() throws Exception { - final String firstContent - = "First\n" + final String firstContent = DOCTYPE_HTML + + "First\n" + "\n" + " \n" + " \n" @@ -56,8 +55,8 @@ public void loadingFrameSet() throws Exception { + " \n" + "\n" + ""; - final String secondContent = "Second"; - final String thirdContent = "Third"; + final String secondContent = DOCTYPE_HTML + "Second"; + final String thirdContent = DOCTYPE_HTML + "Third"; final WebClient webClient = getWebClientWithMockWebConnection(); @@ -84,13 +83,13 @@ public void loadingFrameSet() throws Exception { */ @Test public void loadingIFrames() throws Exception { - final String firstContent - = "First\n" + final String firstContent = DOCTYPE_HTML + + "First\n" + "\n" + " \n" + " \n" + "\n" + ""; - final String rightFrame = "Right Frame\n" + final String rightFrame = DOCTYPE_HTML + + "Right Frame\n" + "
Body of right frame
\n" + ""; - final String leftFrame = "Left Frame\n" + final String leftFrame = DOCTYPE_HTML + + "Left Frame\n" + "\n" + "
Body of left frame
\n" + " Click link\n" @@ -122,11 +120,13 @@ public void targetResolution() throws Exception { + "\n" + ""; - final String innerFrame = "Inner Frame\n" + final String innerFrame = DOCTYPE_HTML + + "Inner Frame\n" + "
Body of inner frame
\n" + ""; - final String newInnerFrame = "New inner Frame\n" + final String newInnerFrame = DOCTYPE_HTML + + "New inner Frame\n" + "
Body of new inner frame
\n" + ""; @@ -184,15 +184,15 @@ public void targetResolution() throws Exception { @Test @Alerts("2") public void scriptUnderIFrame() throws Exception { - final String firstContent - = "\n" + final String firstContent = DOCTYPE_HTML + + "\n" + "\n" + ""; - final String secondContent - = ""; + final String secondContent = DOCTYPE_HTML + + ""; final String thirdContent = "alert('3');"; getMockWebConnection().setResponse(URL_SECOND, secondContent); @@ -211,17 +211,18 @@ public void scriptUnderIFrame() throws Exception { @Alerts(DEFAULT = "about:blank", CHROME = "about://unsupported", EDGE = "about://unsupported") - @NotYetImplemented({CHROME, EDGE}) + @HtmlUnitNYI(CHROME = "about:blank", + EDGE = "about:blank") public void aboutSrc() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -250,7 +251,8 @@ public void aboutSrc() throws Exception { FF = {"1:false", "2:false", "3:false", "4:false"}, FF_ESR = {"1:false", "2:false", "3:false", "4:false"}) public void createIframeFromStrictFunction() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; - final String secondContent = "Second"; - final String thirdContent = "Third"; + final String secondContent = DOCTYPE_HTML + "Second"; + final String thirdContent = DOCTYPE_HTML + "Third"; final WebClient client = getWebClientWithMockWebConnection(); final MockWebConnection webConnection = getMockWebConnection(); @@ -196,8 +194,8 @@ public void setSrcAttribute_ViaJavaScript() throws Exception { */ @Test public void frameCloneDoesNotReloadFrame() throws Exception { - final String html1 = ""; - final String html2 = "abc"; + final String html1 = DOCTYPE_HTML + ""; + final String html2 = DOCTYPE_HTML + "abc"; final WebClient client = getWebClientWithMockWebConnection(); @@ -218,11 +216,11 @@ public void frameCloneDoesNotReloadFrame() throws Exception { */ @Test public void frameWriteDoesNotReloadFrame() throws Exception { - final String html1 = - "\n" + final String html1 = DOCTYPE_HTML + + "\n" + "\n" + ""; - final String html2 = "iframe content"; + final String html2 = DOCTYPE_HTML + "iframe content"; final WebClient client = getWebClientWithMockWebConnection(); @@ -247,8 +245,8 @@ public void frameWriteDoesNotReloadFrame() throws Exception { */ @Test public void frameSetInnerHtmlDoesLoadFrame() throws Exception { - final String html1 = - "\n" + final String html1 = DOCTYPE_HTML + + "\n" + "';\n" + "\n" + "\n" + ""; - final String html2 = "iframe content"; - final String html3 = "Third content"; + final String html2 = DOCTYPE_HTML + "iframe content"; + final String html3 = DOCTYPE_HTML + "Third content"; final WebClient client = getWebClientWithMockWebConnection(); @@ -289,8 +287,8 @@ public void frameSetInnerHtmlDoesLoadFrame() throws Exception { */ @Test public void frameSetInnerHtmlDoesLoadFrameContentTimeout() throws Exception { - final String html1 = - "\n" + final String html1 = DOCTYPE_HTML + + "\n" + "';\n" + "\n" + "\n" + ""; - final String html2 = "iframe content"; - final String html3 = "Third content"; + final String html2 = DOCTYPE_HTML + "iframe content"; + final String html3 = DOCTYPE_HTML + "Third content"; final WebClient client = getWebClientWithMockWebConnection(); @@ -339,8 +337,8 @@ public void frameSetInnerHtmlDoesLoadFrameContentTimeout() throws Exception { */ @Test public void frameContentCreationViaJavascript() throws Exception { - final String html = - "frames\n" + final String html = DOCTYPE_HTML + + "frames\n" + "\n" + "\n" + "\n" @@ -82,8 +79,8 @@ public void onchangeDirectCall() throws Exception { @Test @Alerts({"function handler() {}", "null"}) public void onchangeNull() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -665,8 +662,8 @@ public void detached_datetime() throws Exception { } private void changeTypeDetached(final String value, final String targetType) throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/html/HtmlInputTest.java b/src/test/java/org/htmlunit/html/HtmlInputTest.java index cb6575e1fae..c583fda6664 100644 --- a/src/test/java/org/htmlunit/html/HtmlInputTest.java +++ b/src/test/java/org/htmlunit/html/HtmlInputTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ */ package org.htmlunit.html; -import static org.junit.Assert.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; import java.util.ArrayList; import java.util.Arrays; @@ -26,9 +26,7 @@ import org.htmlunit.SimpleWebTestCase; import org.htmlunit.WebClient; import org.htmlunit.corejs.javascript.ScriptableObject; -import org.htmlunit.junit.BrowserRunner; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Tests for {@link HtmlInput}. @@ -39,7 +37,6 @@ * @author Anton Demydenko * @author Ronny Shapiro */ -@RunWith(BrowserRunner.class) public final class HtmlInputTest extends SimpleWebTestCase { /** @@ -48,8 +45,8 @@ public final class HtmlInputTest extends SimpleWebTestCase { */ @Test public void radioButtonsAreMutuallyExclusive() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + "\n" @@ -81,8 +78,8 @@ public void radioButtonsAreMutuallyExclusive() throws Exception { */ @Test public void setChecked_CheckBox() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + "\n" @@ -105,8 +102,8 @@ public void setChecked_CheckBox() throws Exception { */ @Test public void getChecked_RadioButton() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + "\n" @@ -128,8 +125,8 @@ public void getChecked_RadioButton() throws Exception { */ @Test public void setValueAttribute() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + ""; @@ -150,8 +147,8 @@ public void setValueAttribute() throws Exception { */ @Test public void checkboxDefaultValue() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "
\n" + "\n" + ""; @@ -169,8 +166,8 @@ public void checkboxDefaultValue() throws Exception { */ @Test public void clickRadioButton() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "
\n" + "\n" + "\n" @@ -195,8 +192,8 @@ public void clickRadioButton() throws Exception { */ @Test public void inputNoType() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + ""; @@ -212,8 +209,8 @@ public void inputNoType() throws Exception { */ @Test public void onChangeHandlerNotFiredOnLoad() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "
\n" + "\n" + ""; @@ -228,7 +225,8 @@ public void onChangeHandlerNotFiredOnLoad() throws Exception { */ @Test public void testRequiredValidation() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "
\n" @@ -242,10 +240,13 @@ public void testRequiredValidation() throws Exception { assertFalse(input.isValid()); } + /** + * @throws Exception if an error occurs + */ @Test public void changeType_javascriptEngineDisabled() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + ""; @@ -261,10 +262,13 @@ public void changeType_javascriptEngineDisabled() throws Exception { } } + /** + * @throws Exception if an error occurs + */ @Test public void changeType_javascriptDisabled() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "
\n" + "\n" + ""; diff --git a/src/test/java/org/htmlunit/html/HtmlInsertedTextTest.java b/src/test/java/org/htmlunit/html/HtmlInsertedTextTest.java index cb84bf182a2..01bc57879c6 100644 --- a/src/test/java/org/htmlunit/html/HtmlInsertedTextTest.java +++ b/src/test/java/org/htmlunit/html/HtmlInsertedTextTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,17 +15,14 @@ package org.htmlunit.html; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; /** * Tests for {@link HtmlInsertedText}. * * @author Marc Guillemot */ -@RunWith(BrowserRunner.class) public class HtmlInsertedTextTest extends WebDriverTestCase { /** @@ -35,7 +32,8 @@ public class HtmlInsertedTextTest extends WebDriverTestCase { @Test @Alerts({"abcdef", "abcdef"}) public void simple() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " abcdef\n" + " \n" @@ -133,8 +131,8 @@ public void testJavaScript() throws Exception { */ @Test public void formValues() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "
\n" + "
\n" + " \n" - + " \n" + + LOG_TEXTAREA + ""; final WebDriver driver = loadPage2(html); driver.findElement(By.id("opt3")).click(); - assertEquals(Arrays.asList(getExpectedAlerts()).toString(), - '[' + driver.findElement(By.id("myTextarea")).getAttribute("value") + ']'); + verifyTextArea2(driver, getExpectedAlerts()); } /** @@ -167,7 +162,8 @@ public void onMouse() throws Exception { */ @Test public void isSelected() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + + "" + " \n" + ""; @@ -190,7 +186,8 @@ public void isSelected() throws Exception { */ @Test public void isSelectedJavaScript() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; + final String html = DOCTYPE_HTML + ""; final String js = "alert('Hello there')"; @@ -119,8 +114,11 @@ public void save() throws Exception { final HtmlScript sript = page.getFirstByXPath("//script"); assertEquals(URL_SECOND.toString(), sript.getSrcAttribute()); - final File tmpFolder = tmpFolderProvider_.newFolder("hu"); + final File tmpFolder = new File(TEMP_DIR_.toFile(), "hu"); + tmpFolder.mkdir(); final File file = new File(tmpFolder, "hu_HtmlPageTest_save.html"); + FileUtils.deleteQuietly(file); + page.save(file); assertTrue(file.exists()); assertTrue(file.isFile()); @@ -135,7 +133,7 @@ public void save() throws Exception { */ @Test public void save_image() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; final URL url = getClass().getClassLoader().getResource("testfiles/tiny-jpg.img"); final WebClient webClient = getWebClientWithMockWebConnection(); @@ -150,9 +148,13 @@ public void save_image() throws Exception { final HtmlPage page = webClient.getPage(URL_FIRST); final HtmlImage img = page.getFirstByXPath("//img"); assertEquals(URL_SECOND.toString(), img.getSrcAttribute()); - final File tmpFolder = tmpFolderProvider_.newFolder("hu"); + final File tmpFolder = new File(TEMP_DIR_.toFile(), "hu"); + tmpFolder.mkdir(); final File file = new File(tmpFolder, "hu_HtmlPageTest_save2.html"); + FileUtils.deleteQuietly(file); final File imgFile = new File(tmpFolder, "hu_HtmlPageTest_save2/second.jpeg"); + FileUtils.deleteQuietly(imgFile); + page.save(file); assertTrue(file.exists()); assertTrue(file.isFile()); @@ -168,7 +170,7 @@ public void save_image() throws Exception { */ @Test public void save_imageNotImage() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; final MockWebConnection webConnection = getMockWebConnection(); @@ -176,13 +178,16 @@ public void save_imageNotImage() throws Exception { final HtmlPage page = loadPageWithAlerts(html); - final File folder = tmpFolderProvider_.newFolder("hu"); - final File file = new File(folder, "hu_save.html"); + final File tmpFolder = new File(TEMP_DIR_.toFile(), "hu"); + tmpFolder.mkdir(); + final File file = new File(tmpFolder, "hu_save.html"); + FileUtils.deleteQuietly(file); + page.save(file); assertTrue(file.exists()); assertTrue(file.isFile()); - final File imgFile = new File(folder, "hu_save/foo.txt"); + final File imgFile = new File(tmpFolder, "hu_save/foo.txt"); assertEquals("hello", FileUtils.readFileToString(imgFile, UTF_8)); } @@ -191,7 +196,7 @@ public void save_imageNotImage() throws Exception { */ @Test public void save_image_without_src() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; final WebClient webClient = getWebClientWithMockWebConnection(); final MockWebConnection webConnection = getMockWebConnection(); @@ -199,8 +204,11 @@ public void save_image_without_src() throws Exception { webConnection.setResponse(URL_FIRST, html); final HtmlPage page = webClient.getPage(URL_FIRST); - final File tmpFolder = tmpFolderProvider_.newFolder("hu"); + final File tmpFolder = new File(TEMP_DIR_.toFile(), "hu"); + tmpFolder.mkdir(); final File file = new File(tmpFolder, "hu_HtmlPageTest_save3.html"); + FileUtils.deleteQuietly(file); + page.save(file); assertTrue(file.exists()); assertTrue(file.isFile()); @@ -214,7 +222,7 @@ public void save_image_without_src() throws Exception { */ @Test public void save_image_empty_src() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; final WebClient webClient = getWebClientWithMockWebConnection(); final MockWebConnection webConnection = getMockWebConnection(); @@ -222,8 +230,11 @@ public void save_image_empty_src() throws Exception { webConnection.setResponse(URL_FIRST, html); final HtmlPage page = webClient.getPage(URL_FIRST); - final File tmpFolder = tmpFolderProvider_.newFolder("hu"); + final File tmpFolder = new File(TEMP_DIR_.toFile(), "hu"); + tmpFolder.mkdir(); final File file = new File(tmpFolder, "hu_HtmlPageTest_save3.html"); + FileUtils.deleteQuietly(file); + page.save(file); assertTrue(file.exists()); assertTrue(file.isFile()); @@ -237,20 +248,23 @@ public void save_image_empty_src() throws Exception { */ @Test public void save_frames() throws Exception { - final String mainContent - = "First\n" + final String mainContent = DOCTYPE_HTML + + "First\n" + "\n" + " \n" + " \n" + " \n" + "\n" + ""; - final String frameLeftContent = "Second\n" + final String frameLeftContent = DOCTYPE_HTML + + "Second\n" + "\n" + "\n" + ""; - final String frameRightContent = "Thirdframe right"; - final String iframeContent = "Iframeiframe"; + final String frameRightContent = DOCTYPE_HTML + + "Thirdframe right"; + final String iframeContent = DOCTYPE_HTML + + "Iframeiframe"; try (InputStream is = getClass().getClassLoader().getResourceAsStream("testfiles/tiny-jpg.img")) { final byte[] directBytes = IOUtils.toByteArray(is); @@ -270,12 +284,18 @@ public void save_frames() throws Exception { final HtmlPage page = webClient.getPage(URL_FIRST); final HtmlFrame leftFrame = page.getElementByName("left"); assertEquals(URL_SECOND.toString(), leftFrame.getSrcAttribute()); - final File tmpFolder = tmpFolderProvider_.newFolder("hu"); + final File tmpFolder = new File(TEMP_DIR_.toFile(), "hu"); + tmpFolder.mkdir(); final File file = new File(tmpFolder, "hu_HtmlPageTest_saveFrame.html"); + FileUtils.deleteQuietly(file); final File expectedLeftFrameFile = new File(tmpFolder, "hu_HtmlPageTest_saveFrame/second.html"); + FileUtils.deleteQuietly(expectedLeftFrameFile); final File expectedRightFrameFile = new File(tmpFolder, "hu_HtmlPageTest_saveFrame/third.html"); + FileUtils.deleteQuietly(expectedRightFrameFile); final File expectedIFrameFile = new File(tmpFolder, "hu_HtmlPageTest_saveFrame/second/iframe.html"); + FileUtils.deleteQuietly(expectedIFrameFile); final File expectedImgFile = new File(tmpFolder, "hu_HtmlPageTest_saveFrame/second/img.jpg"); + FileUtils.deleteQuietly(expectedImgFile); final File[] allFiles = {file, expectedLeftFrameFile, expectedImgFile, expectedIFrameFile, expectedRightFrameFile}; @@ -297,7 +317,8 @@ public void save_frames() throws Exception { */ @Test public void save_css() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; final String css = "body {color: blue}"; @@ -312,9 +333,13 @@ public void save_css() throws Exception { final HtmlLink cssLink = page.getFirstByXPath("//link"); assertEquals(URL_SECOND.toString(), cssLink.getHrefAttribute()); - final File tmpFolder = tmpFolderProvider_.newFolder("hu"); + final File tmpFolder = new File(TEMP_DIR_.toFile(), "hu"); + tmpFolder.mkdir(); final File file = new File(tmpFolder, "hu_HtmlPageTest_save4.html"); + FileUtils.deleteQuietly(file); final File cssFile = new File(tmpFolder, "hu_HtmlPageTest_save4/second.css"); + FileUtils.deleteQuietly(cssFile); + page.save(file); assertTrue(file.exists()); assertTrue(file.isFile()); @@ -328,7 +353,8 @@ public void save_css() throws Exception { */ @Test public void save_css_without_href() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; final WebClient webClient = getWebClientWithMockWebConnection(); @@ -337,8 +363,11 @@ public void save_css_without_href() throws Exception { webConnection.setResponse(URL_FIRST, html); final HtmlPage page = webClient.getPage(URL_FIRST); - final File tmpFolder = tmpFolderProvider_.newFolder("hu"); + final File tmpFolder = new File(TEMP_DIR_.toFile(), "hu"); + tmpFolder.mkdir(); final File file = new File(tmpFolder, "hu_HtmlPageTest_save5.html"); + FileUtils.deleteQuietly(file); + page.save(file); assertTrue(file.exists()); assertTrue(file.isFile()); @@ -352,7 +381,8 @@ public void save_css_without_href() throws Exception { */ @Test public void save_css_empty_href() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; final WebClient webClient = getWebClientWithMockWebConnection(); @@ -361,8 +391,11 @@ public void save_css_empty_href() throws Exception { webConnection.setResponse(URL_FIRST, html); final HtmlPage page = webClient.getPage(URL_FIRST); - final File tmpFolder = tmpFolderProvider_.newFolder("hu"); + final File tmpFolder = new File(TEMP_DIR_.toFile(), "hu"); + tmpFolder.mkdir(); final File file = new File(tmpFolder, "hu_HtmlPageTest_save5.html"); + FileUtils.deleteQuietly(file); + page.save(file); assertTrue(file.exists()); assertTrue(file.isFile()); @@ -380,19 +413,22 @@ public void save_css_empty_href() throws Exception { public void saveShouldStripLongFileNames() throws Exception { final RandomStringGenerator generator = new RandomStringGenerator.Builder().withinRange('a', 'z').get(); final String longName = generator.generate(500) + ".html"; - final String html = ""; + final String html = DOCTYPE_HTML + ""; final WebClient webClient = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); - webConnection.setDefaultResponse(""); + webConnection.setDefaultResponse(DOCTYPE_HTML + ""); webConnection.setResponse(URL_FIRST, html); webClient.setWebConnection(webConnection); final HtmlPage page = webClient.getPage(URL_FIRST); - final File tmpFolder = tmpFolderProvider_.newFolder("hu"); + final File tmpFolder = new File(TEMP_DIR_.toFile(), "hu"); + tmpFolder.mkdir(); final File file = new File(tmpFolder, "hu_HtmlPageTest_save.html"); + FileUtils.deleteQuietly(file); + page.save(file); assertTrue(file.exists()); assertTrue(file.isFile()); @@ -403,7 +439,8 @@ public void saveShouldStripLongFileNames() throws Exception { */ @Test public void serialization_attributeListenerLock() throws Exception { - final String html = "\n" + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/html/HtmlPageTest.java b/src/test/java/org/htmlunit/html/HtmlPageTest.java index 3b595f4be63..2b42eeaa2f1 100644 --- a/src/test/java/org/htmlunit/html/HtmlPageTest.java +++ b/src/test/java/org/htmlunit/html/HtmlPageTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ import static java.nio.charset.StandardCharsets.ISO_8859_1; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.junit.Assert.fail; import java.io.IOException; import java.net.MalformedURLException; @@ -49,14 +48,13 @@ import org.htmlunit.WebRequest; import org.htmlunit.WebResponse; import org.htmlunit.html.HtmlElementTest.HtmlAttributeChangeListenerTestImpl; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.htmlunit.util.Cookie; import org.htmlunit.util.MimeType; import org.htmlunit.util.NameValuePair; import org.htmlunit.util.StringUtils; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.w3c.dom.NodeList; /** @@ -72,7 +70,6 @@ * @author Frank Danek * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class HtmlPageTest extends SimpleWebTestCase { /** The doctype prefix for standards mode. */ @@ -84,7 +81,8 @@ public class HtmlPageTest extends SimpleWebTestCase { */ @Test public void formSubmit() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "

hello world

\n" @@ -124,7 +122,8 @@ public void formSubmit() throws Exception { */ @Test public void getElementByIdNull() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "

hello world

\n" @@ -140,7 +139,8 @@ public void getElementByIdNull() throws Exception { */ @Test public void getElementsByIdNull() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "

hello world

\n" @@ -158,7 +158,8 @@ public void getElementsByIdNull() throws Exception { */ @Test public void getElementsByIdOrNameNull() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "

hello world

\n" @@ -174,9 +175,10 @@ public void getElementsByIdOrNameNull() throws Exception { /** * @throws Exception if the test fails */ - @Test(expected = ElementNotFoundException.class) + @Test public void getElementByNameNull() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "

hello world

\n" @@ -184,7 +186,7 @@ public void getElementByNameNull() throws Exception { final HtmlPage page = loadPage(htmlContent); - assertNull(page.getElementByName(null)); + Assertions.assertThrows(ElementNotFoundException.class, () -> page.getElementByName(null)); } /** @@ -192,7 +194,8 @@ public void getElementByNameNull() throws Exception { */ @Test public void getElementsByNameNull() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "

hello world

\n" @@ -211,7 +214,8 @@ public void getElementsByNameNull() throws Exception { */ @Test public void getHtmlElement() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "

hello world

\n" @@ -277,7 +281,8 @@ public void getHtmlElement() throws Exception { */ @Test public void getAnchorByText() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " anchor text\n" @@ -299,7 +304,8 @@ public void getAnchorByText() throws Exception { */ @Test public void getTabbableElements_None() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "

hello world

\n" @@ -316,7 +322,8 @@ public void getTabbableElements_None() throws Exception { */ @Test public void getTabbableElements_OneEnabled_OneDisabled() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "

hello world

\n" @@ -336,7 +343,8 @@ public void getTabbableElements_OneEnabled_OneDisabled() throws Exception { */ @Test public void getTabbableElements() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "foo\n" @@ -372,7 +380,8 @@ public void getTabbableElements() throws Exception { */ @Test public void getHtmlElementByAccessKey() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "foo\n" @@ -396,7 +405,8 @@ public void getHtmlElementByAccessKey() throws Exception { */ @Test public void getHtmlElementsByAccessKey() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "foo\n" + "foo\n" @@ -416,7 +426,8 @@ public void getHtmlElementsByAccessKey() throws Exception { */ @Test public void getFullQualifiedUrl_NoBaseSpecified() throws Exception { - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "
row 1
row 2
\n" + ""; @@ -467,7 +478,8 @@ private void testGetFullQualifiedUrl_WithBase(final String baseProtocol, final S throws Exception { final String baseUrl = baseProtocol + "://second" + basePortPart; - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + "

\n" @@ -488,12 +500,12 @@ private void testGetFullQualifiedUrl_WithBase(final String baseProtocol, final S /** * @throws Exception if the test fails */ - @Test(expected = MalformedURLException.class) + @Test public void getFullQualifiedUrl_invalid() throws Exception { - final String htmlContent = ""; + final String htmlContent = DOCTYPE_HTML + ""; final HtmlPage page = loadPage(htmlContent); - page.getFullyQualifiedUrl("http://"); + Assertions.assertThrows(MalformedURLException.class, () -> page.getFullyQualifiedUrl("http://")); } /** @@ -501,7 +513,8 @@ public void getFullQualifiedUrl_invalid() throws Exception { */ @Test public void testBase_Multiple() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -536,7 +549,8 @@ public void notify(final String message, final Object origin) { */ @Test public void testBase_InsideBody() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " link\n" + ""; @@ -558,7 +572,8 @@ public void testBase_InsideBody() throws Exception { */ @Test public void onLoadHandler_BodyStatement() throws Exception { - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + ""; final List collectedAlerts = new ArrayList<>(); @@ -575,7 +590,8 @@ public void onLoadHandler_BodyStatement() throws Exception { */ @Test public void onLoadHandler_TwoBodyStatements() throws Exception { - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + ""; final List collectedAlerts = new ArrayList<>(); @@ -592,7 +608,8 @@ public void onLoadHandler_TwoBodyStatements() throws Exception { */ @Test public void onLoadHandler_BodyName() throws Exception { - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + ""; @@ -610,7 +627,8 @@ public void onLoadHandler_BodyName() throws Exception { */ @Test public void onLoadHandler_BodyName_NotAFunction() throws Exception { - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + ""; @@ -630,7 +648,8 @@ public void onLoadHandler_BodyName_NotAFunction() throws Exception { */ @Test public void onLoadHandler_ScriptName() throws Exception { - final String htmlContent = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + "

helloworld &amp; helloall

\n" @@ -1092,7 +1129,8 @@ public void asXml2() throws Exception { @Test public void asXml_unicode() throws Exception { final String unicodeString = "\u064A\u0627 \u0644\u064A\u064A\u0644"; - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "" + unicodeString + ""; @@ -1113,23 +1151,24 @@ public void asXml_unicode() throws Exception { */ @Test public void asXml_noscript() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + + "" + "" + "" + ""; - final String expected = "" - + "" - + " " - + " " + final String expected = "\r\n" + + "\r\n" + + " \r\n" + + " \r\n" + " " - + " " + + "<p><strong>your browser does not support JavaScript</strong></p>" + + "\r\n" + + " \r\n" + ""; final HtmlPage page = loadPage(html); - assertEquals(expected, page.asXml().replaceAll("[\\n\\r]", "")); + assertEquals(expected, page.asXml()); } /** @@ -1137,7 +1176,8 @@ public void asXml_noscript() throws Exception { */ @Test public void getElementsById() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + + "" + "
foo
" + "
" + "
" @@ -1163,7 +1203,8 @@ public void getElementsById() throws Exception { */ @Test public void getElementsByName() throws Exception { - final String html = "
foo
"; + final String html = DOCTYPE_HTML + + "
foo
"; final HtmlPage page = loadPage(html); assertEquals(1, page.getElementsByName("a").size()); assertEquals(2, page.getElementsByName("b").size()); @@ -1183,7 +1224,8 @@ public void getElementsByName() throws Exception { */ @Test public void getElementByName() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "
foo
\n" + "
bar
\n" + "
baz
"; @@ -1198,14 +1240,16 @@ public void getElementByName() throws Exception { /** * @exception Exception if the test fails */ - @Test(expected = ElementNotFoundException.class) + @Test public void getElementByNameNotfound() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "
foo
\n" + "
bar
\n" + "
baz
"; final HtmlPage page = loadPage(html); - page.getElementByName("c"); + + Assertions.assertThrows(ElementNotFoundException.class, () -> page.getElementByName("c")); } /** @@ -1213,8 +1257,9 @@ public void getElementByNameNotfound() throws Exception { */ @Test public void getHtmlElementsByIdAndOrName() throws Exception { - final String html = "
foo
bar
" - + "
bar
"; + final String html = DOCTYPE_HTML + + "
foo
bar
" + + "
bar
"; final HtmlPage page = loadPage(html); assertEquals(1, page.getElementsByIdAndOrName("a").size()); assertEquals(2, page.getElementsByIdAndOrName("b").size()); @@ -1236,8 +1281,8 @@ public void getHtmlElementsByIdAndOrName() throws Exception { */ @Test public void getHtmlElementByIdAfterRemove() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "
\n" + "
\n" @@ -1252,7 +1297,7 @@ public void getHtmlElementByIdAfterRemove() throws Exception { div1.remove(); try { page.getHtmlElementById("div1"); // throws if not found - fail("div1 should have been removed"); + Assertions.fail("div1 should have been removed"); } catch (final ElementNotFoundException e) { // nothing @@ -1260,7 +1305,7 @@ public void getHtmlElementByIdAfterRemove() throws Exception { try { page.getHtmlElementById("div2"); // throws if not found - fail("div2 should have been removed"); + Assertions.fail("div2 should have been removed"); } catch (final ElementNotFoundException e) { // nothing @@ -1274,8 +1319,8 @@ public void getHtmlElementByIdAfterRemove() throws Exception { */ @Test public void getHtmlElementById_idTwice() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "
foo
\n" + "bla\n" @@ -1296,7 +1341,8 @@ public void getHtmlElementById_idTwice() throws Exception { @Test @Alerts("webm=none") public void setCookieMetaTag() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -1325,12 +1371,12 @@ public void noSlashURL() throws Exception { } private void testNoSlashURL(final String url) throws Exception { - final String firstContent - = "\n" + final String firstContent = DOCTYPE_HTML + + "\n" + "\n" + ""; - final String secondContent = ""; + final String secondContent = DOCTYPE_HTML + ""; final WebClient client = getWebClient(); final URL secondURL = new URL("http://second/"); @@ -1360,7 +1406,7 @@ public void metaTagWithEmptyURL() throws Exception { private int nbCalls_ = 0; @Override public WebResponse getResponse(final WebRequest request) throws IOException { - String content = "\n"; + String content = DOCTYPE_HTML + "\n"; if (nbCalls_ == 0) { content += "\n"; } @@ -1387,8 +1433,8 @@ public void serialization() throws Exception { // The document.all and form.elements calls are important because they trigger the creation // of HTMLCollections, which have caused serialization problems in the past (see bug #606). - final String content = - "\n" + final String content = DOCTYPE_HTML + + "\n" + "
Hello there!
\n" + "\n" @@ -1465,8 +1511,8 @@ public void serializationLambda() throws Exception { */ @Test public void serializationStaticDomNodeList() throws Exception { - final String content = - "\n" + final String content = DOCTYPE_HTML + + "\n" + "
Hello there!
\n" + "\n" + "\n" @@ -1495,7 +1541,8 @@ public void serializationStaticDomNodeList() throws Exception { */ @Test public void clonedPageHasOwnIdMap() throws Exception { - final String content = "foo" + final String content = DOCTYPE_HTML + + "foo" + "" + "
" + ""; @@ -1516,7 +1563,7 @@ public void clonedPageHasOwnIdMap() throws Exception { page.getHtmlElementById("id2").remove(); try { page.getHtmlElementById("id2"); - fail("should have thrown ElementNotFoundException"); + Assertions.fail("should have thrown ElementNotFoundException"); } catch (final ElementNotFoundException expected) { } @@ -1529,7 +1576,8 @@ public void clonedPageHasOwnIdMap() throws Exception { */ @Test public void clonedPageHasOwnDocumentElement() throws Exception { - final String content = "foo\n" + final String content = DOCTYPE_HTML + + "foo\n" + "\n" + "
\n" + ""; @@ -1547,8 +1595,8 @@ public void clonedPageHasOwnDocumentElement() throws Exception { */ @Test public void htmlAttributeChangeListener_AddAttribute() throws Exception { - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + ""; @@ -1852,8 +1906,8 @@ public void srcJavaScript() throws Exception { */ @Test public void asNormalizedText() throws Exception { - final String htmlContent - = "test\n" + final String htmlContent = DOCTYPE_HTML + + "test\n" + "\n" + "\n" + "
a
"; @@ -1867,8 +1921,8 @@ public void asNormalizedText() throws Exception { */ @Test public void getElementsByTagName() throws Exception { - final String firstContent - = "First\n" + final String firstContent = DOCTYPE_HTML + + "First\n" + "\n" + "
\n" + "
a
b
c
\n" @@ -1907,8 +1961,8 @@ public void getElementsByTagName() throws Exception { */ @Test public void readyState() throws Exception { - final String htmlContent - = "test\n" + final String htmlContent = DOCTYPE_HTML + + "test\n" + "\n" + "\n" + "
a
"; @@ -1922,7 +1976,8 @@ public void readyState() throws Exception { */ @Test public void cloneNode() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "

hello world

\n" @@ -1938,16 +1993,16 @@ public void cloneNode() throws Exception { */ @Test public void cloneHtmlPageWithFrame() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "
" + " " + "
" + ""; - final String frameContent = - "\n" + final String frameContent = DOCTYPE_HTML + + "\n" + "\n" + "" + "

frame1

" @@ -2024,8 +2079,8 @@ public void addAutoCloseableNull() throws Exception { */ @Test public void getBaseUrl() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "body\n" + ""; diff --git a/src/test/java/org/htmlunit/html/HtmlPageTest5.java b/src/test/java/org/htmlunit/html/HtmlPageTest5.java index 6e8ef8b7dd4..fc0447289de 100644 --- a/src/test/java/org/htmlunit/html/HtmlPageTest5.java +++ b/src/test/java/org/htmlunit/html/HtmlPageTest5.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,17 +18,14 @@ import java.util.List; import org.htmlunit.SimpleWebTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; /** * Tests for {@link HtmlPage}. * * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class HtmlPageTest5 extends SimpleWebTestCase { /** * Test tabbing to the next element. @@ -37,7 +34,8 @@ public class HtmlPageTest5 extends SimpleWebTestCase { @Test @Alerts({"focus-0", "blur-0", "focus-1", "blur-1", "focus-2"}) public void tabNext() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "First\n" + "\n" + "\n" @@ -69,7 +67,8 @@ public void tabNext() throws Exception { @Test @Alerts({"focus-2", "blur-2", "focus-1", "blur-1", "focus-0"}) public void tabPrevious() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "First\n" + "\n" + "\n" @@ -100,7 +99,8 @@ public void tabPrevious() throws Exception { */ @Test public void keyboard_NoTabbableElements() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "First\n" + "\n" + "\n" @@ -138,7 +138,8 @@ public void keyboard_NoTabbableElements() throws Exception { @Test @Alerts({"focus-0", "blur-0", "focus-0"}) public void keyboard_OneTabbableElement() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "First\n" + "\n" + "\n" @@ -184,7 +185,8 @@ public void keyboard_OneTabbableElement() throws Exception { @Test @Alerts({"focus-0", "blur-0", "focus-2", "blur-2", "focus-1"}) public void accessKeys() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "First\n" + "\n" + "\n" @@ -216,7 +218,8 @@ public void accessKeys() throws Exception { @Test @Alerts("buttonPushed") public void pressAccessKey_Button() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "First\n" + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/html/HtmlParagraphTest.java b/src/test/java/org/htmlunit/html/HtmlParagraphTest.java index 9a453a88ab2..eae9a4ba6c8 100644 --- a/src/test/java/org/htmlunit/html/HtmlParagraphTest.java +++ b/src/test/java/org/htmlunit/html/HtmlParagraphTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,16 +15,14 @@ package org.htmlunit.html; import org.htmlunit.SimpleWebTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Tests for {@link HtmlParagraph}. * * @author Marc Guillemot + * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class HtmlParagraphTest extends SimpleWebTestCase { /** @@ -32,13 +30,14 @@ public class HtmlParagraphTest extends SimpleWebTestCase { */ @Test public void asXml_emptyTag() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "

\n" + ""; final HtmlPage page = loadPage(html); final HtmlElement element = page.getHtmlElementById("foo"); - assertTrue(element.asXml().contains("

")); + assertEquals("

", element.asXml()); } /** @@ -46,7 +45,8 @@ public void asXml_emptyTag() throws Exception { */ @Test public void asNormalizedText_getTextContent() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "

\n" + "

abc

\n" + "

$24.43

\n" diff --git a/src/test/java/org/htmlunit/html/HtmlParameterTest.java b/src/test/java/org/htmlunit/html/HtmlParameterTest.java index 86f393ac434..d919fc6f996 100644 --- a/src/test/java/org/htmlunit/html/HtmlParameterTest.java +++ b/src/test/java/org/htmlunit/html/HtmlParameterTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,8 @@ package org.htmlunit.html; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; import org.openqa.selenium.WebDriver; import org.openqa.selenium.htmlunit.HtmlUnitDriver; @@ -28,7 +26,6 @@ * @author Ahmed Ashour * @author Frank Danek */ -@RunWith(BrowserRunner.class) public class HtmlParameterTest extends WebDriverTestCase { /** @@ -37,7 +34,8 @@ public class HtmlParameterTest extends WebDriverTestCase { @Test @Alerts("[object HTMLParamElement]") public void simpleScriptable() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -138,7 +149,8 @@ public void typeDoesNotChangeValueAttribute() throws Exception { @Test @Alerts({"HtmlUnit", "HtmlUnit"}) public void typeDoesNotChangeValueAttributeWithInitialValue() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -165,8 +177,8 @@ public void typeDoesNotChangeValueAttributeWithInitialValue() throws Exception { */ @Test public void preventDefault_OnKeyDown() throws Exception { - final String html = - "\n" + "\n" + "\n" @@ -256,8 +272,8 @@ public void typeOnChange() throws Exception { */ @Test public void setValueOnChange() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -283,8 +299,8 @@ public void setValueOnChange() throws Exception { */ @Test public void setDefaultValueOnChange() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " \n" + "\n" + "\n" + "
\n" + "Check me\n" + + " onchange='log(\"foo\");log(event.type);'>Check me\n" + "
\n" - + "\n" + + LOG_TEXTAREA + ""; final WebDriver driver = loadPage2(html); driver.findElement(By.id("radio")).click(); - assertEquals(Arrays.asList(getExpectedAlerts()).toString(), - '[' + driver.findElement(By.id("myTextarea")).getAttribute("value") + ']'); + verifyTextArea2(driver, getExpectedAlerts()); } /** * @throws Exception if the test fails */ @Test - @Alerts("foo,change,boo,blur,") + @Alerts({"foo", "change", "boo", "blur"}) public void onchangeFires2() throws Exception { - final String html = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "foo\n" + "\n" + "\n" + "
\n" + "Check Me\n" + "Or Check Me\n" + "
\n" - + "\n" + + LOG_TEXTAREA + ""; final WebDriver driver = loadPage2(html); driver.findElement(By.id("radio1")).click(); driver.findElement(By.id("radio2")).click(); - assertEquals(Arrays.asList(getExpectedAlerts()).toString(), - '[' + driver.findElement(By.id("myTextarea")).getAttribute("value") + ']'); + verifyTextArea2(driver, getExpectedAlerts()); } /** @@ -606,16 +589,15 @@ public void onchangeFires2() throws Exception { @Test @Alerts("Second") public void setChecked() throws Exception { - final String firstHtml = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String firstHtml = DOCTYPE_HTML + "First\n" + "
\n" + "\n" + "
\n" + ""; - final String secondHtml - = "Second"; + final String secondHtml = DOCTYPE_HTML + + "Second"; getMockWebConnection().setDefaultResponse(secondHtml); final WebDriver driver = loadPage2(firstHtml); @@ -630,8 +612,7 @@ public void setChecked() throws Exception { @Test @Alerts("Second") public void setChecked2() throws Exception { - final String firstHtml = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String firstHtml = DOCTYPE_HTML + "First\n" + "
\n" + "\n" + "
\n" + ""; - final String secondHtml - = "Second"; + final String secondHtml = DOCTYPE_HTML + + "Second"; getMockWebConnection().setDefaultResponse(secondHtml); final WebDriver driver = loadPage2(firstHtml); @@ -654,8 +635,7 @@ public void setChecked2() throws Exception { */ @Test public void preventDefault() throws Exception { - final String html = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + ""; loadPageVerifyTitle2(html); @@ -103,7 +101,8 @@ public void addedFromDocumentFragment() throws Exception { @Test @Alerts("[object HTMLScriptElement]") public void simpleScriptable() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -476,8 +483,8 @@ public void setTextMultipleTextNodes() throws Exception { @Test @Alerts({"1", "2", "3"}) public void settingSrcAttribute() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n" @@ -570,7 +914,7 @@ public void addEventListener_NoContent() throws Exception { + ""; getMockWebConnection().setResponse(scriptUrl, (String) null, - HttpStatus.NO_CONTENT_204, HttpStatus.NO_CONTENT_204_MSG, MimeType.TEXT_JAVASCRIPT, null); + statusCode, "test", MimeType.TEXT_JAVASCRIPT, null); loadPageVerifyTitle2(html); } @@ -580,7 +924,8 @@ public void addEventListener_NoContent() throws Exception { */ @Test public void badSrcUrl() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -594,7 +939,7 @@ public void badSrcUrl() throws Exception { */ @Test public void invalidJQuerySrcAttribute() throws Exception { - loadPage2(""); + loadPage2(DOCTYPE_HTML + ""); } /** @@ -603,8 +948,8 @@ public void invalidJQuerySrcAttribute() throws Exception { @Test @Alerts({"loaded", "§§URL§§abcd"}) public void lineBreaksInUrl() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" @@ -626,8 +971,8 @@ public void lineBreaksInUrl() throws Exception { @Alerts({"\u0623\u0647\u0644\u0627\u064b\u0623\u0647\u0644\u0627" + "\u064b\u0623\u0647\u0644\u0627\u064b\u0623\u0647\u0644\u0627\u064b", "§§URL§§"}) public void incorrectCharset() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" @@ -684,8 +1029,8 @@ public void onLoadOnErrorWithoutType() throws Exception { } private void onLoadOnError(final String attribs) throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " " + "" + "abc"; @@ -878,7 +1224,8 @@ public void whitespaceInSrc() throws Exception { @Test @Alerts({"loaded", "§§URL§§"}) public void controlCharsInSrc() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + + "" + " " + "" + "abc"; @@ -900,7 +1247,8 @@ public void tabCharInSrc() throws Exception { String url = URL_SECOND.toExternalForm(); url = url.replace("http", "http\t"); - final String html = "" + final String html = DOCTYPE_HTML + + "" + " " + "" + "abc"; @@ -918,8 +1266,8 @@ public void tabCharInSrc() throws Exception { */ @Test public void emptySrc() throws Exception { - final String html1 = "abc"; - final String html2 = "abc"; + final String html1 = DOCTYPE_HTML + "abc"; + final String html2 = DOCTYPE_HTML + "abc"; loadPageWithAlerts2(html1); loadPageWithAlerts2(html2); @@ -932,7 +1280,7 @@ public void emptySrc() throws Exception { */ @Test public void noContent() throws Exception { - final String html = "\n"; @@ -965,7 +1314,8 @@ public void srcAndContent() throws Exception { */ @Test public void emptySrcAndContent() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n"; @@ -981,7 +1331,8 @@ public void emptySrcAndContent() throws Exception { */ @Test public void blankSrcAndContent() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n"; @@ -997,7 +1348,8 @@ public void blankSrcAndContent() throws Exception { */ @Test public void attribSrcAndContent() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n"; @@ -1015,7 +1367,8 @@ public void attribSrcAndContent() throws Exception { @Test @Alerts({"first script", "second script"}) public void content() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n" + " \n"; diff --git a/src/test/java/org/htmlunit/html/HtmlScriptTest.java b/src/test/java/org/htmlunit/html/HtmlScriptTest.java index 0af1a8d983a..1102b035156 100644 --- a/src/test/java/org/htmlunit/html/HtmlScriptTest.java +++ b/src/test/java/org/htmlunit/html/HtmlScriptTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ */ package org.htmlunit.html; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.net.URL; import java.util.ArrayList; @@ -25,11 +25,9 @@ import org.htmlunit.MockWebConnection; import org.htmlunit.SimpleWebTestCase; import org.htmlunit.WebClient; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.htmlunit.util.MimeType; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Tests for {@link HtmlScript}. @@ -39,7 +37,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class HtmlScriptTest extends SimpleWebTestCase { /** @@ -52,7 +49,8 @@ public class HtmlScriptTest extends SimpleWebTestCase { */ @Test public void badExternalScriptReference() throws Exception { - final String html = "foo\n" + final String html = DOCTYPE_HTML + + "foo\n" + "\n" + ""; @@ -89,7 +87,7 @@ public void badExternalScriptReference() throws Exception { */ @Test public void asNormalizedText() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; final HtmlPage page = loadPage(html); final HtmlScript script = page.getHtmlElementById("s"); assertEquals("", script.asNormalizedText()); @@ -101,8 +99,8 @@ public void asNormalizedText() throws Exception { @Test @Alerts("hello") public void asXml() throws Exception { - final String html - = "foo\n" + final String html = DOCTYPE_HTML + + "foo\n" + ""; @@ -111,6 +109,23 @@ public void asXml() throws Exception { // asXml() should be reusable final String xml = page.asXml(); + assertEquals("\r\n" + + "\r\n" + + " \r\n" + + " foo\r\n" + + " \r\n" + + " \r\n" + + " \r\n" + + " \r\n" + + "", + xml); + loadPageWithAlerts(xml); } @@ -122,10 +137,10 @@ public void asXml_scriptNestedInCData() throws Exception { final String script = "//"; - final String html = ""; + final String html = DOCTYPE_HTML + ""; final HtmlPage page = loadPage(html); final HtmlScript scriptElement = page.getHtmlElementById("s"); - assertEquals("\r\n", + assertEquals("", scriptElement.asXml()); } @@ -136,7 +151,7 @@ public void asXml_scriptNestedInCData() throws Exception { @Test @Alerts("loaded") public void scriptCloneDoesNotReloadScript() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; final String js = "alert('loaded')"; final WebClient client = getWebClient(); @@ -178,8 +193,8 @@ public void addEventListener_error_clientDoesNotThrow() throws Exception { private void addEventListener_error(final boolean throwOnFailingStatusCode) throws Exception { final URL fourOhFour = new URL(URL_FIRST, "/404"); - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; + final String html = DOCTYPE_HTML + + "Page A"; final HtmlPage page = loadPageWithAlerts(html); final HtmlScript script = page.getFirstByXPath("//script"); assertFalse(script.isDisplayed()); @@ -250,16 +267,16 @@ public void isDisplayed() throws Exception { @Test @Alerts({"First script executes", "Second page loading"}) public void changingLocationSkipsFurtherScriptsOnPage() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" + "\n" + ""; - final String secondPage - = "\n" + final String secondPage = DOCTYPE_HTML + + "\n" + "\n" + ""; diff --git a/src/test/java/org/htmlunit/html/HtmlSearchInput2Test.java b/src/test/java/org/htmlunit/html/HtmlSearchInput2Test.java index f7345fd6280..b326763fc51 100644 --- a/src/test/java/org/htmlunit/html/HtmlSearchInput2Test.java +++ b/src/test/java/org/htmlunit/html/HtmlSearchInput2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,8 @@ package org.htmlunit.html; import org.htmlunit.SimpleWebTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; /** * Tests for {@link HtmlSearchInput}. @@ -26,7 +24,6 @@ * @author Anton Demydenko * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class HtmlSearchInput2Test extends SimpleWebTestCase { /** @@ -34,8 +31,8 @@ public class HtmlSearchInput2Test extends SimpleWebTestCase { */ @Test public void patternValidation() throws Exception { - final String htmlContent - = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "
\n" @@ -64,7 +61,8 @@ public void patternValidation() throws Exception { @Test @Alerts({"true", "true", "true", "", "foo"}) public void maxLengthValidation() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -91,7 +89,8 @@ public void maxLengthValidation() throws Exception { @Test @Alerts({"true", "false", "true", "", "foobar"}) public void minLengthValidation() throws Exception { - final String htmlContent = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/html/HtmlSearchInputTest.java b/src/test/java/org/htmlunit/html/HtmlSearchInputTest.java index cb42e122ae2..886de4fa1ad 100644 --- a/src/test/java/org/htmlunit/html/HtmlSearchInputTest.java +++ b/src/test/java/org/htmlunit/html/HtmlSearchInputTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,8 @@ package org.htmlunit.html; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; @@ -31,8 +29,7 @@ * @author Marc Guillemot * @author Anton Demydenko * @author Ronald Brill -*/ -@RunWith(BrowserRunner.class) + */ public class HtmlSearchInputTest extends WebDriverTestCase { /** @@ -40,26 +37,40 @@ public class HtmlSearchInputTest extends WebDriverTestCase { */ @Test public void type() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; final WebDriver webDriver = loadPage2(html); final WebElement input = webDriver.findElement(By.id("t")); + input.sendKeys("abc"); - assertEquals("abc", input.getAttribute("value")); + assertNull(input.getDomAttribute("value")); + assertEquals("abc", input.getDomProperty("value")); + input.sendKeys(Keys.BACK_SPACE); - assertEquals("ab", input.getAttribute("value")); + assertNull(input.getDomAttribute("value")); + assertEquals("ab", input.getDomProperty("value")); + input.sendKeys(Keys.BACK_SPACE); - assertEquals("a", input.getAttribute("value")); + assertNull(input.getDomAttribute("value")); + assertEquals("a", input.getDomProperty("value")); + input.sendKeys(Keys.BACK_SPACE); - assertEquals("", input.getAttribute("value")); + assertNull(input.getDomAttribute("value")); + assertEquals("", input.getDomProperty("value")); + input.sendKeys(Keys.BACK_SPACE); - assertEquals("", input.getAttribute("value")); + assertNull(input.getDomAttribute("value")); + assertEquals("", input.getDomProperty("value")); } + /** + * @throws Exception if an error occurs + */ @Test @Alerts({"--null", "--null", "--null"}) public void defaultValuesAfterClone() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "" @@ -276,8 +294,8 @@ public void typeOnChange() throws Exception { */ @Test public void setValueOnChange() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " \n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " \n" + "\n" + "\n" @@ -680,7 +701,7 @@ public void objectInsideLabel() throws Exception { + " log(tmp.tagName);\n" + " tmp = tmp.firstChild.tagName;\n" + " log(tmp);\n" - + "} catch(e) { log('exception'); }\n" + + "} catch(e) { logEx(e); }\n" + "}\n" + "\n" + "\n" @@ -843,7 +864,7 @@ public void ieConditionalCommentsNotInDom() throws Exception { + " log(tmp.innerHTML);\n" + " tmp = document.getElementById('my2');\n" + " log(tmp.innerHTML);\n" - + "} catch(e) { log('exception'); }\n" + + "} catch(e) { logEx(e); }\n" + "}\n" + "\n" + "\n" @@ -977,7 +998,7 @@ public void selfClosingIframe() throws Exception { + " log(child2.nodeName);\n" + " log(child2.nodeValue);\n" - + "} catch(e) { log('exception'); }\n" + + "} catch(e) { logEx(e); }\n" + "}\n" + "\n" + "\n" @@ -1015,7 +1036,7 @@ public void dlShouldCloseDt() throws Exception { + " var child2 = child.childNodes[0];\n" + " log(child2.childNodes.length + '-' + child2.nodeType + '#' +child2.nodeName);\n" - + "} catch(e) { log('exception'); }\n" + + "} catch(e) { logEx(e); }\n" + "}\n" + "\n" + "\n" @@ -1047,7 +1068,7 @@ public void innerHtmlParagraph() throws Exception { + " var child = tmp.childNodes[0];\n" + " log(child.childNodes.length + '-' + child.nodeType + '#' + child.nodeName);\n" - + "} catch(e) { log('exception'); }\n" + + "} catch(e) { logEx(e); }\n" + "}\n" + "\n" + "\n" @@ -1080,7 +1101,7 @@ public void styleInsideP() throws Exception { + " tmp = tmp.nextSibling;\n" + " log(tmp.textContent);\n" - + "} catch(e) { log('exception'); }\n" + + "} catch(e) { logEx(e); }\n" + "}\n" + "\n" + "\n" @@ -1107,7 +1128,7 @@ public void styleInsideTable() throws Exception { + " tmp = tmp.firstChild;\n" + " log(tmp.tagName);\n" - + "} catch(e) { log('exception'); }\n" + + "} catch(e) { logEx(e); }\n" + "}\n" + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/html/parser/HTMLParser3Test.java b/src/test/java/org/htmlunit/html/parser/HTMLParser3Test.java index 15461a76ce6..9477bba8f6c 100644 --- a/src/test/java/org/htmlunit/html/parser/HTMLParser3Test.java +++ b/src/test/java/org/htmlunit/html/parser/HTMLParser3Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,10 +32,8 @@ import org.htmlunit.WebClient; import org.htmlunit.WebServerTestCase; import org.htmlunit.html.HtmlPage; -import org.htmlunit.junit.BrowserRunner; import org.htmlunit.util.MimeType; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Test class for {@link HTMLParser}. @@ -45,7 +43,6 @@ * @author Ahmed Ashour * @author Sudhan Moghe */ -@RunWith(BrowserRunner.class) public class HTMLParser3Test extends WebServerTestCase { /** diff --git a/src/test/java/org/htmlunit/html/parser/HTMLParser4Test.java b/src/test/java/org/htmlunit/html/parser/HTMLParser4Test.java index 83e73e4de48..493a2d336f7 100644 --- a/src/test/java/org/htmlunit/html/parser/HTMLParser4Test.java +++ b/src/test/java/org/htmlunit/html/parser/HTMLParser4Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,12 +16,9 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.html.HtmlPageTest; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; -import org.htmlunit.junit.BrowserRunner.NotYetImplemented; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; +import org.junit.jupiter.api.Test; import org.openqa.selenium.WebDriver; /** @@ -34,7 +31,6 @@ * @author Frank Danek * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class HTMLParser4Test extends WebDriverTestCase { /** @@ -169,7 +165,14 @@ public void badlyFormedHTML_scriptBeforeDoctype() throws Exception { @Test @Alerts({"4", "[object HTMLParagraphElement]", "[object Text]", "[object HTMLScriptElement]", "[object Text]"}) - @NotYetImplemented + @HtmlUnitNYI(CHROME = {"3", "[object HTMLParagraphElement]", "[object HTMLScriptElement]", + "[object Text]", "undefined"}, + EDGE = {"3", "[object HTMLParagraphElement]", "[object HTMLScriptElement]", + "[object Text]", "undefined"}, + FF = {"3", "[object HTMLParagraphElement]", "[object HTMLScriptElement]", + "[object Text]", "undefined"}, + FF_ESR = {"3", "[object HTMLParagraphElement]", "[object HTMLScriptElement]", + "[object Text]", "undefined"}) public void badlyFormedHTML_scriptAfterHtml() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + "\n" @@ -367,7 +370,7 @@ public void namespace2() throws Exception { + " try {\n" + " div = document.createElementNS('http://www.appcelerator.org', 'app:script');\n" + " debug(div);\n" - + " } catch (e) {log('createElementNS() is not defined')}\n" + + " } catch(e) {log('createElementNS() is not defined')}\n" + " debug(document.getElementById('script1'));\n" + " debug(document.getElementById('script2'));\n" + " }\n" @@ -710,7 +713,10 @@ public void setCompleteHtmlToDIV2_innerHTML() throws Exception { */ @Test @Alerts({"titles", "HEAD", "Inner Html", "misc", "true", "BODY"}) - @NotYetImplemented + @HtmlUnitNYI(CHROME = {"titles", "HTML", "Inner Html", "misc", "false", "HTML"}, + EDGE = {"titles", "HTML", "Inner Html", "misc", "false", "HTML"}, + FF = {"titles", "HTML", "Inner Html", "misc", "false", "HTML"}, + FF_ESR = {"titles", "HTML", "Inner Html", "misc", "false", "HTML"}) // currently the content of HEAD and BODY are added directly to HTML public void setCompleteHtmlToHTML_innerHTML() throws Exception { final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ @@ -743,7 +749,7 @@ public void setCompleteHtmlToHTML_innerHTML() throws Exception { + " document.getElementsByTagName('html')[0].innerHTML =" + " 'Inner Html" + "
Inner DIV
';\n" - + " } catch(e) { log('exception') }\n" + + " } catch(e) { logEx(e) }\n" + " \n" + "\n" + "\n"; diff --git a/src/test/java/org/htmlunit/html/parser/HTMLParser5Test.java b/src/test/java/org/htmlunit/html/parser/HTMLParser5Test.java index 5bb2cfdc7f7..998600327c5 100644 --- a/src/test/java/org/htmlunit/html/parser/HTMLParser5Test.java +++ b/src/test/java/org/htmlunit/html/parser/HTMLParser5Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,8 @@ package org.htmlunit.html.parser; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; import org.openqa.selenium.JavascriptExecutor; /** @@ -27,7 +25,6 @@ * @author Atsushi Nakagawa * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class HTMLParser5Test extends WebDriverTestCase { private static final String LOG_INPUT_FORMS = @@ -38,6 +35,9 @@ public class HTMLParser5Test extends WebDriverTestCase { + " log(inp.id + '-' + (f?f.name:null))" + "}"; + /** + * @throws Exception if the test fails + */ @Test @Alerts({"i1-f1", "i2-f2"}) public void formEnclosure_table() throws Exception { @@ -62,6 +62,9 @@ public void formEnclosure_table() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts({"i1-f1", "i2-f2"}) public void formEnclosure_div() throws Exception { @@ -86,6 +89,9 @@ public void formEnclosure_div() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts({"i1-f1", "i2-f1"}) public void formEnclosure_table_nestedForms() throws Exception { @@ -110,6 +116,9 @@ public void formEnclosure_table_nestedForms() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts({"i1-f1", "i2-f1"}) public void formEnclosure_div_nestedForms() throws Exception { @@ -134,6 +143,9 @@ public void formEnclosure_div_nestedForms() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts({"i1-f1", "i2-f1", "i3-null", "i4-null"}) public void formEnclosure_nestedForms() throws Exception { @@ -156,6 +168,9 @@ public void formEnclosure_nestedForms() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts({"i1-f1", "i2-f1", "i3-f1", "i4-f1", "i5-f1", "i6-f1", "i7-null"}) public void formEnclosure_tree1() throws Exception { @@ -189,6 +204,9 @@ public void formEnclosure_tree1() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts({"i1-f1", "i2-f1", "i3-f1", "i4-f2", "i5-f2", "i6-f2", "i7-f1", "i8-null"}) public void formEnclosure_tree2() throws Exception { @@ -223,6 +241,9 @@ public void formEnclosure_tree2() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts({"i1-f1", "i2-null"}) public void formEnclosure_tree3() throws Exception { @@ -243,6 +264,9 @@ public void formEnclosure_tree3() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("xy
") public void unclosedForm() throws Exception { diff --git a/src/test/java/org/htmlunit/html/parser/HTMLParser6Test.java b/src/test/java/org/htmlunit/html/parser/HTMLParser6Test.java index 6b5e04f3e6c..30afea64907 100644 --- a/src/test/java/org/htmlunit/html/parser/HTMLParser6Test.java +++ b/src/test/java/org/htmlunit/html/parser/HTMLParser6Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,18 +15,14 @@ package org.htmlunit.html.parser; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; /** * Test class for {@link HTMLParser}. * * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class HTMLParser6Test extends WebDriverTestCase { /** @@ -108,11 +104,7 @@ public void fragmentParserHtmlInsideSelect() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "", - FF = "", - FF_ESR = "") - @HtmlUnitNYI(CHROME = "", - EDGE = "") + @Alerts("") public void fragmentParserHtmlInsideOption() throws Exception { final String fragment = ""; final String html = "\n" @@ -132,4 +124,79 @@ public void fragmentParserHtmlInsideOption() throws Exception { loadPageVerifyTitle2(html); } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("
xy
") + public void fragmentParserLtInAttributeName() throws Exception { + final String fragment = "
xy
"; + final String html = "\n" + + "\n" + + "
\n" + + ""; + + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("
xy
") + public void fragmentParserLtFirstInAttributeName() throws Exception { + final String fragment = "
xy
"; + final String html = "\n" + + "\n" + + "
\n" + + ""; + + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("
xy
") + public void fragmentParserNumericAttributeName() throws Exception { + final String fragment = "
xy
"; + final String html = "\n" + + "\n" + + "
\n" + + ""; + + loadPageVerifyTitle2(html); + } } diff --git a/src/test/java/org/htmlunit/html/parser/HTMLParserListenerTest.java b/src/test/java/org/htmlunit/html/parser/HTMLParserListenerTest.java index 016c4e42fd2..263d8f1bb91 100644 --- a/src/test/java/org/htmlunit/html/parser/HTMLParserListenerTest.java +++ b/src/test/java/org/htmlunit/html/parser/HTMLParserListenerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,9 +24,7 @@ import org.htmlunit.SimpleWebTestCase; import org.htmlunit.WebClient; import org.htmlunit.html.HtmlPage; -import org.htmlunit.junit.BrowserRunner; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Test class for {@link HTMLParserListener}. @@ -37,7 +35,6 @@ * @author Marc Guillemot * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class HTMLParserListenerTest extends SimpleWebTestCase { static class MessageInfo { private boolean error_; // versus warning @@ -67,7 +64,9 @@ static class MessageInfo { // ignore key } - /** @see Object#toString() */ + /** + * @see Object#toString() + */ @Override public String toString() { return message_ + " (" + url_ + " " + line_ + ":" + column_ + ")"; diff --git a/src/test/java/org/htmlunit/html/parser/HTMLParserTest.java b/src/test/java/org/htmlunit/html/parser/HTMLParserTest.java index 57dcd694f22..0eedf305c4c 100644 --- a/src/test/java/org/htmlunit/html/parser/HTMLParserTest.java +++ b/src/test/java/org/htmlunit/html/parser/HTMLParserTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,9 +27,7 @@ import org.htmlunit.html.HtmlPageTest; import org.htmlunit.html.HtmlTableColumnGroup; import org.htmlunit.html.XHtmlPage; -import org.htmlunit.junit.BrowserRunner; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Test class for {@link HTMLParser}. @@ -40,7 +38,6 @@ * @author Sudhan Moghe * @author Frank Danek */ -@RunWith(BrowserRunner.class) public class HTMLParserTest extends SimpleWebTestCase { /** diff --git a/src/test/java/org/htmlunit/html/parser/MalformedHtml2Test.java b/src/test/java/org/htmlunit/html/parser/MalformedHtml2Test.java index 7f487dc2433..62854c6349c 100644 --- a/src/test/java/org/htmlunit/html/parser/MalformedHtml2Test.java +++ b/src/test/java/org/htmlunit/html/parser/MalformedHtml2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,9 +16,7 @@ import org.htmlunit.SimpleWebTestCase; import org.htmlunit.html.HtmlPage; -import org.htmlunit.junit.BrowserRunner; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Set of tests for ill formed HTML code. @@ -26,7 +24,6 @@ * @author Sudhan Moghe * @author Ahmed Ashour */ -@RunWith(BrowserRunner.class) public class MalformedHtml2Test extends SimpleWebTestCase { /** diff --git a/src/test/java/org/htmlunit/html/parser/MalformedHtmlTest.java b/src/test/java/org/htmlunit/html/parser/MalformedHtmlTest.java index 1066b9e3748..1aa7a1496cb 100644 --- a/src/test/java/org/htmlunit/html/parser/MalformedHtmlTest.java +++ b/src/test/java/org/htmlunit/html/parser/MalformedHtmlTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,11 +16,9 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.html.HtmlPageTest; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; +import org.junit.jupiter.api.Test; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; @@ -34,7 +32,6 @@ * @author Carsten Steul * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class MalformedHtmlTest extends WebDriverTestCase { /** @@ -184,9 +181,9 @@ public void wrongHtml_TagBeforeHtml() throws Exception { } /** - * Regression test for bug #889. - * @throws Exception if an error occurs - */ + * Regression test for bug #889. + * @throws Exception if an error occurs + */ @Test @Alerts("0") public void missingSingleQuote() throws Exception { @@ -207,9 +204,9 @@ public void missingSingleQuote() throws Exception { } /** - * Regression test for bug #889. - * @throws Exception if an error occurs - */ + * Regression test for bug #889. + * @throws Exception if an error occurs + */ @Test @Alerts("0") public void missingDoubleQuote() throws Exception { @@ -230,9 +227,9 @@ public void missingDoubleQuote() throws Exception { } /** - * Regression test for bug #1192. - * @throws Exception if an error occurs - */ + * Regression test for bug #1192. + * @throws Exception if an error occurs + */ @Test @Alerts({"submit", "button"}) public void brokenInputSingleQuote() throws Exception { @@ -253,9 +250,9 @@ public void brokenInputSingleQuote() throws Exception { } /** - * Regression test for bug #1192. - * @throws Exception if an error occurs - */ + * Regression test for bug #1192. + * @throws Exception if an error occurs + */ @Test @Alerts({"submit", "button"}) public void brokenInputDoubleQuote() throws Exception { @@ -300,6 +297,9 @@ public void nestedForms() throws Exception { assertTitle(driver, getExpectedAlerts()[0]); driver.findElement(By.id("button")).click(); + if (useRealBrowser()) { + Thread.sleep(400); + } assertEquals(URL_FIRST + "?FromDate=inFirst", driver.getCurrentUrl()); } @@ -320,7 +320,7 @@ public void li_div_li() throws Exception { } /** - * Regression test for bug 1564. + * Regression test for bug 1564. * @throws Exception if an error occurs */ @Test @@ -339,7 +339,7 @@ public void entityWithInvalidUTF16Code() throws Exception { } /** - * Regression test for bug 1562. + * Regression test for bug 1562. * @throws Exception if an error occurs */ @Test @@ -368,21 +368,21 @@ public void sectionWithUnknownClosingTag() throws Exception { "innerA", "DIV:null", "1", "#text:X", "false", "true"}) @HtmlUnitNYI( CHROME = {"4", "#text:\\n\\s\\s", "A:null", "A:null", "#text:YZ\\n\\n", - "2", "innerDiv", "A:null", "1", "#text:W", "exception", + "2", "innerDiv", "A:null", "1", "#text:W", "TypeError", "outerA", "BODY:null", "2", "#text:V", "true", "false", - "innerA", "BODY:null", "1", "#text:X", "false", "true", "exception"}, + "innerA", "BODY:null", "1", "#text:X", "false", "true", "TypeError"}, EDGE = {"4", "#text:\\n\\s\\s", "A:null", "A:null", "#text:YZ\\n\\n", - "2", "innerDiv", "A:null", "1", "#text:W", "exception", + "2", "innerDiv", "A:null", "1", "#text:W", "TypeError", "outerA", "BODY:null", "2", "#text:V", "true", "false", - "innerA", "BODY:null", "1", "#text:X", "false", "true", "exception"}, + "innerA", "BODY:null", "1", "#text:X", "false", "true", "TypeError"}, FF = {"4", "#text:\\n\\s\\s", "A:null", "A:null", "#text:YZ\\n\\n", - "2", "innerDiv", "A:null", "1", "#text:W", "exception", + "2", "innerDiv", "A:null", "1", "#text:W", "TypeError", "outerA", "BODY:null", "2", "#text:V", "true", "false", - "innerA", "BODY:null", "1", "#text:X", "false", "true", "exception"}, + "innerA", "BODY:null", "1", "#text:X", "false", "true", "TypeError"}, FF_ESR = {"4", "#text:\\n\\s\\s", "A:null", "A:null", "#text:YZ\\n\\n", - "2", "innerDiv", "A:null", "1", "#text:W", "exception", + "2", "innerDiv", "A:null", "1", "#text:W", "TypeError", "outerA", "BODY:null", "2", "#text:V", "true", "false", - "innerA", "BODY:null", "1", "#text:X", "false", "true", "exception"}) + "innerA", "BODY:null", "1", "#text:X", "false", "true", "TypeError"}) // Input: // VZ
// CHROME and IE generate: @@ -406,7 +406,7 @@ public void nestedAnchorInDivision() throws Exception { + " dump(document.body.childNodes[2]);\n" + " dump(document.body.childNodes[3]);\n" + " log(document.getElementsByTagName('a').length);\n" - + " } catch (e) { log('exception') }\n" + + " } catch(e) { logEx(e) }\n" + " try {\n" + " log(innerDiv.id);\n" @@ -415,7 +415,7 @@ public void nestedAnchorInDivision() throws Exception { + " dump(innerDiv.childNodes[0]);\n" + " dump(innerDiv.childNodes[1]);\n" + " dump(innerDiv.childNodes[2]);\n" - + " } catch (e) { log('exception') }\n" + + " } catch(e) { logEx(e) }\n" + " try {\n" + " log(anchors[0].id);\n" @@ -424,7 +424,7 @@ public void nestedAnchorInDivision() throws Exception { + " dump(anchors[0].childNodes[0]);\n" + " log(anchors[0] == outerA);\n" + " log(anchors[0] == innerA);\n" - + " } catch (e) { log('exception') }\n" + + " } catch(e) { logEx(e) }\n" + " try {\n" + " log(anchors[1].id);\n" @@ -433,7 +433,7 @@ public void nestedAnchorInDivision() throws Exception { + " dump(anchors[1].childNodes[0]);\n" + " log(anchors[1] == outerA);\n" + " log(anchors[1] == innerA);\n" - + " } catch (e) { log('exception') }\n" + + " } catch(e) { logEx(e) }\n" + " try {\n" + " log(anchors[2].id);\n" @@ -442,7 +442,7 @@ public void nestedAnchorInDivision() throws Exception { + " dump(anchors[2].childNodes[0]);\n" + " log(anchors[2] == outerA);\n" + " log(anchors[2] == innerA);\n" - + " } catch (e) { log('exception') }\n" + + " } catch(e) { logEx(e) }\n" + " }\n" + " function dump(e) {\n" + " log(e.nodeName + ':' + e.nodeValue);\n" @@ -456,7 +456,7 @@ public void nestedAnchorInDivision() throws Exception { } /** - * Regression test for bug 1598. + * Regression test for bug 1598. * @throws Exception if an error occurs */ @Test @@ -506,6 +506,20 @@ public void unknownTagInTbody() throws Exception { + "" + "" + "") public void formInTableData() throws Exception { final String html = "\n" @@ -544,6 +558,20 @@ public void formInTableData() throws Exception { + "" + "" + "") public void formInTableRow() throws Exception { final String html = "\n" @@ -591,8 +619,21 @@ public void formInTableRow() throws Exception { + "" + "" + "") - public void formInTable() throws Exception { final String html = "\n" + "\n" diff --git a/src/test/java/org/htmlunit/html/performance/HugePagePerformanceTest.java b/src/test/java/org/htmlunit/html/performance/HugePagePerformanceTest.java index af3c45146fb..253912fcb7b 100644 --- a/src/test/java/org/htmlunit/html/performance/HugePagePerformanceTest.java +++ b/src/test/java/org/htmlunit/html/performance/HugePagePerformanceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,6 +30,11 @@ public final class HugePagePerformanceTest { private HugePagePerformanceTest() { } + /** + * Simple main for the moment. + * @param args ignored + * @throws IOException in case of error + */ public static void main(final String[] args) throws IOException { // final URL fileURL = WebClient.class.getClassLoader() // .getResource("testfiles/huge-pages/html-standard-2024-10-17.html"); diff --git a/src/test/java/org/htmlunit/html/serializer/HtmlSerializerInnerOuterText2Test.java b/src/test/java/org/htmlunit/html/serializer/HtmlSerializerInnerOuterText2Test.java index 5b5e50bf432..29a9c17bf0a 100644 --- a/src/test/java/org/htmlunit/html/serializer/HtmlSerializerInnerOuterText2Test.java +++ b/src/test/java/org/htmlunit/html/serializer/HtmlSerializerInnerOuterText2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,11 +15,9 @@ package org.htmlunit.html.serializer; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; +import org.junit.jupiter.api.Test; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; @@ -31,7 +29,6 @@ * * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class HtmlSerializerInnerOuterText2Test extends WebDriverTestCase { /** @@ -95,8 +92,8 @@ public void getInnerTextWhiteSpaceBreakPreLine() throws Exception { } private void getInnerTextWhiteSpaceBreak(final String whiteSpace) throws Exception { - final String htmlContent - = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "
\n" @@ -169,8 +166,8 @@ public void getInnerTextWhiteSpaceInputHiddenPreLine() throws Exception { } private void getInnerTextWhiteSpaceInputHidden(final String whiteSpace) throws Exception { - final String htmlContent - = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "
\n" @@ -247,8 +244,8 @@ public void getInnerTextWhiteSpaceScriptPreLine() throws Exception { } private void getInnerTextWhiteSpaceScript(final String whiteSpace) throws Exception { - final String htmlContent - = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" + " \n" + + "\n" + + " \n" + + ""; + + loadPageVerifyTitle2(content); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts({"4", "null"}) + public void xPathUndefined() throws Exception { + final String content = DOCTYPE_HTML + + "\n" + + "\n" + + "\n" + + " \n" + + ""; + + loadPageVerifyTitle2(content); + } + /** * @throws Exception if the test fails */ @Test @Alerts({"102", "111", "111", "160", "97", "110", "100", "160", "102", "111", "111"}) public void optionText() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -63,7 +125,8 @@ public void optionText() throws Exception { @Test @Alerts("[object HTMLParagraphElement][object HTMLDivElement]") public void pipe() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -93,7 +156,8 @@ public void pipe() throws Exception { @Test @Alerts("a") public void math() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -254,6 +318,51 @@ public void number() throws Exception { compare("//p[@y=number(\" 13\t \")]"); } + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("false") + public void startsWith() throws Exception { + compareBooleanValue("starts-with(\"haystack\", \"needle\")"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("true") + public void startsWithFound() throws Exception { + compareBooleanValue("starts-with(\"haystack\", \"hay\")"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("true") + public void startsWithWhole() throws Exception { + compareBooleanValue("starts-with(\"haystack\", \"haystack\")"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("true") + public void startsWithEmpty() throws Exception { + compareBooleanValue("starts-with(\"haystack\", \"\")"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("true") + public void startsWithEmptyEmpty() throws Exception { + compareBooleanValue("starts-with(\"\", \"\")"); + } + /** * @throws Exception if the test fails */ @@ -272,7 +381,9 @@ public void substringWithNegativeLength() throws Exception { compareStringValue("substring(\"HtmlUnit\", 2, -1)"); } - /** @throws Exception in case of problems */ + /** + * @throws Exception in case of problems + */ @Test @Alerts("''") public void substringNegativeStartWithLength() throws Exception { @@ -319,13 +430,32 @@ public void attrib() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("error") + @Alerts("SyntaxError/DOMException") public void lowerCaseNotSupported() throws Exception { - compare("//*[lower-case(@id) = \"a\"]"); + compareError("//*[lower-case(@id) = \"a\"]"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("SyntaxError/DOMException") + public void upperCaseNotSupported() throws Exception { + compareError("//*[upper-case(@id) = \"A\"]"); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("SyntaxError/DOMException") + public void endsWithNotSupported() throws Exception { + compareError("ends-with(\"haystack\", \"haystack\")"); } private void compare(final String xpath) throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -352,7 +482,8 @@ private void compare(final String xpath) throws Exception { } private void compareStringValue(final String xpath) throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -376,7 +507,8 @@ private void compareStringValue(final String xpath) throws Exception { } private void compareBooleanValue(final String xpath) throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -399,13 +531,34 @@ private void compareBooleanValue(final String xpath) throws Exception { loadPageVerifyTitle2(content); } + private void compareError(final String xpath) throws Exception { + final String content = DOCTYPE_HTML + + "\n" + + "\n" + + "\n" + + "\n" + + ""; + + loadPageVerifyTitle2(content); + } + /** * @throws Exception if the test fails */ @Test @Alerts("mySpan") public void minimalParameters() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -434,7 +587,8 @@ public void minimalParameters() throws Exception { @Test @Alerts("mySpan") public void undefinedResult() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -462,9 +616,10 @@ public void undefinedResult() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("error") + @Alerts("TypeError") public void stringResult() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -494,7 +649,8 @@ public void stringResult() throws Exception { @Test @Alerts("mySpan") public void objectResult() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -526,7 +682,8 @@ public void objectResult() throws Exception { FF = "mySpan - myDiv - ", FF_ESR = "mySpan - myDiv - ") public void reuseResult() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -569,7 +726,8 @@ public void reuseResult() throws Exception { @Test @Alerts("myDiv1") public void documentEvaluateFirst() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/html/xpath/HtmlUnitXPathTest.java b/src/test/java/org/htmlunit/html/xpath/HtmlUnitXPathTest.java index 8179be8405c..9e4e172c9b2 100644 --- a/src/test/java/org/htmlunit/html/xpath/HtmlUnitXPathTest.java +++ b/src/test/java/org/htmlunit/html/xpath/HtmlUnitXPathTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ */ package org.htmlunit.html.xpath; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.util.ArrayList; import java.util.Arrays; @@ -29,9 +29,7 @@ import org.htmlunit.html.HtmlElement; import org.htmlunit.html.HtmlPage; import org.htmlunit.html.HtmlTableCell; -import org.htmlunit.junit.BrowserRunner; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Tests for XPath evaluation on HtmlUnit DOM. @@ -40,7 +38,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class HtmlUnitXPathTest extends SimpleWebTestCase { /** @@ -49,7 +46,8 @@ public class HtmlUnitXPathTest extends SimpleWebTestCase { */ @Test public void simplePath() throws Exception { - final String content = "Test page\n" + final String content = DOCTYPE_HTML + + "Test page\n" + "foo\n" + ""; @@ -66,7 +64,8 @@ public void simplePath() throws Exception { */ @Test public void xpathFromElement() throws Exception { - final String content = "Test page\n" + final String content = DOCTYPE_HTML + + "Test page\n" + "foo\n" + ""; @@ -83,8 +82,8 @@ public void xpathFromElement() throws Exception { @Test @SuppressWarnings("unchecked") public void elementOrder() throws Exception { - final String content - = "First\n" + ""; @@ -105,8 +104,8 @@ public void elementOrder() throws Exception { */ @Test public void whenJSChangesPage() throws Exception { - final String content - = "foo"; + + loadPageVerifyTitle2(html); + } + + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("callee,length") + public void argumentsPropertyNamesStrict() throws Exception { + final String html = DOCTYPE_HTML + + "" + + ""; + + loadPageVerifyTitle2(html); + } + /** * @throws Exception if the test fails */ @Test @Alerts("2") public void passedCountDifferentFromDeclared() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; + + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts({"true", "true"}) + public void argumentsCalleeDifferentFunctions() throws Exception { + final String html = DOCTYPE_HTML + + "" + + ""; + + loadPageVerifyTitle2(html); + } } diff --git a/src/test/java/org/htmlunit/javascript/AttributeCaseTest.java b/src/test/java/org/htmlunit/javascript/AttributeCaseTest.java index 4df8a3a2dc6..28452a67110 100644 --- a/src/test/java/org/htmlunit/javascript/AttributeCaseTest.java +++ b/src/test/java/org/htmlunit/javascript/AttributeCaseTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,17 +19,15 @@ import org.htmlunit.SimpleWebTestCase; import org.htmlunit.html.HtmlElement; import org.htmlunit.html.HtmlPage; -import org.htmlunit.junit.BrowserRunner; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Tests for {@link HtmlElement} attributes. * * @author David D. Kilzer * @author Mike Bowler + * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class AttributeCaseTest extends SimpleWebTestCase { private static final String ATTRIBUTE_NAME = "randomAttribute"; @@ -174,7 +172,8 @@ private void setupAttributeTest(final String content, final String elementId) th private void setupGetAttributeTest(final String attributeName, final String attributeValue) throws Exception { final String elementId = "p-id"; - final String content = "AttributeCaseTest\n" + final String content = DOCTYPE_HTML + + "AttributeCaseTest\n" + "

\n" + ""; @@ -187,8 +186,8 @@ private void setupSetAttributeTest( throws Exception { final String elementId = "p-id"; - final String content - = "AttributeCaseTest\n" + final String content = DOCTYPE_HTML + + "AttributeCaseTest\n" + "

\n" + "\n" + ""; @@ -59,8 +56,8 @@ public void oneRestArg() throws Exception { @Test @Alerts("true-0") public void oneRestArgNothingProvided() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -72,7 +69,7 @@ public void oneRestArgNothingProvided() throws Exception { + "try {\n" + " var r = rest();\n" + " log('' + Array.isArray(r) + '-' + r.length);\n" - + "} catch (e) { log(e.message) }" + + "} catch(e) { log(e.message) }" + "\n" + ""; @@ -85,8 +82,8 @@ public void oneRestArgNothingProvided() throws Exception { @Test @Alerts("true-1") public void oneRestArgOneProvided() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -98,7 +95,7 @@ public void oneRestArgOneProvided() throws Exception { + "try {\n" + " var r = rest('xy');\n" + " log('' + Array.isArray(r) + '-' + r.length);\n" - + "} catch (e) { log(e.message) }" + + "} catch(e) { log(e.message) }" + "\n" + ""; @@ -111,8 +108,8 @@ public void oneRestArgOneProvided() throws Exception { @Test @Alerts("abc,2,##") public void twoRestArg() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -123,7 +120,7 @@ public void twoRestArg() throws Exception { + "}\n" + "try {\n" + " log(rest(1, 'abc', 2, '##').toString());\n" - + "} catch (e) { log(e.message) }" + + "} catch(e) { log(e.message) }" + "\n" + ""; @@ -136,8 +133,8 @@ public void twoRestArg() throws Exception { @Test @Alerts("undefined - true-0") public void twoRestArgNothingProvided() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -148,7 +145,7 @@ public void twoRestArgNothingProvided() throws Exception { + "}\n" + "try {\n" + " log(rest());\n" - + "} catch (e) { log(e.message) }" + + "} catch(e) { log(e.message) }" + "\n" + ""; @@ -161,8 +158,8 @@ public void twoRestArgNothingProvided() throws Exception { @Test @Alerts("77 - true-0") public void twoRestArgOneProvided() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -173,7 +170,7 @@ public void twoRestArgOneProvided() throws Exception { + "}\n" + "try {\n" + " log(rest('77'));\n" - + "} catch (e) { log(e.message) }" + + "} catch(e) { log(e.message) }" + "\n" + ""; @@ -186,8 +183,8 @@ public void twoRestArgOneProvided() throws Exception { @Test @Alerts("1-4") public void arguments() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -198,7 +195,7 @@ public void arguments() throws Exception { + "}\n" + "try {\n" + " log('' + rest('77') + '-' + rest(1, 2, 3, 4));\n" - + "} catch (e) { log(e.message) }" + + "} catch(e) { log(e.message) }" + "\n" + ""; @@ -211,8 +208,8 @@ public void arguments() throws Exception { @Test @Alerts("0-1") public void length() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -222,7 +219,7 @@ public void length() throws Exception { + "function foo2(arg, ...theArgs) {}\n" + "try {\n" + " log(foo1.length + '-' + foo2.length);\n" - + "} catch (e) { log(e.message) }" + + "} catch(e) { log(e.message) }" + "\n" + ""; @@ -235,8 +232,8 @@ public void length() throws Exception { @Test @Alerts("2-1-0") public void argLength() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -247,7 +244,7 @@ public void argLength() throws Exception { + "}\n" + "try {\n" + " log(rest(1,2) + '-' + rest(1) + '-' + rest());\n" - + "} catch (e) { log(e.message) }" + + "} catch(e) { log(e.message) }" + "\n" + ""; @@ -260,8 +257,8 @@ public void argLength() throws Exception { @Test @Alerts("function rest(...restArgs) { return restArgs.length; }") public void string() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -272,7 +269,7 @@ public void string() throws Exception { + "}\n" + "try {\n" + " log(rest.toString());\n" - + "} catch (e) { log(e.message) }" + + "} catch(e) { log(e.message) }" + "\n" + ""; diff --git a/src/test/java/org/htmlunit/javascript/FunctionsTest.java b/src/test/java/org/htmlunit/javascript/FunctionsTest.java index 113c89c762b..f39664cd054 100644 --- a/src/test/java/org/htmlunit/javascript/FunctionsTest.java +++ b/src/test/java/org/htmlunit/javascript/FunctionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,18 +15,16 @@ package org.htmlunit.javascript; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.NotYetImplemented; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; +import org.junit.jupiter.api.Test; +import org.openqa.selenium.WebDriverException; /** * Tests for Functions. * * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class FunctionsTest extends WebDriverTestCase { /** @@ -35,8 +33,8 @@ public class FunctionsTest extends WebDriverTestCase { @Test @Alerts("function\\sfoo()\\s{\\s\\s\\s\\sreturn\\s\\t'a'\\s+\\s'b'\\s}") public void function_toString() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; - loadPageVerifyTitle2(html); + try { + loadPageVerifyTitle2(html); + } + catch (final WebDriverException e) { + assertTrue(e.getMessage(), e.getMessage().startsWith(getExpectedAlerts()[0])); + } } /** * @throws Exception if the test fails */ @Test - @Alerts({"error", "1"}) + @Alerts({"ReferenceError", "1"}) public void conditionallyCreatedFunctionStrict() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" + "\n" + ""; - loadPageWithAlerts2(html); + loadPageVerifyTitle2(html); } } diff --git a/src/test/java/org/htmlunit/javascript/HtmlUnitContextFactoryTest.java b/src/test/java/org/htmlunit/javascript/HtmlUnitContextFactoryTest.java index 6a41f84af1c..155cf700ecc 100644 --- a/src/test/java/org/htmlunit/javascript/HtmlUnitContextFactoryTest.java +++ b/src/test/java/org/htmlunit/javascript/HtmlUnitContextFactoryTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,16 +16,13 @@ import org.htmlunit.BrowserVersion; import org.htmlunit.SimpleWebTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Tests for {@link HtmlUnitContextFactory}. * * @author Ahmed Ashour */ -@RunWith(BrowserRunner.class) public class HtmlUnitContextFactoryTest extends SimpleWebTestCase { /** @@ -33,7 +30,7 @@ public class HtmlUnitContextFactoryTest extends SimpleWebTestCase { */ @Test public void customBrowserVersion() throws Exception { - final String html = ""; + final String html = DOCTYPE_HTML + ""; final BrowserVersion browserVersion = new BrowserVersion.BrowserVersionBuilder(BrowserVersion.FIREFOX_ESR) diff --git a/src/test/java/org/htmlunit/javascript/HtmlUnitScriptable2Test.java b/src/test/java/org/htmlunit/javascript/HtmlUnitScriptable2Test.java index 7a12dba6129..7262b67d997 100644 --- a/src/test/java/org/htmlunit/javascript/HtmlUnitScriptable2Test.java +++ b/src/test/java/org/htmlunit/javascript/HtmlUnitScriptable2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,12 +15,9 @@ package org.htmlunit.javascript; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.html.HtmlPageTest; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; +import org.junit.jupiter.api.Test; /** * Tests for {@link HtmlUnitScriptable}. @@ -37,7 +34,6 @@ * @author Frank Danek * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class HtmlUnitScriptable2Test extends WebDriverTestCase { /** @@ -46,7 +42,7 @@ public class HtmlUnitScriptable2Test extends WebDriverTestCase { @Test @Alerts({"text/html", "text/html"}) public void setNonWritablePropertyContentType() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -70,7 +66,7 @@ public void setNonWritablePropertyContentType() throws Exception { @Test @Alerts({"CSS1Compat", "CSS1Compat"}) public void setNonWritablePropertyCompatMode() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -94,7 +90,7 @@ public void setNonWritablePropertyCompatMode() throws Exception { @Test @Alerts("[object Arguments]") public void arguments_toString() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -338,7 +334,7 @@ private void set_ReadOnly(final String expression) throws Exception { @HtmlUnitNYI(CHROME = {"function", "true", "function length() { [native code] }", "0", "0"}, EDGE = {"function", "true", "function length() { [native code] }", "0", "0"}) public void lookupGetter() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/javascript/HtmlUnitScriptableTest.java b/src/test/java/org/htmlunit/javascript/HtmlUnitScriptableTest.java index c35f9ac14f6..0c180aed3cd 100644 --- a/src/test/java/org/htmlunit/javascript/HtmlUnitScriptableTest.java +++ b/src/test/java/org/htmlunit/javascript/HtmlUnitScriptableTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,10 +16,8 @@ import org.htmlunit.SimpleWebTestCase; import org.htmlunit.html.HtmlPage; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; /** * Tests for {@link HtmlUnitScriptable}. @@ -35,7 +33,6 @@ * @author Mike Dirolf * @author Frank Danek */ -@RunWith(BrowserRunner.class) public class HtmlUnitScriptableTest extends SimpleWebTestCase { /** @@ -44,8 +41,8 @@ public class HtmlUnitScriptableTest extends SimpleWebTestCase { @Test @Alerts("past focus") public void callInheritedFunction() throws Exception { - final String html - = "foo\n" + ""; @@ -289,7 +293,8 @@ private void object(final String object) throws Exception { @Test @Alerts({"function", "function"}) public void inline() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -448,7 +461,8 @@ public void recursion() throws Exception { @Test @Alerts({"0", "false", "0"}) public void nativeFunction_toStringValue() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -492,8 +506,8 @@ public void onloadJavascriptFunction() throws Exception { @Test @Alerts("foo") public void alert() throws Exception { - final String html - = "foo\n" + "

hello world

\n" @@ -513,8 +527,8 @@ public void alert() throws Exception { @Test @Alerts("foo") public void scopeOfNewFunction() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + + " \n" + + "\n" + "\n" + "\n" + ""; - loadPageWithAlerts2(html); + loadPageVerifyTitle2(html); } /** @@ -704,7 +722,8 @@ public void comment() throws Exception { "rstlna-rstlne-rstlne", "rstlne-rstlne-rstlne", "rstlni-rstlni-rstlni", "rstlna-rstlna-rstlna"}) public void regExpSupport() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n" + "\n" @@ -972,7 +998,8 @@ public void functioNamesExceptionsStrict() throws Exception { @Test @Alerts("false") public void ctorBooleanDocumentAll() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -1052,7 +1082,8 @@ public void javaNotAccessable() throws Exception { @Test @Alerts("Received: from worker - exception") public void javaNotAccessableFromWorker() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n"; final String workerJs = "var pi = 'from worker';\n" + "try {\n" + " pi = pi + ' - ' + java.lang.Math.PI\n" - + "} catch (e) { pi = pi + ' - ' + 'exception'; }\n" + + "} catch(e) { pi = pi + ' - ' + 'exception'; }\n" + "postMessage(pi);\n"; getMockWebConnection().setResponse(new URL(URL_FIRST, "worker.js"), workerJs, MimeType.TEXT_JAVASCRIPT); @@ -1081,7 +1112,8 @@ public void javaNotAccessableFromWorker() throws Exception { @Test @Alerts({"#0", "#1", "2"}) public void constInLoop() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; final WebDriver driver = loadPage2(html); - Thread.sleep(DEFAULT_WAIT_TIME); + Thread.sleep(DEFAULT_WAIT_TIME.toMillis()); verifyTitle2(driver, getExpectedAlerts()); } @@ -1182,7 +1217,8 @@ public void ensureOrder() throws Exception { @Test @Alerts({"false", "aa", "0", "aabbc", "false", "bb", "2", "aabbc", "true", "undefined"}) public void matchAll() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + + "" + ""; + + try { + loadPageVerifyTitle2(html); + } + catch (final WebDriverException e) { + assertTrue(e.getMessage(), e.getMessage().startsWith(getExpectedAlerts()[0])); + } + } + } diff --git a/src/test/java/org/htmlunit/javascript/JavaScriptEngineTest.java b/src/test/java/org/htmlunit/javascript/JavaScriptEngineTest.java index 5ea46cfc807..90fc2a46539 100644 --- a/src/test/java/org/htmlunit/javascript/JavaScriptEngineTest.java +++ b/src/test/java/org/htmlunit/javascript/JavaScriptEngineTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ */ package org.htmlunit.javascript; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -49,13 +49,10 @@ import org.htmlunit.html.HtmlPage; import org.htmlunit.html.HtmlScript; import org.htmlunit.html.HtmlTextInput; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.Retry; +import org.htmlunit.junit.annotation.Alerts; import org.htmlunit.util.NameValuePair; import org.htmlunit.util.UrlUtils; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Tests for the {@link JavaScriptEngine}. @@ -71,7 +68,6 @@ * @author Ronald Brill * @author Carsten Steul */ -@RunWith(BrowserRunner.class) public class JavaScriptEngineTest extends SimpleWebTestCase { /** @@ -79,8 +75,8 @@ public class JavaScriptEngineTest extends SimpleWebTestCase { */ @Test public void setJavascriptEnabled_false() throws Exception { - final String html - = "foo\n" + "

hello world

\n" @@ -105,8 +101,8 @@ public void setJavascriptEnabled_false() throws Exception { */ @Test public void setInputValue() throws Exception { - final String content - = "foo\n" @@ -214,8 +211,8 @@ public void scopeInInactivePage() throws Exception { @Test @Alerts("got here") public void externalScript() throws Exception { - final String html - = "foo\n" + "\n" + "\n" @@ -276,8 +273,8 @@ public void externalScriptWithApostrophesInComment() throws Exception { @Test public void scriptErrorContainsPageUrl() throws Exception { // embedded script - final String content1 - = "\n" + final String content1 = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -292,8 +289,8 @@ public void scriptErrorContainsPageUrl() throws Exception { final WebClient client = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); - final String content2 - = "foo\n" + "\n" @@ -360,8 +357,8 @@ public void externalScriptEmptyGZipEncoded() throws Exception { bytes.toByteArray(), 200, "OK", "text/javascript", headers); } - final String htmlContent - = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "\n" @@ -388,8 +385,8 @@ public void externalScriptBrokenGZipEncoded() throws Exception { bytes.toByteArray(), 200, "OK", "text/javascript", headers); } - final String htmlContent - = "\n" + final String htmlContent = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" + "\n" @@ -412,8 +409,8 @@ public void referencingVariablesFromOneScriptToAnother_Regression() throws Excep final WebClient client = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + "\n" @@ -439,8 +436,8 @@ public void referencingVariablesFromOneScriptToAnother_Regression() throws Excep */ @Test public void javaScriptUrl() throws Exception { - final String htmlContent - = "\n" @@ -468,8 +465,8 @@ public void javaScriptUrl() throws Exception { */ @Test public void thisDotInOnClick() throws Exception { - final String htmlContent - = "First\n" + final String htmlContent = DOCTYPE_HTML + + "First\n" + "
\n" + ""; @@ -491,8 +488,8 @@ public void functionDefinedInExternalFile_CalledFromInlineScript() throws Except final WebClient client = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + " \n" + ""; @@ -529,8 +526,8 @@ public void externalScriptWithNewLineBeforeClosingScriptTag() throws Exception { final WebClient client = getWebClient(); final MockWebConnection webConnection = new MockWebConnection(); - final String htmlContent - = "foo\n" + final String htmlContent = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" // \n between opening and closing tag is important + ""; @@ -558,8 +555,8 @@ public void externalScriptWithNewLineBeforeClosingScriptTag() throws Exception { */ @Test public void functionDefinedInSameFile() throws Exception { - final String htmlContent - = "First\n" + "

hello world

\n" @@ -700,8 +698,8 @@ private static String getJavaScriptContent(final String javascript) { */ @Test public void scriptErrorIsolated() throws Exception { - final String content - = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -756,15 +754,15 @@ public void prototypeScope() throws Exception { } private void prototypeScope(final String name, final String value) throws Exception { - final String content1 - = "\n" + final String content1 = DOCTYPE_HTML + + "\n" + "\n" + ""; - final String content2 - = "\n" + final String content2 = DOCTYPE_HTML + + "\n" + ""; + final String content = DOCTYPE_HTML + ""; final MockWebConnection webConnection = new MockWebConnection(); webConnection.setDefaultResponse(content); client.setWebConnection(webConnection); @@ -883,22 +881,30 @@ public Object callFunction( return super.callFunction(page, javaScriptFunction, thisObject, args, htmlElementScope); } - /** @return the number of times that this engine has called functions */ + /** + * @return the number of times that this engine has called functions + */ public int getCallCount() { return scriptCallCount_; } - /** @return the number of times that this engine has executed code */ + /** + * @return the number of times that this engine has executed code + */ public int getExecutionCount() { return scriptExecutionCount_; } - /** @return the number of times that this engine has compiled code */ + /** + * @return the number of times that this engine has compiled code + */ public int getCompileCount() { return scriptCompileCount_; } - /** @return the number of times that this engine has executed a compiled script */ + /** + * @return the number of times that this engine has executed a compiled script + */ public int getExecuteScriptCount() { return scriptExecuteScriptCount_; } @@ -910,8 +916,8 @@ public int getExecuteScriptCount() { @Test @Alerts({"", "ex thrown"}) public void commentNoDoubleSlash() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -927,7 +933,7 @@ public void commentNoDoubleSlash() throws Exception { } catch (final ScriptException e) { exceptionThrown = "ex thrown"; - assertEquals(4, e.getFailingLineNumber()); + assertEquals(5, e.getFailingLineNumber()); } assertEquals(expectedExThrown, exceptionThrown); @@ -939,14 +945,14 @@ public void commentNoDoubleSlash() throws Exception { */ @Test public void compiledScriptCached() throws Exception { - final String content1 - = "foo\n" + final String content1 = DOCTYPE_HTML + + "foo\n" + "\n" + "\n" + "to page 2\n" + ""; - final String content2 - = "page 2\n" + final String content2 = DOCTYPE_HTML + + "page 2\n" + "\n" + "\n" + ""; @@ -988,8 +994,8 @@ public void compiledScriptCached() throws Exception { */ @Test public void scriptTags_AllLocalContent() throws Exception { - final String content - = "\n" + final String content = DOCTYPE_HTML + + "\n" + "foo\n" + "\n" // no language specified - assume JavaScript + "\n" @@ -1076,7 +1082,8 @@ protected void handleJavaScriptException(final ScriptException scriptException, }; webClient.setJavaScriptEngine(myEngine); - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "Test page<\n" + "\n" @@ -1166,10 +1174,10 @@ private static ThreadLocal> getPostponedActions(final Abst * @throws Exception if the test fails */ @Test - @Retry @Alerts("starting") public void shutdownShouldKill() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "Test page\n" + "\n" + + "\n" + + "\n" + + ""; + + try (WebClient webClient = getWebClient()) { + webClient.setJavaScriptTimeout(DEFAULT_WAIT_TIME.toMillis()); + final List collectedAlerts = new ArrayList<>(); webClient.setAlertHandler(new CollectingAlertHandler(collectedAlerts)); @@ -1200,7 +1252,8 @@ public void shutdownShouldKill() throws Exception { @Test @Alerts("unload") public void shutdownOnUnload() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "Test page\n" + ""; + final String html = DOCTYPE_HTML + ""; getMockWebConnection().setDefaultResponse(html); webClient.getPage(URL_FIRST); assertEquals("org.htmlunit.corejs.javascript.EvaluatorException: " - + "Unexpected end of file (script in " + URL_FIRST + " from (1, 21) to (1, 37)#1)\n", + + "Unexpected end of file (script in " + URL_FIRST + " from (2, 21) to (2, 37)#2)\n", scriptExceptions.toString()); } } diff --git a/src/test/java/org/htmlunit/javascript/JavascriptErrorListenerTest.java b/src/test/java/org/htmlunit/javascript/JavascriptErrorListenerTest.java index 418621d0c04..d07986d7b17 100644 --- a/src/test/java/org/htmlunit/javascript/JavascriptErrorListenerTest.java +++ b/src/test/java/org/htmlunit/javascript/JavascriptErrorListenerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ */ package org.htmlunit.javascript; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.net.MalformedURLException; import java.net.URL; @@ -26,10 +26,9 @@ import org.htmlunit.WebClient; import org.htmlunit.WebServerTestCase; import org.htmlunit.html.HtmlPage; -import org.htmlunit.junit.BrowserRunner; import org.htmlunit.util.MimeType; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; /** * Tests for {@link JavaScriptErrorListener}. @@ -37,7 +36,6 @@ * @author Ronald Brill * @author Marc Guillemot */ -@RunWith(BrowserRunner.class) public class JavascriptErrorListenerTest extends WebServerTestCase { @@ -52,11 +50,12 @@ public void nullJavaScriptErrorListener() throws Exception { webClient.getOptions().setThrowExceptionOnScriptError(false); webClient.setJavaScriptErrorListener(null); final MockWebConnection webConnection = new MockWebConnection(); - final String errorContent = "ERROR 500"; + final String errorContent = DOCTYPE_HTML + "ERROR 500"; webConnection.setResponse(URL_SECOND, errorContent, 500, "BOOM", MimeType.TEXT_HTML, Collections.emptyList()); // test script exception - String content = "Throw JavaScript Error\n" + String content = DOCTYPE_HTML + + "Throw JavaScript Error\n" + "\n" + ""; webConnection.setResponse(URL_FIRST, content); @@ -64,7 +63,8 @@ public void nullJavaScriptErrorListener() throws Exception { webClient.getPage(URL_FIRST); // test load script error - content = "Throw JavaScript Error\n" + content = DOCTYPE_HTML + + "Throw JavaScript Error\n" + "\n" + ""; webConnection.setResponse(URL_FIRST, content); @@ -77,7 +77,8 @@ public void nullJavaScriptErrorListener() throws Exception { } // test malformed script url error - content = "Throw JavaScript Error\n" + content = DOCTYPE_HTML + + "Throw JavaScript Error\n" + "\n" + ""; webConnection.setResponse(URL_FIRST, content); @@ -86,7 +87,8 @@ public void nullJavaScriptErrorListener() throws Exception { // test timeout error webClient.setJavaScriptTimeout(100); - content = "Throw JavaScript Timeout Error\n" + content = DOCTYPE_HTML + + "Throw JavaScript Timeout Error\n" + "\n" + ""; webConnection.setResponse(URL_FIRST, content); @@ -105,7 +107,8 @@ public void listenForScriptException() throws Exception { webClient.setJavaScriptErrorListener(javaScriptErrorListener); // test script exception - final String html = "Throw JavaScript Error" + final String html = DOCTYPE_HTML + + "Throw JavaScript Error" + "" + ""; loadPage(html); @@ -113,7 +116,7 @@ public void listenForScriptException() throws Exception { assertEquals("", javaScriptErrorListener.getWarnings()); assertEquals("org.htmlunit.ScriptException: " + "ReferenceError: \"unknown\" is not defined. " - + "(script in http://localhost:" + PORT + "/ from (1, 58) to (1, 81)#1)", + + "(script in http://localhost:" + PORT + "/ from (2, 58) to (2, 81)#2)", javaScriptErrorListener.getScriptExceptions()); assertEquals("", javaScriptErrorListener.getLoadScriptErrors()); assertEquals("", javaScriptErrorListener.getMalformedScriptURLErrors()); @@ -133,7 +136,8 @@ public void listenForLoadScriptError() throws Exception { getMockWebConnection().setDefaultResponse("", 500, "Server Error", MimeType.TEXT_HTML); - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -165,7 +169,8 @@ public void listenForMalformedScriptUrl() throws Exception { final CollectingJavaScriptErrorListener javaScriptErrorListener = new CollectingJavaScriptErrorListener(); webClient.setJavaScriptErrorListener(javaScriptErrorListener); - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "Throw JavaScript Error\n" + "\n" + "\n" @@ -187,7 +192,8 @@ public void listenForMalformedScriptUrl() throws Exception { * Configured with a timeout as the build server seemed to have problem with this test from time to time. * @throws Exception if the test fails */ - @Test(timeout = 10_000) + @Test + @Timeout(10) public void listenForTimeoutError() throws Exception { final WebClient webClient = getWebClient(); webClient.getOptions().setThrowExceptionOnScriptError(false); @@ -195,7 +201,8 @@ public void listenForTimeoutError() throws Exception { webClient.setJavaScriptErrorListener(javaScriptErrorListener); webClient.setJavaScriptTimeout(100); - final String html = "Throw JavaScript Timeout Error\n" + final String html = DOCTYPE_HTML + + "Throw JavaScript Timeout Error\n" + "\n" + ""; diff --git a/src/test/java/org/htmlunit/javascript/NativeArrayTest.java b/src/test/java/org/htmlunit/javascript/NativeArrayTest.java index c0cb8879e67..df2a660c492 100644 --- a/src/test/java/org/htmlunit/javascript/NativeArrayTest.java +++ b/src/test/java/org/htmlunit/javascript/NativeArrayTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,11 +15,9 @@ package org.htmlunit.javascript; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; +import org.junit.jupiter.api.Test; /** * Array is a native JavaScript object and therefore provided by Rhino but behavior should be @@ -30,7 +28,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class NativeArrayTest extends WebDriverTestCase { /** @@ -44,8 +41,8 @@ public class NativeArrayTest extends WebDriverTestCase { @HtmlUnitNYI(FF = {"5<>1", "2<>5", "2<>5", "2<>1", "1<>2", "1<>1", "9<>2", "9<>5"}, FF_ESR = {"5<>1", "2<>5", "2<>5", "2<>1", "1<>2", "1<>1", "9<>2", "9<>5"}) public void sortSteps() throws Exception { - final String html - = "\n" @@ -273,8 +271,8 @@ public void constructorToString() throws Exception { @Test @Alerts({"mandarin", "", "mandarin"}) public void shiftOneElement() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + + ""; + + loadPageVerifyTitle2(html); + } +} diff --git a/src/test/java/org/htmlunit/javascript/NativeDate2Test.java b/src/test/java/org/htmlunit/javascript/NativeDate2Test.java index fd0290b24db..cc82bf76094 100644 --- a/src/test/java/org/htmlunit/javascript/NativeDate2Test.java +++ b/src/test/java/org/htmlunit/javascript/NativeDate2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,123 +18,174 @@ import org.htmlunit.BrowserVersion; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.BuggyWebDriver; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.BuggyWebDriver; +import org.htmlunit.junit.annotation.HtmlUnitNYI; +import org.junit.jupiter.api.Test; /** * Test for the Date support. * * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class NativeDate2Test extends WebDriverTestCase { + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T22:23:00.000Z") public void ctorDateTimeStringGMT() throws Exception { ctorDateTimeString("new Date('2021-12-18T22:23:00.000+00:00').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T22:23:00.000Z") public void ctorDateTimeStringGMT2() throws Exception { ctorDateTimeString("new Date('Sat, 18 Dec 2021 22:23:00 GMT').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T22:23:00.000Z") public void ctorDateTimeStringUTC() throws Exception { ctorDateTimeString("new Date('2021-12-18T22:23:00.000+00:00').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T22:23:00.000Z") public void ctorDateTimeStringUTC2() throws Exception { ctorDateTimeString("new Date('Sat, 18 Dec 2021 22:23:00 UTC').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T22:23:00.000Z") public void ctorDateTimeStringUT() throws Exception { ctorDateTimeString("new Date('Sat, 18 Dec 2021 22:23:00 UT').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T12:23:00.000Z") public void ctorDateTimeStringEST() throws Exception { ctorDateTimeString("new Date('2021-12-18T17:23:00.000+05:00').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-19T03:23:00.000Z") public void ctorDateTimeStringEST2() throws Exception { ctorDateTimeString("new Date('Sat, 18 Dec 2021 22:23:00 EST').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-19T02:23:00.000Z") public void ctorDateTimeStringEDT() throws Exception { ctorDateTimeString("new Date('Sat, 18 Dec 2021 22:23:00 EDT').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-19T04:23:00.000Z") public void ctorDateTimeStringCST() throws Exception { ctorDateTimeString("new Date('Sat, 18 Dec 2021 22:23:00 CST').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-19T03:23:00.000Z") public void ctorDateTimeStringCDT() throws Exception { ctorDateTimeString("new Date('Sat, 18 Dec 2021 22:23:00 CDT').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-19T05:23:00.000Z") public void ctorDateTimeStringMST() throws Exception { ctorDateTimeString("new Date('Sat, 18 Dec 2021 22:23:00 MST').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-19T04:23:00.000Z") public void ctorDateTimeStringMDT() throws Exception { ctorDateTimeString("new Date('Sat, 18 Dec 2021 22:23:00 MDT').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-19T06:23:00.000Z") public void ctorDateTimeStringPST() throws Exception { ctorDateTimeString("new Date('Sat, 18 Dec 2021 22:23:00 PST').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-19T05:23:00.000Z") public void ctorDateTimeStringPDT() throws Exception { ctorDateTimeString("new Date('Sat, 18 Dec 2021 22:23:00 PDT').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T18:23:00.000Z") public void ctorDateTimeStringBerlin() throws Exception { ctorDateTimeString("new Date('2021-12-18T17:23:00.000-01:00').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-19T02:23:00.000Z") public void ctorDateTimeStringTokyo() throws Exception { ctorDateTimeString("new Date('2021-12-18T17:23:00.000-09:00').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-19T02:23:00.000Z") public void ctorDateTimeStringJST() throws Exception { ctorDateTimeString("new Date('2021-12-18T17:23:00.000-09:00').toISOString()"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T12:23:00.000Z") public void ctorDateTimeStringNewYork() throws Exception { @@ -142,8 +193,8 @@ public void ctorDateTimeStringNewYork() throws Exception { } private void ctorDateTimeString(final String js) throws Exception { - final String html - = "\n" @@ -152,6 +203,9 @@ private void ctorDateTimeString(final String js) throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T22:23:00.000Z") @BuggyWebDriver(FF = "2021-12-18T21:23:00.000Z", @@ -160,6 +214,9 @@ public void ctorDateTimeGMT() throws Exception { ctorDateTime("GMT"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T22:23:00.000Z") @BuggyWebDriver(FF = "2021-12-18T21:23:00.000Z", @@ -168,6 +225,9 @@ public void ctorDateTimeUTC() throws Exception { ctorDateTime("UTC"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-19T03:23:00.000Z") @BuggyWebDriver(FF = "2021-12-18T21:23:00.000Z", @@ -176,12 +236,18 @@ public void ctorDateTimeEST() throws Exception { ctorDateTime("EST"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T21:23:00.000Z") public void ctorDateTimeBerlin() throws Exception { ctorDateTime("Europe/Berlin"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T13:23:00.000Z") @BuggyWebDriver(FF = "2021-12-18T21:23:00.000Z", @@ -190,6 +256,9 @@ public void ctorDateTimeTokyo() throws Exception { ctorDateTime("Asia/Tokyo"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T13:23:00.000Z") @BuggyWebDriver(FF = "2021-12-18T21:23:00.000Z", @@ -198,6 +267,9 @@ public void ctorDateTimeJST() throws Exception { ctorDateTime("JST"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-19T03:23:00.000Z") @BuggyWebDriver(FF = "2021-12-18T21:23:00.000Z", @@ -207,8 +279,8 @@ public void ctorDateTimeNewYork() throws Exception { } private void ctorDateTime(final String tz) throws Exception { - final String html - = "\n" @@ -228,42 +300,63 @@ private void ctorDateTime(final String tz) throws Exception { } } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T00:00:00.000Z") public void ctorDateGMT() throws Exception { ctorDate("GMT"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T00:00:00.000Z") public void ctorDateUTC() throws Exception { ctorDate("UTC"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T00:00:00.000Z") public void ctorDateEST() throws Exception { ctorDate("EST"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T00:00:00.000Z") public void ctorDateBerlin() throws Exception { ctorDate("Europe/Berlin"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T00:00:00.000Z") public void ctorDateNewYork() throws Exception { ctorDate("America/New_York"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T00:00:00.000Z") public void ctorDateTokyo() throws Exception { ctorDate("Asia/Tokyo"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021-12-18T00:00:00.000Z") public void ctorDateJST() throws Exception { @@ -271,8 +364,8 @@ public void ctorDateJST() throws Exception { } private void ctorDate(final String tz) throws Exception { - final String html - = "\n" @@ -292,11 +385,14 @@ private void ctorDate(final String tz) throws Exception { } } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2000-02-28T23:59:59.000Z") public void ctorInt() throws Exception { - final String html - = "\n" @@ -305,11 +401,14 @@ public void ctorInt() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2035-11-30T01:46:40.000Z") public void ctorDouble() throws Exception { - final String html - = "\n" @@ -318,6 +417,9 @@ public void ctorDouble() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("12/18/2021, 10:23:00 PM") @HtmlUnitNYI(CHROME = "12/18/21, 10:23 PM", @@ -328,6 +430,9 @@ public void toLocaleEnUs() throws Exception { toLocale("new Date('2021-12-18T22:23').toLocaleString('en-US')"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("12/18/2021") @HtmlUnitNYI(CHROME = "12/18/21", @@ -338,6 +443,9 @@ public void toLocaleEnUsDate() throws Exception { toLocale("new Date('2021-12-18T22:23').toLocaleDateString('en-US')"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("10:23:00 PM") @HtmlUnitNYI(CHROME = "10:23 PM", @@ -348,6 +456,9 @@ public void toLocaleEnUsTime() throws Exception { toLocale("new Date('2021-12-18T22:23').toLocaleTimeString('en-US')"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("18.12.2021, 22:23:00") @HtmlUnitNYI(CHROME = "18.12.21, 22:23", @@ -358,6 +469,9 @@ public void toLocaleDeDe() throws Exception { toLocale("new Date('2021-12-18T22:23').toLocaleString('de-DE')"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("18.12.2021") @HtmlUnitNYI(CHROME = "18.12.21", @@ -368,6 +482,9 @@ public void toLocaleDeDeDate() throws Exception { toLocale("new Date('2021-12-18T22:23').toLocaleDateString('de-DE')"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("22:23:00") @HtmlUnitNYI(CHROME = "22:23", @@ -378,6 +495,9 @@ public void toLocaleDeDeTime() throws Exception { toLocale("new Date('2021-12-18T22:23').toLocaleTimeString('de-DE')"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021/12/18 22:23:00") @HtmlUnitNYI(CHROME = "2021/12/18 22:23", @@ -388,12 +508,18 @@ public void toLocaleJaJp() throws Exception { toLocale("new Date('2021-12-18T22:23').toLocaleString('ja-JP')"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021/12/18") public void toLocaleJaJpDate() throws Exception { toLocale("new Date('2021-12-18T22:23').toLocaleDateString('ja-JP')"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("22:23:00") @HtmlUnitNYI(CHROME = "22:23", @@ -404,6 +530,9 @@ public void toLocaleJaJpTime() throws Exception { toLocale("new Date('2021-12-18T22:23').toLocaleTimeString('ja-JP')"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021/12/18 22:23:00") @HtmlUnitNYI(CHROME = "2021/12/18 22:23", @@ -414,12 +543,18 @@ public void toLocaleArray() throws Exception { toLocale("new Date('2021-12-18T22:23').toLocaleString(['foo', 'ja-JP', 'en-US'])"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("2021/12/18") public void toLocaleArrayDate() throws Exception { toLocale("new Date('2021-12-18T22:23').toLocaleDateString(['foo', 'ja-JP', 'en-US'])"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("22:23:00") @HtmlUnitNYI(CHROME = "22:23", @@ -431,8 +566,8 @@ public void toLocaleArrayTime() throws Exception { } private void toLocale(final String js) throws Exception { - final String html - = "\n" @@ -452,36 +587,54 @@ private void toLocale(final String js) throws Exception { } } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sat Dec 18 2021") public void toDateStringGMT() throws Exception { toDateString("GMT"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sat Dec 18 2021") public void toDateStringUTC() throws Exception { toDateString("UTC"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sat Dec 18 2021") public void toDateStringEST() throws Exception { toDateString("EST"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sat Dec 18 2021") public void toDateStringBerlin() throws Exception { toDateString("Europe/Berlin"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sat Dec 18 2021") public void toDateStringNewYork() throws Exception { toDateString("America/New_York"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sun Dec 19 2021") @BuggyWebDriver(FF = "Sat Dec 18 2021", @@ -490,6 +643,9 @@ public void toDateStringTokyo() throws Exception { toDateString("Asia/Tokyo"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sun Dec 19 2021") @BuggyWebDriver(FF = "Sat Dec 18 2021", @@ -499,8 +655,8 @@ public void toDateStringJST() throws Exception { } private void toDateString(final String tz) throws Exception { - final String html - = "\n" @@ -520,6 +676,9 @@ private void toDateString(final String tz) throws Exception { } } + /** + * @throws Exception if the test fails + */ @Test @Alerts("22:23:00 GMT+0000 (Greenwich Mean Time)") @BuggyWebDriver(FF = "23:23:00 GMT+0100 (Central European Standard Time)", @@ -532,6 +691,9 @@ public void toTimeStringGMT() throws Exception { toTimeString("GMT"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("22:23:00 GMT+0000 (Coordinated Universal Time)") @BuggyWebDriver(FF = "23:23:00 GMT+0100 (Central European Standard Time)", @@ -544,8 +706,11 @@ public void toTimeStringUTC() throws Exception { toTimeString("UTC"); } + /** + * @throws Exception if the test fails + */ @Test - @Alerts("17:23:00 GMT-0500 (GMT-05:00)") + @Alerts("17:23:00 GMT-0500 (Eastern Standard Time)") @BuggyWebDriver(FF = "23:23:00 GMT+0100 (Central European Standard Time)", FF_ESR = "23:23:00 GMT+0100 (Central European Standard Time)") @HtmlUnitNYI(CHROME = "17:23:00 GMT-0500 (-05:00)", @@ -556,6 +721,9 @@ public void toTimeStringEST() throws Exception { toTimeString("EST"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("23:23:00 GMT+0100 (Central European Standard Time)") @HtmlUnitNYI(CHROME = "23:23:00 GMT+0100 (CET)", @@ -566,6 +734,9 @@ public void toTimeStringBerlin() throws Exception { toTimeString("Europe/Berlin"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("17:23:00 GMT-0500 (Eastern Standard Time)") @BuggyWebDriver(FF = "23:23:00 GMT+0100 (Central European Standard Time)", @@ -578,6 +749,9 @@ public void toTimeStringNewYork() throws Exception { toTimeString("America/New_York"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("07:23:00 GMT+0900 (Japan Standard Time)") @BuggyWebDriver(FF = "23:23:00 GMT+0100 (Central European Standard Time)", @@ -590,6 +764,9 @@ public void toTimeStringTokyo() throws Exception { toTimeString("Asia/Tokyo"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("07:23:00 GMT+0900 (Japan Standard Time)") @BuggyWebDriver(FF = "23:23:00 GMT+0100 (Central European Standard Time)", @@ -603,8 +780,8 @@ public void toTimeStringJST() throws Exception { } private void toTimeString(final String tz) throws Exception { - final String html - = "\n" @@ -624,42 +801,63 @@ private void toTimeString(final String tz) throws Exception { } } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sat, 18 Dec 2021 22:23:00 GMT") public void toUTCStringGMT() throws Exception { toUTCString("GMT"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sat, 18 Dec 2021 22:23:00 GMT") public void toUTCStringUTC() throws Exception { toUTCString("UTC"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sat, 18 Dec 2021 22:23:00 GMT") public void toUTCStringEST() throws Exception { toUTCString("EST"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sat, 18 Dec 2021 22:23:00 GMT") public void toUTCStringBerlin() throws Exception { toUTCString("Europe/Berlin"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sat, 18 Dec 2021 22:23:00 GMT") public void toUTCStringNewYork() throws Exception { toUTCString("America/New_York"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sat, 18 Dec 2021 22:23:00 GMT") public void toUTCStringTokyo() throws Exception { toUTCString("Asia/Tokyo"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("Sat, 18 Dec 2021 22:23:00 GMT") public void toUTCStringJST() throws Exception { @@ -667,8 +865,8 @@ public void toUTCStringJST() throws Exception { } private void toUTCString(final String tz) throws Exception { - final String html - = "\n" @@ -688,6 +886,9 @@ private void toUTCString(final String tz) throws Exception { } } + /** + * @throws Exception if the test fails + */ @Test @Alerts("0") @BuggyWebDriver(FF = "-60", @@ -696,6 +897,9 @@ public void timezoneOffsetGMT() throws Exception { timezoneOffset("GMT"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("0") @BuggyWebDriver(FF = "-60", @@ -704,6 +908,9 @@ public void timezoneOffsetUTC() throws Exception { timezoneOffset("UTC"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("300") @BuggyWebDriver(FF = "-60", @@ -712,12 +919,18 @@ public void timezoneOffsetEST() throws Exception { timezoneOffset("EST"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("-60") public void timezoneOffsetBerlin() throws Exception { timezoneOffset("Europe/Berlin"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("300") @BuggyWebDriver(FF = "-60", @@ -726,6 +939,9 @@ public void timezoneOffsetNewYork() throws Exception { timezoneOffset("America/New_York"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("-540") @BuggyWebDriver(FF = "-60", @@ -734,6 +950,9 @@ public void timezoneOffsetTokyo() throws Exception { timezoneOffset("Asia/Tokyo"); } + /** + * @throws Exception if the test fails + */ @Test @Alerts("-540") @BuggyWebDriver(FF = "-60", @@ -743,8 +962,8 @@ public void timezoneOffsetJST() throws Exception { } private void timezoneOffset(final String tz) throws Exception { - final String html - = "\n" diff --git a/src/test/java/org/htmlunit/javascript/NativeDateTest.java b/src/test/java/org/htmlunit/javascript/NativeDateTest.java index cab218760c9..0fcefa2a580 100644 --- a/src/test/java/org/htmlunit/javascript/NativeDateTest.java +++ b/src/test/java/org/htmlunit/javascript/NativeDateTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,8 @@ package org.htmlunit.javascript; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; /** * Date is a native JavaScript object and therefore provided by Rhino but behavior should be @@ -29,7 +27,6 @@ * @author Frank Danek * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class NativeDateTest extends WebDriverTestCase { /** @@ -40,8 +37,8 @@ public class NativeDateTest extends WebDriverTestCase { @Test @Alerts({"-13", "84", "109"}) public void getYear() throws Exception { - final String html - = "\n" + ""; @@ -420,7 +426,8 @@ public void commaOperatorFunctionTry() throws Exception { @Test @Alerts("my y var") public void commaOperatorFunctionCall() throws Exception { - final String html = "\n" + "\n" @@ -500,7 +509,8 @@ public void callWithNullContext() throws Exception { @Test @Alerts("a=[object Window]") public void callWithUndefinedContext() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -526,7 +536,8 @@ public void callWithUndefinedContext() throws Exception { @Test @Alerts({"configurable: true", "enumerable: false", "writable: false"}) public void functionLength() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/javascript/NativeMapTest.java b/src/test/java/org/htmlunit/javascript/NativeMapTest.java index 8685d2e8455..f10da143b07 100644 --- a/src/test/java/org/htmlunit/javascript/NativeMapTest.java +++ b/src/test/java/org/htmlunit/javascript/NativeMapTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,17 +15,14 @@ package org.htmlunit.javascript; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; /** * Native JavaScript object Map. * * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class NativeMapTest extends WebDriverTestCase { /** @@ -35,8 +32,8 @@ public class NativeMapTest extends WebDriverTestCase { @Test @Alerts({"key type string", "value type object"}) public void entries() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" @@ -262,7 +260,8 @@ public void toStringRhinoBug538172() throws Exception { @Test @Alerts("12,345") public void toLocaleString() throws Exception { - final String html = "\n" @@ -276,7 +275,8 @@ public void toLocaleString() throws Exception { @Test @Alerts("12.345") public void toLocaleStringDe() throws Exception { - final String html = "\n" @@ -290,7 +290,8 @@ public void toLocaleStringDe() throws Exception { @Test @Alerts("12,345") public void toLocaleStringEnUS() throws Exception { - final String html = "\n" @@ -304,7 +305,8 @@ public void toLocaleStringEnUS() throws Exception { @Test @Alerts("12,345") public void toLocaleStringNoParam() throws Exception { - final String html = "\n" + ""; loadPageVerifyTitle2(html); diff --git a/src/test/java/org/htmlunit/javascript/NativeObjectTest.java b/src/test/java/org/htmlunit/javascript/NativeObjectTest.java index 412865af91d..da0c5141a69 100644 --- a/src/test/java/org/htmlunit/javascript/NativeObjectTest.java +++ b/src/test/java/org/htmlunit/javascript/NativeObjectTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,11 +15,9 @@ package org.htmlunit.javascript; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; +import org.junit.jupiter.api.Test; /** * Object is a native JavaScript object and therefore provided by Rhino but some tests are needed here @@ -31,7 +29,6 @@ * @author Natasha Lazarova * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class NativeObjectTest extends WebDriverTestCase { /** @@ -75,8 +72,8 @@ public void others() throws Exception { @Test @Alerts("1") public void assign() throws Exception { - final String html - = "\n" + "\n" @@ -254,14 +251,14 @@ public void getPrototypeOfString() throws Exception { @Test @Alerts("true") public void getPrototypeOfNumber() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -277,14 +274,14 @@ public void getPrototypeOfNumber() throws Exception { @Test @Alerts("true") public void getPrototypeOfBoolean() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -300,14 +297,14 @@ public void getPrototypeOfBoolean() throws Exception { @Test @Alerts("object") public void getTypeOfPrototypeOfNumber() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -323,7 +320,7 @@ public void getTypeOfPrototypeOfNumber() throws Exception { @Test @Alerts({"2", "true", "true"}) public void getOwnPropertySymbols() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -354,9 +351,9 @@ public void getOwnPropertySymbols() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("TypeError") public void getOwnPropertySymbolsEmpty() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -383,7 +380,7 @@ public void getOwnPropertySymbolsEmpty() throws Exception { FF = {"[object HTMLInputElement]", "[object HTMLInputElement]", "[object Object]", "function"}, FF_ESR = {"[object HTMLInputElement]", "[object HTMLInputElement]", "[object Object]", "function"}) public void getOwnPropertyDescriptor() throws Exception { - final String html = "" + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -428,7 +425,8 @@ public void getOwnPropertyDescriptor() throws Exception { "x.get = function value() { [native code] }", "x.get.call = function call() { [native code] }"}) public void getOwnPropertyDescriptorGetCall() throws Exception { - final String html = "\n" + "\n" @@ -200,7 +210,8 @@ public void ctorChangeableHasNoEffectForTypeOf() throws Exception { @Test @Alerts({"true", "false", "true", "ctor", "true"}) public void ctorChangeableHasNoEffectForTypeOfStrict() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -231,7 +242,8 @@ public void ctorChangeableHasNoEffectForTypeOfStrict() throws Exception { @Test @Alerts("true") public void ctorChangeableHasNoEffectForSealed() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/javascript/ThreadTest.java b/src/test/java/org/htmlunit/javascript/ThreadTest.java index 4a9404ea558..141a03ae082 100644 --- a/src/test/java/org/htmlunit/javascript/ThreadTest.java +++ b/src/test/java/org/htmlunit/javascript/ThreadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,31 +23,22 @@ import org.htmlunit.WebClient; import org.htmlunit.WebTestCase; import org.htmlunit.html.HtmlPage; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.RepeatedTest; /** * Multi-threaded JavaScript engine test. * * @author David D. Kilzer * @author Ahmed Ashour + * @author Ronald Brill */ -public class ThreadTest extends TestCase { - - /** - * Creates a new instance. - * @param name the name of the test - */ - public ThreadTest(final String name) { - super(name); - } +public class ThreadTest { /** * @throws InterruptedException if the test fails */ - public void testJavaScriptEngineInMultipleThreads() throws InterruptedException { + private void testJavaScriptEngineInMultipleThreads() throws InterruptedException { final TestThread thread1 = new TestThread("thread1"); final TestThread thread2 = new TestThread("thread2"); final TestThread thread3 = new TestThread("thread3"); @@ -63,23 +54,18 @@ public void testJavaScriptEngineInMultipleThreads() throws InterruptedException thread3.join(); thread4.join(); - assertTrue("thread1 not successful", thread1.isSuccessful()); - assertTrue("thread2 not successful", thread2.isSuccessful()); - assertTrue("thread3 not successful", thread3.isSuccessful()); - assertTrue("thread4 not successful", thread4.isSuccessful()); + Assertions.assertTrue(thread1.isSuccessful(), "thread1 not successful"); + Assertions.assertTrue(thread2.isSuccessful(), "thread2 not successful"); + Assertions.assertTrue(thread3.isSuccessful(), "thread3 not successful"); + Assertions.assertTrue(thread4.isSuccessful(), "thread4 not successful"); } /** - * Runs this test many times. - * @return a suite + * Repeated test - runs the multi-threaded test 99 times. */ - public static Test suite() { - final TestSuite suite = new TestSuite("Run this many times"); - suite.addTestSuite(ThreadTest.class); - for (int i = 1; i < 100; i++) { - suite.addTest(new ThreadTest("testJavaScriptEngineInMultipleThreads")); - } - return suite; + @RepeatedTest(value = 99, name = "Multi-threaded JS test repetition {currentRepetition}/{totalRepetitions}") + public void repeatedMultiThreadTest() throws InterruptedException { + testJavaScriptEngineInMultipleThreads(); } /** A test object for threads. */ @@ -95,7 +81,9 @@ private static class TestThread extends Thread { super(name); } - /** @see Thread#run() */ + /** + * @see Thread#run() + */ @Override public void run() { try { @@ -109,7 +97,9 @@ public void run() { } } - /** @return true if the test was successful */ + /** + * @return true if the test was successful + */ public boolean isSuccessful() { return successful_; } @@ -119,8 +109,8 @@ public boolean isSuccessful() { * @throws Exception if the test failed */ public void testCallInheritedFunction() throws Exception { - final String html - = "foo\n" + ""; - final String thirdContent = "Third"; + final String thirdContent = DOCTYPE_HTML + + "Third"; final MockWebConnection webConnection = getMockWebConnection(); webConnection.setResponse(URL_SECOND, secondContent); @@ -179,7 +181,8 @@ public void navigationStopThreadsInChildWindows() throws Exception { */ @Test public void interruptAllWithRecursiveSetTimeout() throws Exception { - final String content = "\n" + final String content = DOCTYPE_HTML + + "\n" + "\n" + " test\n" + " "); + conn.setResponse(URL_FIRST, + DOCTYPE_HTML + ""); client.setWebConnection(conn); client.getPage(URL_FIRST); diff --git a/src/test/java/org/htmlunit/javascript/configuration/ClassConfigurationTest.java b/src/test/java/org/htmlunit/javascript/configuration/ClassConfigurationTest.java index 89db9de2330..d8fc708d74a 100644 --- a/src/test/java/org/htmlunit/javascript/configuration/ClassConfigurationTest.java +++ b/src/test/java/org/htmlunit/javascript/configuration/ClassConfigurationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,17 +14,18 @@ */ package org.htmlunit.javascript.configuration; -import org.htmlunit.SimpleWebTestCase; import org.htmlunit.javascript.HtmlUnitScriptable; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; /** * Tests for {@link ClassConfiguration}. * * @author Chris Erskine * @author Ahmed Ashour + * @author Ronald Brill */ -public class ClassConfigurationTest extends SimpleWebTestCase { +public class ClassConfigurationTest { /** * @throws Exception on error @@ -32,7 +33,7 @@ public class ClassConfigurationTest extends SimpleWebTestCase { @Test public void forJSFlagTrue() throws Exception { final ClassConfiguration config1 = new ClassConfiguration(ConfigTestClass.class, null, true, null, ""); - assertTrue("JSObject Flag should have been set", config1.isJsObject()); + Assertions.assertTrue(config1.isJsObject(), "JSObject Flag should have been set"); } /** @@ -41,7 +42,7 @@ public void forJSFlagTrue() throws Exception { @Test public void forJSFlagFalse() throws Exception { final ClassConfiguration config1 = new ClassConfiguration(ConfigTestClass.class, null, false, null, ""); - assertFalse("JSObject Flag should not have been set", config1.isJsObject()); + Assertions.assertFalse(config1.isJsObject(), "JSObject Flag should not have been set"); } /** diff --git a/src/test/java/org/htmlunit/javascript/configuration/JavaScriptConfigurationTest.java b/src/test/java/org/htmlunit/javascript/configuration/JavaScriptConfigurationTest.java index 2fb1fd227ec..6e96a5fb33e 100644 --- a/src/test/java/org/htmlunit/javascript/configuration/JavaScriptConfigurationTest.java +++ b/src/test/java/org/htmlunit/javascript/configuration/JavaScriptConfigurationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ package org.htmlunit.javascript.configuration; import static org.htmlunit.BrowserVersion.FIREFOX; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.File; import java.io.IOException; @@ -24,7 +24,9 @@ import java.net.URL; import java.text.MessageFormat; import java.util.ArrayList; +import java.util.Collections; import java.util.Enumeration; +import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; @@ -36,11 +38,12 @@ import org.apache.commons.text.RandomStringGenerator; import org.htmlunit.BrowserVersion; import org.htmlunit.MockWebConnection; -import org.htmlunit.SimpleWebTestCase; import org.htmlunit.WebClient; +import org.htmlunit.WebTestCase; import org.htmlunit.javascript.HtmlUnitScriptable; import org.htmlunit.javascript.JavaScriptEngine; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; /** * Tests for {@link JavaScriptConfiguration}. @@ -51,7 +54,7 @@ * @author Frank Danek * @author Joerg Werner */ -public class JavaScriptConfigurationTest extends SimpleWebTestCase { +public class JavaScriptConfigurationTest { private static final Log LOG = LogFactory.getLog(JavaScriptConfigurationTest.class); @@ -165,7 +168,7 @@ else if (klass.getAnnotation(JsxClass.class) != null) { } foundJsxClasses.removeAll(definedClasses); if (!foundJsxClasses.isEmpty()) { - fail("Class " + foundJsxClasses.get(0) + " is not in JavaScriptConfiguration.CLASSES_"); + Assertions.fail("Class " + foundJsxClasses.get(0) + " is not in JavaScriptConfiguration.CLASSES_"); } } @@ -253,26 +256,64 @@ public void obsoleteJsxClasses() { break; } } - assertTrue("Class " + klass - + " is member of JavaScriptConfiguration.CLASSES_ but does not define @JsxClasses/@JsxClass", - found); + Assertions.assertTrue(found, "Class " + klass + + " is member of JavaScriptConfiguration.CLASSES_ but does not define @JsxClasses/@JsxClass"); } } /** - * Test of alphabetical order. + * Test of order. */ @Test - public void lexicographicOrder() { - String lastClassName = null; + public void treeOrder() { + final List defined = new ArrayList<>(JavaScriptConfiguration.CLASSES_.length); + + final HashMap> levels = new HashMap<>(); for (final Class c : JavaScriptConfiguration.CLASSES_) { - final String name = c.getSimpleName(); - if (lastClassName != null && name.compareToIgnoreCase(lastClassName) < 0) { - fail("JavaScriptConfiguration.CLASSES_: '" - + name + "' should be before '" + lastClassName + "'"); + defined.add(c.getSimpleName()); + + int level = 1; + Class parent = c.getSuperclass(); + while (parent != HtmlUnitScriptable.class) { + level++; + parent = parent.getSuperclass(); + } + + List clsAtLevel = levels.get(level); + if (clsAtLevel == null) { + clsAtLevel = new ArrayList<>(); + levels.put(level, clsAtLevel); + } + clsAtLevel.add(c.getSimpleName()); + } + + final List all = new ArrayList<>(JavaScriptConfiguration.CLASSES_.length); + for (int level = 1; level <= levels.size(); level++) { + final List clsAtLevel = levels.get(level); + Collections.sort(clsAtLevel); + all.addAll(clsAtLevel); + + // dump + /* + final String indent = " "; + System.out.println(indent + " // level " + level); + + System.out.print(indent); + int chars = indent.length(); + for (final String cls : clsAtLevel) { + final String toPrint = " " + cls + ".class,"; + chars += toPrint.length(); + if (chars > 120) { + System.out.println(); + System.out.print(indent); + chars = indent.length() + toPrint.length(); + } + System.out.print(toPrint); } - lastClassName = name; + System.out.println(); + */ } + assertEquals(all, defined); } /** @@ -317,7 +358,8 @@ public void clonedAndModified() throws Exception { private static void test(final BrowserVersion browserVersion) throws IOException { try (WebClient webClient = new WebClient(browserVersion)) { final MockWebConnection conn = new MockWebConnection(); - conn.setDefaultResponse(""); + conn.setDefaultResponse(WebTestCase.DOCTYPE_HTML + + ""); webClient.setWebConnection(conn); webClient.getPage("http://localhost/"); diff --git a/src/test/java/org/htmlunit/javascript/configuration/WorkerJavaScriptConfigurationTest.java b/src/test/java/org/htmlunit/javascript/configuration/WorkerJavaScriptConfigurationTest.java new file mode 100644 index 00000000000..19bc9a88660 --- /dev/null +++ b/src/test/java/org/htmlunit/javascript/configuration/WorkerJavaScriptConfigurationTest.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2002-2025 Gargoyle Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.htmlunit.javascript.configuration; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; + +import org.htmlunit.javascript.HtmlUnitScriptable; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +/** + * Tests for {@link WorkerJavaScriptConfiguration}. + * + * @author Ronald Brill + */ +public class WorkerJavaScriptConfigurationTest { + + /** + * Test of order. + */ + @Test + public void treeOrder() { + final List defined = new ArrayList<>(WorkerJavaScriptConfiguration.CLASSES_.length); + + final HashMap> levels = new HashMap<>(); + for (final Class c : WorkerJavaScriptConfiguration.CLASSES_) { + defined.add(c.getSimpleName()); + + int level = 1; + Class parent = c.getSuperclass(); + while (parent != HtmlUnitScriptable.class) { + level++; + parent = parent.getSuperclass(); + } + + List clsAtLevel = levels.get(level); + if (clsAtLevel == null) { + clsAtLevel = new ArrayList<>(); + levels.put(level, clsAtLevel); + } + clsAtLevel.add(c.getSimpleName()); + } + + final List all = new ArrayList<>(WorkerJavaScriptConfiguration.CLASSES_.length); + for (int level = 1; level <= levels.size(); level++) { + final List clsAtLevel = levels.get(level); + Collections.sort(clsAtLevel); + all.addAll(clsAtLevel); + + // dump + /* + final String indent = " "; + System.out.println(indent + " // level " + level); + + System.out.print(indent); + int chars = indent.length(); + for (final String cls : clsAtLevel) { + final String toPrint = " " + cls + ".class,"; + chars += toPrint.length(); + if (chars > 120) { + System.out.println(); + System.out.print(indent); + chars = indent.length() + toPrint.length(); + } + System.out.print(toPrint); + } + System.out.println(); + */ + } + Assertions.assertEquals(all, defined); + } +} diff --git a/src/test/java/org/htmlunit/javascript/host/ActiveXObject2Test.java b/src/test/java/org/htmlunit/javascript/host/ActiveXObject2Test.java index b27f64e4824..f49663e2a5a 100644 --- a/src/test/java/org/htmlunit/javascript/host/ActiveXObject2Test.java +++ b/src/test/java/org/htmlunit/javascript/host/ActiveXObject2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,8 @@ package org.htmlunit.javascript.host; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; /** * Tests for {@link ActiveXObject}. @@ -28,7 +26,6 @@ * @author Frank Danek * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class ActiveXObject2Test extends WebDriverTestCase { /** @@ -37,7 +34,8 @@ public class ActiveXObject2Test extends WebDriverTestCase { @Test @Alerts({"undefined", "undefined", "NaN", "false", "No", "No", "No", "No"}) public void browserDetection() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -87,7 +86,8 @@ public void xmlDocument() throws Exception { @Test @Alerts("ActiveXObject undefined") public void activex() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + ""; diff --git a/src/test/java/org/htmlunit/javascript/host/ApplicationCacheTest.java b/src/test/java/org/htmlunit/javascript/host/ApplicationCacheTest.java index d0cc99d39d2..3e9936bf9bf 100644 --- a/src/test/java/org/htmlunit/javascript/host/ApplicationCacheTest.java +++ b/src/test/java/org/htmlunit/javascript/host/ApplicationCacheTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,11 +15,8 @@ package org.htmlunit.javascript.host; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.html.HtmlPageTest; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; /** * Tests for {@link ApplicationCache}. @@ -28,7 +25,6 @@ * @author Frank Danek * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class ApplicationCacheTest extends WebDriverTestCase { /** @@ -37,7 +33,7 @@ public class ApplicationCacheTest extends WebDriverTestCase { @Test @Alerts("undefined") public void scriptableToString() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + " \n" @@ -69,10 +67,10 @@ public void elementAttributes() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("TypeError") public void positionAndSizeAttributes() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n" + "
daniel
\n" @@ -85,7 +83,7 @@ public void positionAndSizeAttributes() throws Exception { + " log(box.x + '-' + box.y);\n" + " log(box.screenX + '-' + box.screenY);\n" + " log(box.width + '-' + box.height);\n" - + " } catch (e) {log('exception')}\n" + + " } catch(e) { logEx(e) }\n" + " }\n" + " \n" + " \n" diff --git a/src/test/java/org/htmlunit/javascript/host/Console2Test.java b/src/test/java/org/htmlunit/javascript/host/Console2Test.java index d47e9e36eb3..468c01015d2 100644 --- a/src/test/java/org/htmlunit/javascript/host/Console2Test.java +++ b/src/test/java/org/htmlunit/javascript/host/Console2Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,11 +21,9 @@ import org.htmlunit.SimpleWebTestCase; import org.htmlunit.WebConsole; import org.htmlunit.WebConsole.Logger; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.htmlunit.util.MimeType; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Tests for Console. @@ -34,7 +32,6 @@ * @author Marc Guillemot * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class Console2Test extends SimpleWebTestCase { private final class LoggerMock implements Logger { @@ -95,7 +92,7 @@ public boolean isErrorEnabled() { * @throws Exception if the test fails */ @Test - @Alerts("info: [\"one\",\"two\",\"three\",\"[object HTMLCollection]\"]") + @Alerts("info: [\"one\",\"two\",\"three\",{}]") public void log() throws Exception { log("['one', 'two', 'three', document.body.children]"); } @@ -179,8 +176,8 @@ private void log(final String logInput) throws Exception { final List messages = new ArrayList<>(); console.setLogger(new LoggerMock(messages)); - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n"; loadPage(html); diff --git a/src/test/java/org/htmlunit/javascript/host/ConsoleTest.java b/src/test/java/org/htmlunit/javascript/host/ConsoleTest.java index d6d1bfd19f1..48ad90005fb 100644 --- a/src/test/java/org/htmlunit/javascript/host/ConsoleTest.java +++ b/src/test/java/org/htmlunit/javascript/host/ConsoleTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,11 +17,9 @@ import java.util.List; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.BuggyWebDriver; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.BuggyWebDriver; +import org.junit.jupiter.api.Test; import org.openqa.selenium.WebDriver; import org.openqa.selenium.logging.LogEntries; import org.openqa.selenium.logging.LogEntry; @@ -35,7 +33,6 @@ * @author Marc Guillemot * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class ConsoleTest extends WebDriverTestCase { /** @@ -44,8 +41,8 @@ public class ConsoleTest extends WebDriverTestCase { @Test @Alerts({"false", "object", "true"}) public void prototype() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + ""; @@ -66,8 +63,8 @@ public void prototype() throws Exception { @Test @Alerts({"true", "undefined", "false"}) public void prototypeUppercase() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + ""; @@ -88,8 +85,8 @@ public void prototypeUppercase() throws Exception { @Test @Alerts({}) public void timeStamp() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + ""; @@ -153,8 +150,8 @@ public void windowProperty() throws Exception { @Test @Alerts("success") public void fromWindow() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + ""; @@ -175,8 +172,8 @@ public void fromWindow() throws Exception { @Test @BuggyWebDriver public void simpleString() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -91,8 +88,8 @@ public void itemOutside() throws Exception { @Test @Alerts({"[object DOMRectList]", "1", "undefined", "undefined"}) public void indexOutside() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -123,8 +120,8 @@ public void indexOutside() throws Exception { @Test @Alerts({"[object DOMRectList]", "0", "undefined", "undefined"}) public void empty() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/javascript/host/ClientRectTest.java b/src/test/java/org/htmlunit/javascript/host/DOMRectTest.java similarity index 85% rename from src/test/java/org/htmlunit/javascript/host/ClientRectTest.java rename to src/test/java/org/htmlunit/javascript/host/DOMRectTest.java index 1f5ae385754..c5a6cc0ba7a 100644 --- a/src/test/java/org/htmlunit/javascript/host/ClientRectTest.java +++ b/src/test/java/org/htmlunit/javascript/host/DOMRectTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,18 +15,16 @@ package org.htmlunit.javascript.host; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; /** - * Tests for {@link ClientRect}. + * Tests for {@link DOMRect}. * * @author Ahmed Ashour + * @author Ronald Brill */ -@RunWith(BrowserRunner.class) -public class ClientRectTest extends WebDriverTestCase { +public class DOMRectTest extends WebDriverTestCase { /** * @throws Exception if the test fails @@ -34,7 +32,8 @@ public class ClientRectTest extends WebDriverTestCase { @Test @Alerts({"100", "400", "100", "450", "50", "0"}) public void properties() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "
\n" @@ -62,7 +61,8 @@ public void properties() throws Exception { @Test @Alerts({"true", "true"}) public void getBoundingClientRect_WidthPercent() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" @@ -115,7 +113,8 @@ public void selectNodes() throws Exception { @Test @Alerts({"2", "1"}) public void removeChild() throws Exception { - final String html = "\n" @@ -217,7 +218,8 @@ public void selectNode_root() throws Exception { @Test @Alerts({"1", "1"}) public void getElementsByTagNameNS() throws Exception { - final String html = "\n" @@ -248,7 +250,8 @@ public void getElementsByTagNameNS() throws Exception { @Test @Alerts({"1", "2", "3"}) public void getElementsByTagNameNSAsterisk() throws Exception { - final String html = "\n" @@ -280,7 +283,8 @@ public void getElementsByTagNameNSAsterisk() throws Exception { @Test @Alerts({"2", "Three", "Four", "1", "Two", "0", "0"}) public void getElementsByTagNameXml() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + ""; loadPageVerifyTitle2(html); @@ -325,7 +329,8 @@ public void getElementsByTagNameXml() throws Exception { @Test @Alerts("false") public void hasAttribute() throws Exception { - final String html = "\n" + "\n" @@ -755,7 +761,8 @@ public void enumeratedProperties() throws Exception { @Test @Alerts("finished") public void removeAttribute() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " "; loadPageVerifyTitle2(html); } @@ -805,7 +813,8 @@ public void getBoundingClientRect() throws Exception { @Test @Alerts("0") public void commentIsElement() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "
\n" + "\n" @@ -983,7 +995,8 @@ public void children() throws Exception { @Test @Alerts({"", "a b c"}) public void classList() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + "\n" + "\n" @@ -1200,7 +1218,7 @@ public void prototypConstructor() throws Exception { @Alerts({"function Element() { [native code] }", "[object Element]", "function Element() { [native code] }"}) public void prototypConstructorStandards() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" @@ -1386,7 +1404,7 @@ public void matchesInvalidSelector() throws Exception { @Test @Alerts({"TypeError", "done"}) public void matchesWindow() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" @@ -1419,7 +1437,7 @@ public void matchesWindow() throws Exception { @Test @Alerts({"div-02", "div-03", "div-01", "article-01", "null"}) public void closest() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + + ""; + + loadPageVerifyTitle2(html); + } } diff --git a/src/test/java/org/htmlunit/javascript/host/FontFaceSetTest.java b/src/test/java/org/htmlunit/javascript/host/FontFaceSetTest.java index ffd4b1feb04..85061768cd5 100644 --- a/src/test/java/org/htmlunit/javascript/host/FontFaceSetTest.java +++ b/src/test/java/org/htmlunit/javascript/host/FontFaceSetTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,17 +15,14 @@ package org.htmlunit.javascript.host; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; /** * Tests for {@link FontFaceSet}. * * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class FontFaceSetTest extends WebDriverTestCase { /** @@ -36,8 +33,8 @@ public class FontFaceSetTest extends WebDriverTestCase { FF = "function FontFaceSet() { [native code] }", FF_ESR = "function FontFaceSet() { [native code] }") public void window() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + + ""; + + loadPageVerifyTitle2(html); + } } diff --git a/src/test/java/org/htmlunit/javascript/host/FontFaceTest.java b/src/test/java/org/htmlunit/javascript/host/FontFaceTest.java index a6801f0f07b..9ed5efecce0 100644 --- a/src/test/java/org/htmlunit/javascript/host/FontFaceTest.java +++ b/src/test/java/org/htmlunit/javascript/host/FontFaceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,17 +15,14 @@ package org.htmlunit.javascript.host; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; /** * Tests for {@link FontFace}. * * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class FontFaceTest extends WebDriverTestCase { /** @@ -36,8 +33,8 @@ public class FontFaceTest extends WebDriverTestCase { CHROME = "function\\sFontFace()\\s{\\s[native\\scode]\\s}", EDGE = "function\\sFontFace()\\s{\\s[native\\scode]\\s}") public void window() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -375,7 +378,8 @@ public void pushStateLocationHref() throws Exception { "[object PopStateEvent]", "{\"hi2\":\"there2\"}", "[object PopStateEvent]", "{\"hi2\":\"there2\"}"}) public void replaceState() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -196,7 +194,8 @@ public void about_blank_query_attributes() throws Exception { @Test @Alerts({"", "about:blank?", "blank", "", "about:", ""}) public void about_blank_emptyquery_attributes() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" @@ -228,7 +227,8 @@ public void about_blank_emptyquery_attributes() throws Exception { @Test @Alerts({"#hash", "about:blank#hash", "blank", "", "about:", ""}) public void about_blank_hash_attributes() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" @@ -261,7 +261,8 @@ public void about_blank_hash_attributes() throws Exception { @Test @Alerts({"#hash", "about:blank?#hash", "blank", "", "about:", ""}) public void about_blank_emptyquery_hash_attributes() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" @@ -295,7 +296,8 @@ public void about_blank_emptyquery_hash_attributes() throws Exception { FF = {"#hash", "about:blank?query#hash", "blank", "", "about:", ""}, FF_ESR = {"#hash", "about:blank?query#hash", "blank", "", "about:", ""}) public void about_blank_query_hash_attributes() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" @@ -327,7 +329,8 @@ public void about_blank_query_hash_attributes() throws Exception { @Test @Alerts({"", "about:blank", "#foo", "about:blank#foo"}) public void about_blank_set_hash() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" @@ -381,7 +384,8 @@ public void noSearch() throws Exception { } private void checkSearch(final String url) throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; + final String html = DOCTYPE_HTML + + ""; loadPage2(html); } @@ -554,15 +566,16 @@ public void setHrefWithOnlyHash2() throws Exception { */ @Test public void replace() throws Exception { - final String html - = "First\n" + ""; - final String secondContent = "Second"; + final String secondContent = DOCTYPE_HTML + + "Second"; getMockWebConnection().setResponse(URL_SECOND, secondContent); final WebDriver driver = loadPage2(html); @@ -576,17 +589,19 @@ public void replace() throws Exception { */ @Test public void replaceLastInHistory() throws Exception { - final String startContent = "First Page"; + final String startContent = DOCTYPE_HTML + + "First Page"; - final String secondContent - = "Second Page\n" + ""; - final String thirdContent = "Third Page§"; + final String thirdContent = DOCTYPE_HTML + + "Third Page§"; getMockWebConnection().setResponse(URL_SECOND, secondContent); getMockWebConnection().setResponse(URL_THIRD, thirdContent); @@ -608,8 +623,8 @@ public void replaceLastInHistory() throws Exception { @Test @Alerts("on-load") public void replaceOnload() throws Exception { - final String html - = "First\n" + final String html = DOCTYPE_HTML + + "First\n" + "\n" + ""; - final String secondContent = "Second Page"; + final String secondContent = DOCTYPE_HTML + + "Second Page"; getMockWebConnection().setResponse(URL_SECOND, secondContent); @@ -658,15 +675,16 @@ public void replaceFirstInHistory() throws Exception { */ @Test public void assign() throws Exception { - final String firstContent - = "First\n" + ""; - final String secondContent = "Second"; + final String secondContent = DOCTYPE_HTML + + "Second"; getMockWebConnection().setResponse(URL_SECOND, secondContent); @@ -680,8 +698,8 @@ public void assign() throws Exception { @Test @Alerts("on-load") public void assignOnload() throws Exception { - final String firstContent - = "First\n" + ""; - final String secondContent = "Second"; + final String secondContent = DOCTYPE_HTML + + "Second"; getMockWebConnection().setResponse(URL_SECOND, secondContent); @@ -729,8 +749,8 @@ public void assingByEquals() throws Exception { @Test @Alerts("on-load") public void assingByEqualsOnload() throws Exception { - final String firstContent - = "First\n" @@ -775,8 +796,8 @@ public void changeLocationToNonHtml() throws Exception { @Test @Alerts("foo") public void jsLocation() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + " "; + final String secondHtml = DOCTYPE_HTML + + ""; getMockWebConnection().setResponse(URL_SECOND, secondHtml); @@ -839,8 +862,8 @@ public void href_postponed() throws Exception { @Test @Alerts({"", "foo3.html", "foo2.html"}) public void onlick_set_location_WithHref() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " click me\n" + ""; @@ -861,8 +884,8 @@ public void onlick_set_location_WithHref() throws Exception { @Test @Alerts({"", "foo3.html"}) public void onlick_set_location_WithoutHref() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " click me\n" + ""; @@ -881,8 +904,8 @@ public void onlick_set_location_WithoutHref() throws Exception { @Test @Alerts({"supported", "onhashchange §§URL§§#1 §§URL§§"}) public void onHashChange() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -987,18 +1012,19 @@ public void locationAfterOpenClosePopup() throws Exception { + " \n" + "\n" + ""; - final String popup = - "\n" + final String popup = DOCTYPE_HTML + + "\n" + "\n" + " popup with script\n" + " \n" + "\n" + "Popup\n" + ""; - final String target = - "\n" + final String target = DOCTYPE_HTML + + "\n" + "\n" + " target\n" + "\n" @@ -1011,13 +1037,9 @@ public void locationAfterOpenClosePopup() throws Exception { expandExpectedAlertsVariables(URL_FIRST); final WebDriver driver = loadPage2(html); driver.findElement(By.id("click")).click(); - try { - assertEquals(getExpectedAlerts()[0], driver.getCurrentUrl()); - } - finally { - releaseResources(); - shutDownAll(); - } + + verifySessionStorage2(driver, getExpectedAlerts()[0], getExpectedAlerts()[1], getExpectedAlerts()[2]); + assertEquals(getExpectedAlerts()[3], driver.getCurrentUrl()); } /** @@ -1026,13 +1048,15 @@ public void locationAfterOpenClosePopup() throws Exception { @Test @Alerts("§§URL§§") public void refererHeaderWhenSettingLocation() throws Exception { - final String html = "Base\n" + final String html = DOCTYPE_HTML + + "Base\n" + "\n" + " Link\n" + " jsLink\n" + ""; - final String content = "Content

content

"; + final String content = DOCTYPE_HTML + + "Content

content

"; final MockWebConnection conn = getMockWebConnection(); conn.setResponse(new URL(URL_FIRST, "content.html"), content); @@ -1045,7 +1069,7 @@ public void refererHeaderWhenSettingLocation() throws Exception { // click an anchor with href and target driver.findElement(By.id("link")).click(); // because real browsers are doing the open async, we have to be a bit patient - Thread.sleep(DEFAULT_WAIT_TIME); + Thread.sleep(DEFAULT_WAIT_TIME.toMillis()); assertEquals(2, conn.getRequestCount()); Map lastAdditionalHeaders = conn.getLastAdditionalHeaders(); @@ -1066,21 +1090,25 @@ public void refererHeaderWhenSettingLocation() throws Exception { @Test @Alerts("§§URL§§menu.html") public void refererHeaderWhenSettingFrameLocation() throws Exception { - final String html = "Frameset\n" + final String html = DOCTYPE_HTML + + "Frameset\n" + "\n" + " \n" + " \n" + ""; - final String menu = "Menu\n" + final String menu = DOCTYPE_HTML + + "Menu\n" + "\n" + " Link\n" + " jsLink\n" + ""; - final String content = "Content

content

"; - final String newContent = "New Content

new content

"; + final String content = DOCTYPE_HTML + + "Content

content

"; + final String newContent = DOCTYPE_HTML + + "New Content

new content

"; final MockWebConnection conn = getMockWebConnection(); conn.setResponse(new URL(URL_FIRST, "menu.html"), menu); @@ -1095,13 +1123,18 @@ public void refererHeaderWhenSettingFrameLocation() throws Exception { // click an anchor with href and target driver.switchTo().frame(0); driver.findElement(By.id("link")).click(); + if (useRealBrowser()) { + Thread.sleep(400); + } assertEquals(4, conn.getRequestCount()); Map lastAdditionalHeaders = conn.getLastAdditionalHeaders(); assertEquals(getExpectedAlerts()[0], lastAdditionalHeaders.get(HttpHeader.REFERER)); // click an anchor with onclick which sets frame.location driver.findElement(By.id("jsLink")).click(); - Thread.sleep(100); + if (useRealBrowser()) { + Thread.sleep(400); + } assertEquals(5, conn.getRequestCount()); lastAdditionalHeaders = conn.getLastAdditionalHeaders(); assertEquals(getExpectedAlerts()[0], lastAdditionalHeaders.get(HttpHeader.REFERER)); @@ -1113,8 +1146,8 @@ public void refererHeaderWhenSettingFrameLocation() throws Exception { @Test @Alerts("§§URL§§") public void origin() throws Exception { - final String html = - ""; @@ -1132,8 +1165,8 @@ public void origin() throws Exception { @Test @Alerts("§§URL§§") public void documentOrigin() throws Exception { - final String html = - ""; @@ -1153,8 +1186,8 @@ public void documentOrigin() throws Exception { CHROME = "§§URL§§a.html?p1=sieben&p2", EDGE = "§§URL§§a.html?p1=sieben&p2") public void reloadGet() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n" + " reload\n" @@ -1193,8 +1226,8 @@ public void reloadGet() throws Exception { FF = "null", FF_ESR = "null") public void reloadGetNoHash() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n" + " \n" @@ -1231,8 +1264,8 @@ public void reloadGetNoHash() throws Exception { FF = "null", FF_ESR = "null") public void reloadGetHashDetails() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n" @@ -249,10 +242,10 @@ public void constructorInt32Array() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("TypeError") public void constructorStringParam() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -273,10 +266,10 @@ public void constructorStringParam() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("TypeError") public void constructorSetParam() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -299,8 +292,8 @@ public void constructorSetParam() throws Exception { @Test @Alerts("2") public void constructorMapParam() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -365,8 +358,8 @@ public void constructorIteratorParam() throws Exception { "null", "key3", "[object Map]", "[object Window]", "undefined", "key4", "[object Map]", "[object Window]"}) public void forEach() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; - final String html2 = "\n" + final String html2 = DOCTYPE_HTML + + "\n" + "

iFrame body

\n" + "\n" + "\n" @@ -140,7 +136,8 @@ public void getNamedItem_HTML() throws Exception { @Test @Alerts({"myattr", "myattr2", "myattr", "myattr2", "myattr2"}) public void getNamedItem_HTML_Case() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -298,7 +299,8 @@ public void taintEnabled() throws Exception { * @throws Exception on test failure */ void attribute(final String name, final String value, final String... ignore) throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" @@ -339,10 +341,14 @@ public void language() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("en-US,en") + @Alerts(DEFAULT = "en-US", + FF = "en-US,en", + FF_ESR = "en-US,en") + @HtmlUnitNYI(CHROME = "en-US,en", + EDGE = "en-US,en") public void languages() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" @@ -359,8 +365,8 @@ public void languages() throws Exception { @Test @Alerts({"number", "number"}) public void mozilla() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; loadPageVerifyTitle2(html); @@ -58,13 +56,14 @@ public void netscape() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "TypeError", FF = {"true", "false", "true"}, FF_ESR = {"true", "false", "true"}) @HtmlUnitNYI(FF = {"undefined", "true", "true"}, FF_ESR = {"undefined", "true", "true"}) public void netscapeDescriptor() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; loadPageVerifyTitle2(html); diff --git a/src/test/java/org/htmlunit/javascript/host/NotificationTest.java b/src/test/java/org/htmlunit/javascript/host/NotificationTest.java index 8e25544606c..f6de27a2851 100644 --- a/src/test/java/org/htmlunit/javascript/host/NotificationTest.java +++ b/src/test/java/org/htmlunit/javascript/host/NotificationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,8 @@ package org.htmlunit.javascript.host; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; /** * Tests for {@link Notification}. @@ -27,7 +25,6 @@ * @author Ronald Brill * @author Ahmed Ashour */ -@RunWith(BrowserRunner.class) public class NotificationTest extends WebDriverTestCase { /** @@ -36,12 +33,13 @@ public class NotificationTest extends WebDriverTestCase { @Test @Alerts({"function", "true"}) public void prototype() throws Exception { - final String html = ""; loadPageVerifyTitle2(html); @@ -53,11 +51,12 @@ public void prototype() throws Exception { @Test @Alerts("default") public void permission() throws Exception { - final String html = ""; loadPageVerifyTitle2(html); @@ -69,11 +68,12 @@ public void permission() throws Exception { @Test @Alerts({}) public void minimalUsage() throws Exception { - final String html = ""; loadPageVerifyTitle2(html); @@ -85,11 +85,12 @@ public void minimalUsage() throws Exception { @Test @Alerts("function") public void requestPermission() throws Exception { - final String html = ""; loadPageVerifyTitle2(html); diff --git a/src/test/java/org/htmlunit/javascript/host/PluginTest.java b/src/test/java/org/htmlunit/javascript/host/PluginTest.java index 4e6d8e95ab9..8be2722f737 100644 --- a/src/test/java/org/htmlunit/javascript/host/PluginTest.java +++ b/src/test/java/org/htmlunit/javascript/host/PluginTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,19 +15,19 @@ package org.htmlunit.javascript.host; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link Plugin}. * * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class PluginTest extends WebDriverTestCase { + /** + * @throws Exception if an error occurs + */ @Test @Alerts({"5", "PDF Viewer", "Portable Document Format", "internal-pdf-viewer", "undefined", @@ -36,7 +36,8 @@ public class PluginTest extends WebDriverTestCase { "Microsoft Edge PDF Viewer", "Portable Document Format", "internal-pdf-viewer", "undefined", "WebKit built-in PDF", "Portable Document Format", "internal-pdf-viewer", "undefined"}) public void plugins() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + ""; @@ -60,9 +58,10 @@ public void popup() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("TypeError") public void popupBodyStyle() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; diff --git a/src/test/java/org/htmlunit/javascript/host/PopupTest.java b/src/test/java/org/htmlunit/javascript/host/PopupTest.java index e529e0a1d0d..f28ee9cae19 100644 --- a/src/test/java/org/htmlunit/javascript/host/PopupTest.java +++ b/src/test/java/org/htmlunit/javascript/host/PopupTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,17 +22,15 @@ import org.htmlunit.SimpleWebTestCase; import org.htmlunit.html.HtmlElement; import org.htmlunit.html.HtmlPage; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; /** * Tests for {@link Popup}. * * @author Marc Guillemot + * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class PopupTest extends SimpleWebTestCase { /** @@ -42,7 +40,8 @@ public class PopupTest extends SimpleWebTestCase { @Test @Alerts("Pop-up window is Open") public void popupWindowBecomesCurrent() throws Exception { - final String content = "First\n" + final String content = DOCTYPE_HTML + + "First\n" + "Push me\n" + "\n" + "\n" @@ -284,14 +284,15 @@ public void orientation() throws Exception { FF = "landscape-primary", FF_ESR = "landscape-primary") public void mozOrientation() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + "\n" @@ -309,13 +310,14 @@ public void mozOrientation() throws Exception { FF = "undefined", FF_ESR = "undefined") public void isExtended() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + "\n" diff --git a/src/test/java/org/htmlunit/javascript/host/SetTest.java b/src/test/java/org/htmlunit/javascript/host/SetTest.java index 35b8774042f..a8eb04dc751 100644 --- a/src/test/java/org/htmlunit/javascript/host/SetTest.java +++ b/src/test/java/org/htmlunit/javascript/host/SetTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,11 +17,8 @@ import java.util.Set; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.html.HtmlPageTest; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; /** * Tests for {@link Set}. @@ -29,7 +26,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class SetTest extends WebDriverTestCase { /** @@ -38,8 +34,7 @@ public class SetTest extends WebDriverTestCase { @Test @Alerts({"3", "true"}) public void has() throws Exception { - final String html = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" + "\n" @@ -311,8 +304,8 @@ public void constructorIteratorParam() throws Exception { "undefined", "undefined", "[object Set]", "[object Window]", "null", "null", "[object Set]", "[object Window]"}) public void forEach() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; loadPageVerifyTitle2(html); } @@ -80,16 +73,16 @@ public void storageEquals() throws Exception { @Test @Alerts({"string", "1"}) public void localStorage() throws Exception { - final String firstHtml - = "\n" + final String firstHtml = DOCTYPE_HTML + + "\n" + "\n" + ""; - final String secondHtml - = "\n" + final String secondHtml = DOCTYPE_HTML + + "\n" + "\n" + + ""; + loadPageVerifyTitle2(html); + } + /** * @throws Exception if the test fails */ @Test @Alerts({"0", "2", "there", "world", "1", "0"}) public void sessionStorage() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; - final WebDriver driver = loadPage2(html1); - final List alerts = getCollectedAlerts(driver); - final String html2 = ""; getMockWebConnection().setResponse(URL_FIRST, html2); - releaseResources(); // we have to control 2nd driver by ourself - WebDriver driver2 = null; - try { - driver2 = buildWebDriver(); - driver2.get(URL_FIRST.toString()); - final List newAlerts = getCollectedAlerts(driver2); - alerts.addAll(newAlerts); - assertEquals(getExpectedAlerts(), alerts); - } - finally { - if (!(driver2 instanceof HtmlUnitDriver)) { - shutDownAll(); - } + driver = loadPage2(html2); + assertEquals(getExpectedAlerts()[1], driver.getTitle()); + + if (!(driver instanceof HtmlUnitDriver)) { + shutDownAll(); } } @@ -275,7 +290,8 @@ public void localStorageShouldBeShared() throws Exception { @Test @Alerts({"undefined", "null", "extraMethod called", "null"}) public void prototypeIsExtensible() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; loadPageVerifyTitle2(html); } @@ -302,7 +318,8 @@ public void prototypeIsExtensible() throws Exception { @Test @Alerts({"function", "null", "function", "value", "1"}) public void prototypePropertiesAreVisible() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; loadPageVerifyTitle2(html); @@ -328,7 +345,8 @@ public void prototypePropertiesAreVisible() throws Exception { @HtmlUnitNYI(FF = {"function", "null", "string", "value", "1"}, FF_ESR = {"function", "null", "string", "value", "1"}) public void writeToPrototypeProperty() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; loadPageVerifyTitle2(html); } diff --git a/src/test/java/org/htmlunit/javascript/host/SymbolTest.java b/src/test/java/org/htmlunit/javascript/host/SymbolTest.java index f1b5514bbd6..35da214ed09 100644 --- a/src/test/java/org/htmlunit/javascript/host/SymbolTest.java +++ b/src/test/java/org/htmlunit/javascript/host/SymbolTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,10 +16,8 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.html.HtmlPageTest; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; /** * Tests for Symbol. @@ -27,7 +25,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class SymbolTest extends WebDriverTestCase { /** @@ -130,8 +127,7 @@ public void toStringTag() throws Exception { } private void name(final String name) throws Exception { - final String html = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" + "\n" @@ -183,8 +179,7 @@ public void string() throws Exception { @Test @Alerts({"Symbol()", "Symbol(foo)", "Symbol(Symbol.iterator)"}) public void defaultValue() throws Exception { - final String html = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" + "\n" @@ -211,8 +206,7 @@ public void defaultValue() throws Exception { @Test @Alerts({"function", "symbol", "symbol", "symbol"}) public void typeOf() throws Exception { - final String html = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" + "\n" @@ -240,8 +234,7 @@ public void typeOf() throws Exception { @Test @Alerts({"false", "true", "Symbol(mario)"}) public void symbolFor() throws Exception { - final String html = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" + "\n" @@ -270,8 +263,7 @@ public void symbolFor() throws Exception { @Test @Alerts({"true", "false"}) public void symbolForGlobal() throws Exception { - final String html = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" + "\n" @@ -298,10 +290,9 @@ public void symbolForGlobal() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts({"exception", "exception"}) + @Alerts({"TypeError", "TypeError"}) public void symbolNew() throws Exception { - final String html = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" + "\n" @@ -327,10 +318,9 @@ public void symbolNew() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts({"exception", "exception"}) + @Alerts({"TypeError", "TypeError"}) public void globalSymbolRegistry() throws Exception { - final String html = - HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" + "\n" @@ -358,7 +348,8 @@ public void globalSymbolRegistry() throws Exception { @Test @Alerts("called") public void inFunction() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -646,7 +645,8 @@ private void encoding(final String encoding) throws Exception { @Test @Alerts({"0", "8", "72", "116"}) public void encode() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" @@ -731,16 +733,17 @@ public void decode2() throws Exception { * @throws Exception on test failure */ @Test - @Alerts("ex") + @Alerts("RangeError") public void decodeReplacement() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" @@ -754,9 +757,10 @@ public void decodeReplacement() throws Exception { * @throws Exception on test failure */ @Test - @Alerts({"", "ex-null", "\uf7cf!"}) + @Alerts({"", "ex-null", "TypeError", "\uf7cf!"}) public void decodeXuserDefined() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" diff --git a/src/test/java/org/htmlunit/javascript/host/TextEncoderTest.java b/src/test/java/org/htmlunit/javascript/host/TextEncoderTest.java index 595f89238c3..437dc5f5336 100644 --- a/src/test/java/org/htmlunit/javascript/host/TextEncoderTest.java +++ b/src/test/java/org/htmlunit/javascript/host/TextEncoderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,8 @@ package org.htmlunit.javascript.host; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; /** * Tests for {@link TextEncoder}. @@ -26,7 +24,6 @@ * @author Ronald Brill * @see TextEncoder() - Web APIs | MDN */ -@RunWith(BrowserRunner.class) public class TextEncoderTest extends WebDriverTestCase { /** @@ -35,7 +32,8 @@ public class TextEncoderTest extends WebDriverTestCase { @Test @Alerts("utf-8") public void encoding() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" @@ -386,8 +392,8 @@ public void stringMissingParam() throws Exception { "key=value&empty-key=undefined&key=overwrite", "key=value&empty-key=undefined&key=overwrite&key-null=null"}) public void append() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" @@ -956,8 +962,8 @@ public void forEachWrongParam() throws Exception { @Alerts({"true", "function entries() { [native code] }", "[object URLSearchParams Iterator]", "key1-val1", "key2-", "key1-val3", "-val4", "true"}) public void entries() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" @@ -689,6 +710,9 @@ public void protocol() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts({"https:", "http:", "http://mydomain.com/svn/Repos/", @@ -698,10 +722,10 @@ public void protocol() throws Exception { "http:", "http://mydomain.com/svn/Repos/", "http:", "http://mydomain.com/svn/Repos/", "http:", "http://mydomain.com/svn/Repos/", - "ex-unknown"}) + "ex-unknown", "ReferenceError"}) public void protocol2() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" @@ -755,6 +779,9 @@ public void protocol2() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts({"https:", "http:", "http://mydomain.com/svn/Repos/", @@ -764,10 +791,10 @@ public void protocol2() throws Exception { "http:", "http://mydomain.com/svn/Repos/", "http:", "http://mydomain.com/svn/Repos/", "http:", "http://mydomain.com/svn/Repos/", - "ex-unknown"}) + "ex-unknown", "ReferenceError"}) public void protocol3() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" @@ -821,6 +848,9 @@ public void protocol3() throws Exception { loadPageVerifyTitle2(html); } + /** + * @throws Exception if the test fails + */ @Test @Alerts(DEFAULT = {"https:", "http:", "http://mydomain.com/svn/Repos/", @@ -864,8 +894,8 @@ public void protocol3() throws Exception { "wss:", "wss://mydomain.com/svn/Repos/", "file:", "file://mydomain.com/svn/Repos/"}) public void specialScheme() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" @@ -82,8 +79,8 @@ public void constructorSetParam() throws Exception { @Test @Alerts("true") public void constructorMapParam() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -109,8 +106,8 @@ public void constructorMapParam() throws Exception { @Test @Alerts("true") public void constructorIteratorParam() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/javascript/host/WeakSetTest.java b/src/test/java/org/htmlunit/javascript/host/WeakSetTest.java index 45d6ba3ce3c..94f940fbabf 100644 --- a/src/test/java/org/htmlunit/javascript/host/WeakSetTest.java +++ b/src/test/java/org/htmlunit/javascript/host/WeakSetTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,8 @@ package org.htmlunit.javascript.host; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; /** * Tests for WeakSet. @@ -26,7 +24,6 @@ * @author Ahmed Ashour * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class WeakSetTest extends WebDriverTestCase { /** @@ -35,8 +32,8 @@ public class WeakSetTest extends WebDriverTestCase { @Test @Alerts("true") public void constructorArray() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -227,7 +225,7 @@ public void chat() throws Exception { assertVisible("joined", driver); final WebElement chatE = driver.findElement(By.id("chat")); - long maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME; + long maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME.toMillis(); do { Thread.sleep(100); @@ -239,7 +237,7 @@ public void chat() throws Exception { driver.findElement(By.id("phrase")).sendKeys("Hope you are fine!"); driver.findElement(By.id("sendB")).click(); - maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME; + maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME.toMillis(); do { Thread.sleep(100); } @@ -305,7 +303,7 @@ public void onWebSocketClose(final int closeCode, final String message) { /** * {@inheritDoc} */ - @After + @AfterEach @Override public void releaseResources() { super.releaseResources(); @@ -358,7 +356,7 @@ public void cookies() throws Exception { driver.findElement(By.id("joinB")).click(); final WebElement chatE = driver.findElement(By.id("chat")); - long maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME; + long maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME.toMillis(); do { Thread.sleep(100); } @@ -369,7 +367,7 @@ public void cookies() throws Exception { driver.findElement(By.id("phrase")).sendKeys("Hope you are fine!"); driver.findElement(By.id("sendB")).click(); - maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME; + maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME.toMillis(); do { Thread.sleep(100); } @@ -463,13 +461,13 @@ public void events() throws Exception { driver.get(URL_FIRST + "WebSocketTest_events.html"); final WebElement logElement = driver.findElement(By.id("log")); - final long maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME; + final long maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME.toMillis(); String text; do { Thread.sleep(100); - text = logElement.getAttribute("value").trim().replaceAll("\r", ""); + text = logElement.getDomProperty("value").trim().replaceAll("\r", ""); } while (text.length() <= expected.length() && System.currentTimeMillis() < maxWait); @@ -523,7 +521,32 @@ public void events() throws Exception { "[object ArrayBuffer]", "§§URL§§", "", "null", "onCloseListener code: 1000 wasClean: false", "onClose code: 1000 wasClean: false"}) - @NotYetImplemented({FF, FF_ESR}) + @HtmlUnitNYI(FF = {"onOpenListener", + "onOpen", "open", "[object WebSocket]", "[object WebSocket]", + "undefined", "undefined", "undefined", "undefined", + "onMessageTextListener", "message", "[object WebSocket]", "[object WebSocket]", + "server_text", "§§URL§§", "", "null", + "onMessageText", "message", "[object WebSocket]", "[object WebSocket]", + "server_text", "§§URL§§", "", "null", + "onMessageBinaryListener", "message", "[object WebSocket]", "[object WebSocket]", + "[object ArrayBuffer]", "§§URL§§", "", "null", + "onMessageBinary", "message", "[object WebSocket]", "[object WebSocket]", + "[object ArrayBuffer]", "§§URL§§", "", "null", + "onCloseListener code: 1000 wasClean: true", + "onClose code: 1000 wasClean: true"}, + FF_ESR = {"onOpenListener", + "onOpen", "open", "[object WebSocket]", "[object WebSocket]", + "undefined", "undefined", "undefined", "undefined", + "onMessageTextListener", "message", "[object WebSocket]", "[object WebSocket]", + "server_text", "§§URL§§", "", "null", + "onMessageText", "message", "[object WebSocket]", "[object WebSocket]", + "server_text", "§§URL§§", "", "null", + "onMessageBinaryListener", "message", "[object WebSocket]", "[object WebSocket]", + "[object ArrayBuffer]", "§§URL§§", "", "null", + "onMessageBinary", "message", "[object WebSocket]", "[object WebSocket]", + "[object ArrayBuffer]", "§§URL§§", "", "null", + "onCloseListener code: 1000 wasClean: true", + "onClose code: 1000 wasClean: true"}) public void wasClean() throws Exception { expandExpectedAlertsVariables("ws://localhost:" + PORT); final String expected = String.join("\n", getExpectedAlerts()); @@ -535,13 +558,13 @@ public void wasClean() throws Exception { driver.get(URL_FIRST + "WebSocketTest_wasClean.html"); final WebElement logElement = driver.findElement(By.id("log")); - final long maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME; + final long maxWait = System.currentTimeMillis() + DEFAULT_WAIT_TIME.toMillis(); String text; do { Thread.sleep(100); - text = logElement.getAttribute("value").trim().replaceAll("\r", ""); + text = logElement.getDomProperty("value").trim().replaceAll("\r", ""); } while (text.length() <= expected.length() && System.currentTimeMillis() < maxWait); @@ -569,9 +592,9 @@ public void eventsNoSocketServer() throws Exception { int counter = 0; String text; do { - Thread.sleep(DEFAULT_WAIT_TIME); + Thread.sleep(DEFAULT_WAIT_TIME.toMillis()); - text = logElement.getAttribute("value").trim().replaceAll("\r", ""); + text = logElement.getDomProperty("value").trim().replaceAll("\r", ""); } while (text.length() > 0 && counter++ < 10); @@ -658,7 +681,8 @@ public void onWebSocketBinary(final byte[] payload, final int offset, final int @Test @Alerts("true") public void prototypeUrl() throws Exception { - final String html = "\n" + ""; loadPageVerifyTitle2(html); @@ -185,18 +178,161 @@ public void atob() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts({"exception", "exception"}) + @Alerts({"SGVsbG8gV29ybGQh", "Hello World!"}) + public void atobTrailingWhitespace() throws Exception { + final String html = DOCTYPE_HTML + + "\n" + + "\n" + + ""; + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts({"SGVsbG8gV29ybGQh", "Hello World!"}) + public void atobLeadingWhitespace() throws Exception { + final String html = DOCTYPE_HTML + + "\n" + + "\n" + + ""; + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts({"SGVsbG8gV29ybGQh", "Hello World!"}) + public void atobWhitespace() throws Exception { + final String html = DOCTYPE_HTML + + "\n" + + "\n" + + ""; + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts({"SGVsbG8gV29ybGQh", "InvalidCharacterError/DOMException", + "InvalidCharacterError/DOMException", "InvalidCharacterError/DOMException"}) + public void atobNbsp() throws Exception { + final String html = DOCTYPE_HTML + + "\n" + + "\n" + + ""; + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts({"SGVsbG8gV29ybGQh", "InvalidCharacterError/DOMException"}) + public void atobInvalid() throws Exception { + final String html = DOCTYPE_HTML + + "\n" + + "\n" + + ""; + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("InvalidCharacterError/DOMException") + public void atobMalformedInput() throws Exception { + final String html = DOCTYPE_HTML + + "\n" + + "\n" + + ""; + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts("InvalidCharacterError/DOMException") + public void atobEmptyInput() throws Exception { + final String html = DOCTYPE_HTML + + "\n" + + "\n" + + ""; + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts({"InvalidCharacterError/DOMException", "InvalidCharacterError/DOMException"}) public void atobUnicode() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; loadPageVerifyTitle2(html); @@ -208,11 +344,11 @@ public void atobUnicode() throws Exception { @Test @Alerts({"M8OuwqY=", "3\u00C3\u00AE\u00C2\u00A6"}) public void atobUnicodeOutput() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -228,11 +364,11 @@ public void atobUnicodeOutput() throws Exception { @Test @Alerts({"CSAe", "\t \u001e"}) public void atobControlChar() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -248,13 +384,13 @@ public void atobControlChar() throws Exception { @Test @Alerts({"bnVsbA==", "null"}) public void atobNull() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; loadPageVerifyTitle2(html); @@ -266,13 +402,13 @@ public void atobNull() throws Exception { @Test @Alerts({"dW5kZWZpbmVk", "undefined"}) public void atobUndefined() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; loadPageVerifyTitle2(html); @@ -309,7 +445,8 @@ public void topLevelProperties() throws Exception { "NaN", "Infinity", "eval", "print", "parseInt", "parseFloat", "isNaN", "isFinite", "encodeURI", "encodeURIComponent", "decodeURI", "decodeURIComponent", "escape", "unescape"}; - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -364,14 +503,15 @@ public void execScript2() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("TypeError") public void execScript_returnValue() throws Exception { - final String html = "\n" + ""; @@ -384,7 +524,8 @@ public void execScript_returnValue() throws Exception { @Test @Alerts("undefined") public void collectGarbage() throws Exception { - final String html = "\n" @@ -646,7 +792,8 @@ public void open() throws Exception { + " window.open('" + URL_SECOND + "');\n" + "\n" + ""; - final String windowContent = "\n" + final String windowContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -678,7 +826,8 @@ public void openWindowParams() throws Exception { + " window.open('" + URL_SECOND + "', 'New window', 'width=200,height=100');\n" + "\n" + ""; - final String windowContent = "\n" + final String windowContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" + ""; - final String windowContent = "\n" + final String windowContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" + ""; @@ -795,17 +948,47 @@ public void IEScriptEngineXxx() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(CHROME = {"true", "true", "147", "true", "true", "16"}, - EDGE = {"true", "true", "136", "true", "true", "24"}, - FF = {"true", "true", "91", "true", "true", "12"}, - FF_ESR = {"true", "true", "91", "true", "true", "12"}) + @Alerts(CHROME = {"true", "621", "147", "true", "16", "16"}, + EDGE = {"true", "630", "138", "true", "16", "24"}, + FF = {"true", "675", "93", "true", "16", "16"}, + FF_ESR = {"true", "677", "91", "true", "16", "12"}) + @HtmlUnitNYI(CHROME = {"true", "605", "147", "true", "0", "16"}, + EDGE = {"true", "605", "138", "true", "0", "24"}, + FF = {"true", "605", "93", "true", "0", "16"}, + FF_ESR = {"true", "605", "91", "true", "0", "12"}) public void heightsAndWidths() throws Exception { - final String html - = "\n" + + ""; + loadPageVerifyTitle2(html); + } + + /** + * Regression test for bug 2897473. + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = {"true", "0", "147", "true", "true", "16"}, + EDGE = {"true", "0", "138", "true", "true", "24"}, + FF = {"true", "0", "93", "true", "true", "16"}, + FF_ESR = {"true", "0", "91", "true", "true", "12"}) + public void heightsAndWidthsQuirks() throws Exception { + final String html = + "\n" + + "\n" + + "\n" + + ""; + loadPageVerifyTitle2(html); + } + + /** + * Regression test for bug 2944261. + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = {"621", "1256", "606", "1241"}, + EDGE = {"630", "1248", "615", "1233"}, + FF = {"675", "1256", "658", "1239"}, + FF_ESR = {"677", "1260", "660", "1243"}) + // TODO width and height calculation needs to be reworked in HtmlUnit + // but as the calculation might be effected by e.g. current windows style it is not that simple + @HtmlUnitNYI(CHROME = {"605", "1256", "705", "1256"}, + EDGE = {"605", "1256", "705", "1256"}, + FF = {"605", "1256", "705", "1256"}, + FF_ESR = {"605", "1256", "705", "1256"}) + public void changeHeightsAndWidthsQuirks() throws Exception { + final String html = + "\n" + ""; @@ -1086,11 +1317,11 @@ public void typeof() throws Exception { */ @Test @Alerts(DEFAULT = {"undefined", "undefined"}, - FF = {"10", "89"}, + FF = {"12", "89"}, FF_ESR = {"10", "89"}) public void mozInnerScreen() throws Exception { - final String html - = "\n" + ""; @@ -1152,8 +1383,8 @@ public void eval() throws Exception { @Test @Alerts({"true", "I was here"}) public void firedEvent_equals_original_event() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; @@ -2150,8 +2393,8 @@ public void showModalDialog() throws Exception { @Test @Alerts("undefined") public void showModelessDialog() throws Exception { - final String html - = ""; @@ -2166,8 +2409,8 @@ public void showModelessDialog() throws Exception { @Test @Alerts("function") public void find() throws Exception { - final String html - = ""; @@ -2183,8 +2426,8 @@ public void find() throws Exception { @Test @Alerts("\"0.33\"") public void getComputedStylePseudo() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" @@ -2273,8 +2517,8 @@ public void getComputedStyleElementDocument() throws Exception { @Test @Alerts({"1", "false", "true", "false", "false"}) public void in() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -2317,15 +2562,16 @@ public void calledTwice() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception true") + @Alerts("TypeError") public void constructor() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -2343,7 +2589,8 @@ public void constructor() throws Exception { @Test @Alerts("0") public void constructorError() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -2366,7 +2613,8 @@ public void constructorError() throws Exception { @Test @Alerts({"false", "false", "test2 alert"}) public void objectCallOnFrameWindow() throws Exception { - final String firstContent = "\n" + final String firstContent = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -2455,8 +2705,8 @@ public void xmlNotInWindow() throws Exception { @Test @Alerts({"[object Window]", "true", "true"}) public void globalThis() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; @@ -2639,8 +2896,8 @@ public void isSecureContextLocalhost() throws Exception { @Test @Alerts("false") public void isSecureContextHttp() throws Exception { - final String html - = ""; @@ -2668,8 +2925,8 @@ public void isSecureContextHttpS() throws Exception { @Test @Alerts("true") public void isSecureContextFile() throws Exception { - final String html - = ""; @@ -2712,7 +2969,8 @@ public void isSecureContextAboutBlank() throws Exception { @Test @Alerts("inline") public void getComputedStyleShouldLoadOnlyStylesheets() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -2746,7 +3004,8 @@ public void getComputedStyleShouldLoadOnlyStylesheets() throws Exception { @Test @Alerts("length[GSCE]") public void lengthProperty() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" + + "\n" + + ""; + + loadPage2(content); + verifyTitle2(DEFAULT_WAIT_TIME, getWebDriver(), getExpectedAlerts()); + } +} diff --git a/src/test/java/org/htmlunit/javascript/host/Window3Test.java b/src/test/java/org/htmlunit/javascript/host/Window3Test.java index 2d7bb53a7a4..b64277778b5 100644 --- a/src/test/java/org/htmlunit/javascript/host/Window3Test.java +++ b/src/test/java/org/htmlunit/javascript/host/Window3Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,12 +27,9 @@ import org.apache.commons.lang3.StringUtils; import org.htmlunit.HttpHeader; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.html.HtmlPageTest; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.htmlunit.junit.BrowserRunner.NotYetImplemented; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.htmlunit.junit.annotation.HtmlUnitNYI; +import org.junit.jupiter.api.Test; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; @@ -53,7 +50,6 @@ * @author Ronald Brill * @author Atsushi Nakagawa */ -@RunWith(BrowserRunner.class) public class Window3Test extends WebDriverTestCase { /** @@ -62,7 +58,7 @@ public class Window3Test extends WebDriverTestCase { @Test @Alerts("about:blank") public void openWindow_emptyUrl() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + ""; - final String secondContent = HtmlPageTest.STANDARDS_MODE_PREFIX_ - + "Second\n" + + "\n" + + "\n" + "
\n" + ""; - final String thirdContent = HtmlPageTest.STANDARDS_MODE_PREFIX_ - + "Third\n" + final String firstContent = DOCTYPE_HTML + + "\n" + + "First\n" + + "\n" + + "\n" + + "\n" + ""; - final String secondContent = HtmlPageTest.STANDARDS_MODE_PREFIX_ - + "Second\n" + final String secondContent = DOCTYPE_HTML + + "\n" + + "Second\n" + + "\n" + + "\n" + + "\n" + + "\n" + ""; getMockWebConnection().setResponse(URL_SECOND, secondContent); - final String thirdContent = HtmlPageTest.STANDARDS_MODE_PREFIX_ - + "Third\n" + ""; getMockWebConnection().setResponse(urlThird, thirdContent); - final WebDriver driver = loadPageWithAlerts2(firstContent); + final WebDriver driver = loadPage2(firstContent); assertTitle(driver, "First"); + verifyWindowName2(driver, getExpectedAlerts()); } /** @@ -205,7 +220,7 @@ public void javascriptVariableFromNamedFrame() throws Exception { final URL urlThird = new URL(URL_FIRST, "third/"); final URL urlFourth = new URL(URL_FIRST, "fourth/"); - final String firstContent = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String firstContent = DOCTYPE_HTML + "first\n" + "\n" + " \n" @@ -215,30 +230,41 @@ public void javascriptVariableFromNamedFrame() throws Exception { + " \n" + ""; - final String secondContent = HtmlPageTest.STANDARDS_MODE_PREFIX_ - + "second

second

"; + final String secondContent = DOCTYPE_HTML + + "\n" + + "second\n" + + "\n" + + "\n" + + "

second

"; getMockWebConnection().setResponse(URL_SECOND, secondContent); - final String thirdContent = HtmlPageTest.STANDARDS_MODE_PREFIX_ - + "third

third

"; + final String thirdContent = DOCTYPE_HTML + + "\n" + + "third\n" + + "\n" + + "\n" + + "\n" + + "

third

"; getMockWebConnection().setResponse(urlThird, thirdContent); - final String fourthContent = HtmlPageTest.STANDARDS_MODE_PREFIX_ - + "fourth"; getMockWebConnection().setResponse(urlFourth, fourthContent); - final WebDriver driver = loadPageWithAlerts2(firstContent); + final WebDriver driver = loadPage2(firstContent); assertTitle(driver, "first"); + verifyWindowName2(driver, getExpectedAlerts()); } /** @@ -248,7 +274,7 @@ public void javascriptVariableFromNamedFrame() throws Exception { @Test @Alerts("true") public void javascriptVariableFromWindow_NotFound() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + ""; getMockWebConnection().setResponse(urlFourth, fourthContent); @@ -303,8 +333,9 @@ public void getFrameByName() throws Exception { } setExpectedAlerts(expectedAlerts); - final WebDriver driver = loadPageWithAlerts2(firstContent); + final WebDriver driver = loadPage2(firstContent); assertTitle(driver, "first"); + verifyWindowName2(driver, expectedAlerts); } /** @@ -314,7 +345,7 @@ public void getFrameByName() throws Exception { @Test @Alerts({"false", "false", "true"}) public void closed() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + + "\n" + + "\n" + ""; loadPageVerifyTitle2(html); } @@ -457,15 +489,17 @@ public void scrollBy() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts({"document", "body"}) + @Alerts({"document [object HTMLDocument]", "body", "window [object HTMLDocument]"}) public void scrollByEvents() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -484,17 +518,17 @@ public void scrollByEvents() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "TypeError", FF = {}, FF_ESR = {}) public void scrollByLines() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + ""; loadPageVerifyTitle2(html); @@ -505,17 +539,17 @@ public void scrollByLines() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts(DEFAULT = "exception", + @Alerts(DEFAULT = "TypeError", FF = {}, FF_ESR = {}) public void scrollByPages() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + ""; loadPageVerifyTitle2(html); @@ -527,7 +561,7 @@ public void scrollByPages() throws Exception { */ @Test public void scrollTo() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" @@ -569,7 +604,7 @@ public void scrollToEvents() throws Exception { @Test @Alerts({"form1", "form1", "2", "2"}) public void formByName() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -1047,7 +1082,7 @@ public void execScript() throws Exception { @Test @Alerts({"test2", "test"}) public void onLoadFunction() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" + ""; @@ -1152,9 +1187,9 @@ public void attachOnLoadEvent() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("TypeError") public void detachEventInAttachEvent() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" + ""; @@ -1180,7 +1215,9 @@ public void detachEventInAttachEvent() throws Exception { @Test @Alerts({"window.name before: ", "window.name after: main"}) public void windowName() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + shutDownAll(); + + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -1203,7 +1240,7 @@ public void windowName() throws Exception { @Test @Alerts({"number", "number", "number", "number"}) public void viewport() throws Exception { - final String html = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String html = DOCTYPE_HTML + "\n" + "\n" + "\n" @@ -1227,13 +1264,13 @@ public void viewport() throws Exception { @Test @Alerts("§§URL§§") public void openWindow_refererHeader() throws Exception { - final String firstContent = HtmlPageTest.STANDARDS_MODE_PREFIX_ + final String firstContent = DOCTYPE_HTML + "\n" + "\n" + "
"}) + @Alerts({"a\\sb", "2", "InvalidCharacterError/DOMException", + "2", "a\\sb", "
"}) public void removeBlank() throws Exception { remove("a b", "' '"); } @@ -1047,7 +1134,8 @@ public void removeBlank() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts({"a\\sb", "2", "exception", "2", "a\\sb", "
"}) + @Alerts({"a\\sb", "2", "InvalidCharacterError/DOMException", + "2", "a\\sb", "
"}) public void removeTab() throws Exception { remove("a b", "'\t'"); } @@ -1056,7 +1144,8 @@ public void removeTab() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts({"a\\sb", "2", "exception", "2", "a\\sb", "
"}) + @Alerts({"a\\sb", "2", "InvalidCharacterError/DOMException", + "2", "a\\sb", "
"}) public void removeCr() throws Exception { remove("a b", "'\\r'"); } @@ -1065,7 +1154,8 @@ public void removeCr() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts({"a\\sb", "2", "exception", "2", "a\\sb", "
"}) + @Alerts({"a\\sb", "2", "InvalidCharacterError/DOMException", + "2", "a\\sb", "
"}) public void removeNl() throws Exception { remove("a b", "'\\n'"); } @@ -1121,7 +1211,8 @@ public void removeDuplicated() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts({"a\\sb\\sa", "2", "exception", "2", "a\\sb\\sa", "
"}) + @Alerts({"a\\sb\\sa", "2", "InvalidCharacterError/DOMException", "2", "a\\sb\\sa", + "
"}) public void removeElementWithBlank() throws Exception { remove("a b a", "'a b'"); } @@ -1130,7 +1221,7 @@ public void removeElementWithBlank() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts({"a\\sb\\sa\\tb", "2", "exception", "2", "a\\sb\\sa\\tb", + @Alerts({"a\\sb\\sa\\tb", "2", "InvalidCharacterError/DOMException", "2", "a\\sb\\sa\\tb", ""}) public void removeElementWithTab() throws Exception { remove("a b a\tb", "'a\tb'"); @@ -1258,15 +1349,15 @@ public void removeTwoNull() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts({"a\\sb\\s7", "3", "exception", "3", "a\\sb\\s7", + @Alerts({"a\\sb\\s7", "3", "InvalidCharacterError/DOMException", "3", "a\\sb\\s7", ""}) public void removeTwoObject() throws Exception { remove("a b 7", "'b', { color: 'red' }"); } private void remove(final String in, final String toRemove) throws Exception { - String html - = "\n" + String html = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -68,9 +63,10 @@ public void createElementWithAngleBrackets() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts("InvalidCharacterError/DOMException") public void createElementWithHtml() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -101,7 +97,8 @@ public void createElementWithHtml() throws Exception { @Test @Alerts("false") public void createElementPrototype() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; @@ -455,9 +459,11 @@ public void queryCommandEnabled() throws Exception { @Alerts(DEFAULT = {"true", "true", "true"}, FF = {"false", "false", "false"}, FF_ESR = {"false", "false", "false"}) - @NotYetImplemented({FF, FF_ESR}) + @HtmlUnitNYI(FF = {"true", "true", "true"}, + FF_ESR = {"true", "true", "true"}) public void queryCommandEnabledDesignMode() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "\n" + + ""; + + loadPageVerifyTitle2(html); + } + /** * @throws Exception if the test fails */ @Test @Alerts({"bar", "null"}) public void getElementById_resetId() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" diff --git a/src/test/java/org/htmlunit/javascript/host/dom/DocumentFragmentTest.java b/src/test/java/org/htmlunit/javascript/host/dom/DocumentFragmentTest.java index 741192f736f..8a19293a288 100644 --- a/src/test/java/org/htmlunit/javascript/host/dom/DocumentFragmentTest.java +++ b/src/test/java/org/htmlunit/javascript/host/dom/DocumentFragmentTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,8 @@ package org.htmlunit.javascript.host.dom; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.htmlunit.junit.annotation.Alerts; +import org.junit.jupiter.api.Test; /** * Tests for {@link DocumentFragment}. @@ -28,7 +26,6 @@ * @author Ronald Brill * @author Frank Danek */ -@RunWith(BrowserRunner.class) public class DocumentFragmentTest extends WebDriverTestCase { /** @@ -41,7 +38,8 @@ public class DocumentFragmentTest extends WebDriverTestCase { FF = "[object CSS2Properties]", FF_ESR = "[object CSS2Properties]") public void getComputedStyleOnChild() throws Exception { - final String html = "\n" + "\n" @@ -52,7 +50,7 @@ public void getComputedStyleOnChild() throws Exception { + " var d = document.createElement('div');\n" + " frag.appendChild(d);\n" + " log(window.getComputedStyle(d, null));\n" - + " } catch (e) { log('exception'); }\n" + + " } catch(e) { logEx(e); }\n" + "\n" + "\n" + ""; @@ -65,8 +63,8 @@ public void getComputedStyleOnChild() throws Exception { */ @Test public void createElement() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n" + " \n" @@ -658,8 +640,8 @@ public void documentCreateElementUnknown() throws Exception { public void documentCreateElementValidTagNames() throws Exception { expandExpectedAlertsVariables("\\\\"); - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n" + "\n" @@ -1219,8 +1199,8 @@ public void appendChildAtDocumentLevel() throws Exception { @Test @Alerts("Some Text") public void appendChild_textNode() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -1346,8 +1326,8 @@ public void getElementById_scriptSrc() throws Exception { @Test @Alerts("parentDiv") public void parentNode_Nested() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + ""; + final String html = DOCTYPE_HTML + + ""; final String script = "alert(document.getElementsByTagName('script').length);\n"; getMockWebConnection().setResponse(new URL(URL_FIRST, "script"), script, "text/javascript"); @@ -1831,7 +1814,8 @@ public void getElementsByTagName_LoadScript() throws Exception { @Test @Alerts({"2", "Three", "Four", "1", "Two", "0", "0"}) public void getElementsByTagNameXml() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + ""; loadPageVerifyTitle2(html); @@ -1876,8 +1860,8 @@ public void getElementsByTagNameXml() throws Exception { @Test @Alerts({"HTML", "HEAD", "TITLE", "SCRIPT", "BODY"}) public void all_WithParentheses() throws Exception { - final String html - = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -2079,7 +2062,8 @@ public void all_tags() throws Exception { @Test @Alerts({"false", "false", "undefined"}) public void all() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -2122,7 +2106,8 @@ public void all_Caching() throws Exception { @Test @Alerts({"null", "null", "null"}) public void all_NotExisting() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -2187,7 +2173,8 @@ public void body_read() throws Exception { @Test @Alerts("FRAMESET") public void body_readFrameset() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + ""; @@ -2202,8 +2189,8 @@ public void body_readFrameset() throws Exception { @Test @Alerts({"0", "3", "3", "true", "firstImage"}) public void images() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" + "\n" @@ -2492,7 +2484,8 @@ public void scriptsArray() throws Exception { @Test @Alerts({"object", "FORM"}) public void precedence() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" @@ -2512,7 +2505,8 @@ public void precedence() throws Exception { @Test @Alerts({"true", "false"}) public void defaultViewAndParentWindow() throws Exception { - final String html = "\n" + ""; @@ -2601,25 +2594,25 @@ public void createStyleSheet() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("#document-fragment_null_11_null_0_") + @Alerts({"#document-fragment", "null", "11", "null", "0"}) public void createDocumentFragment() throws Exception { - final String html = "foo\n" - + "\n" + + LOG_TEXTAREA + ""; - final WebDriver driver = loadPage2(html); - final String expected = getExpectedAlerts()[0]; - assertEquals(expected, driver.findElement(By.id("myTextarea")).getAttribute("value")); + loadPageVerifyTextArea2(html); } /** @@ -2653,14 +2646,14 @@ public void createEvent_HTMLEvents() throws Exception { * @throws Exception if an error occurs */ @Test - @Alerts("exception") + @Alerts("NotSupportedError/DOMException") public void createEvent_Bogus() throws Exception { createEvent("Bogus"); } private void createEvent(final String eventType) throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + ""; @@ -2683,8 +2676,8 @@ private void createEvent(final String eventType) throws Exception { @Test @Alerts({"null", "null", "[object HTMLDivElement]"}) public void createEvent_target() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + "
abc
\n" + " \n" + " \n" @@ -2712,8 +2705,8 @@ public void createEvent_target() throws Exception { @Test @Alerts("function onload(event) { log(\"hi\") }") public void createEvent_overridden() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + "
abc
\n" + " \n" + " \n" @@ -2738,10 +2731,13 @@ public void createEvent_overridden() throws Exception { */ @Test @Alerts("test") - @NotYetImplemented + @HtmlUnitNYI(CHROME = "undefined", + EDGE = "undefined", + FF = "undefined", + FF_ESR = "undefined") public void createEvent_caller() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + "
abc
\n" + " \n" + " \n" @@ -2765,10 +2761,13 @@ public void createEvent_caller() throws Exception { */ @Test @Alerts("null") - @NotYetImplemented + @HtmlUnitNYI(CHROME = "undefined", + EDGE = "undefined", + FF = "undefined", + FF_ESR = "undefined") public void caller() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n" + ""; @@ -2835,7 +2832,8 @@ public void createEventObject_IE() throws Exception { @Test @Alerts("null") public void elementFromPoint() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + "\n" @@ -3742,4 +3764,173 @@ public void newDoc() throws Exception { loadPageVerifyTitle2(html); } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = {"0", "0", "8", "1256"}, + EDGE = {"0", "0", "8", "1248"}, + FF = {"0", "0", "8", "1256"}, + FF_ESR = {"0", "0", "8", "1260"}) + @HtmlUnitNYI(EDGE = {"0", "0", "8", "1256"}, + FF_ESR = {"0", "0", "8", "1256"}) + public void documentElementBoundingClientRect() throws Exception { + final String html = DOCTYPE_HTML + + "" + + "\n" + + "\n" + + ""; + + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = {"0", "0", "621", "1256"}, + EDGE = {"0", "0", "630", "1248"}, + FF = {"0", "0", "8", "1256"}, + FF_ESR = {"0", "0", "8", "1260"}) + @HtmlUnitNYI(CHROME = {"0", "0", "613", "1256"}, + EDGE = {"0", "0", "613", "1256"}, + FF = {"0", "0", "613", "1256"}, + FF_ESR = {"0", "0", "613", "1256"}) + public void documentElementBoundingClientRectQuirks() throws Exception { + final String html = + "" + + "\n" + + "\n" + + ""; + + loadPageVerifyTitle2(html); + } + + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = {"0", "0", "8", "1256"}, + EDGE = {"0", "0", "8", "1248"}, + FF = {"0", "0", "8", "1256"}, + FF_ESR = {"0", "0", "8", "1260"}) + @HtmlUnitNYI(EDGE = {"0", "0", "8", "1256"}, + FF_ESR = {"0", "0", "8", "1256"}) + public void documentElementOffset() throws Exception { + final String html = DOCTYPE_HTML + + "" + + "\n" + + "\n" + + ""; + + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = {"0", "0", "621", "1256"}, + EDGE = {"0", "0", "630", "1248"}, + FF = {"0", "0", "8", "1256"}, + FF_ESR = {"0", "0", "8", "1260"}) + @HtmlUnitNYI(CHROME = {"0", "0", "613", "1256"}, + EDGE = {"0", "0", "613", "1256"}, + FF = {"0", "0", "613", "1256"}, + FF_ESR = {"0", "0", "613", "1256"}) + public void documentElementOffsetQuirks() throws Exception { + final String html = + "" + + "\n" + + "\n" + + ""; + + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = {"0", "0", "621", "1256"}, + EDGE = {"0", "0", "630", "1248"}, + FF = {"0", "0", "675", "1256"}, + FF_ESR = {"0", "0", "677", "1260"}) + @HtmlUnitNYI(CHROME = {"0", "0", "605", "1256"}, + EDGE = {"0", "0", "605", "1256"}, + FF = {"0", "0", "605", "1256"}, + FF_ESR = {"0", "0", "605", "1256"}) + public void documentElementClientWidthHeight() throws Exception { + final String html = DOCTYPE_HTML + + "" + + "\n" + + "\n" + + ""; + + loadPageVerifyTitle2(html); + } + + /** + * @throws Exception if the test fails + */ + @Test + @Alerts(CHROME = {"0", "0", "621", "1256"}, + EDGE = {"0", "0", "630", "1248"}, + FF = {"0", "0", "8", "1256"}, + FF_ESR = {"0", "0", "8", "1260"}) + @HtmlUnitNYI(CHROME = {"0", "0", "605", "1256"}, + EDGE = {"0", "0", "605", "1256"}, + FF = {"0", "0", "605", "1256"}, + FF_ESR = {"0", "0", "605", "1256"}) + public void documentElementClientWidthHeightQuirks() throws Exception { + final String html = + "" + + "\n" + + "\n" + + ""; + + loadPageVerifyTitle2(html); + } } diff --git a/src/test/java/org/htmlunit/javascript/host/dom/DocumentTypeTest.java b/src/test/java/org/htmlunit/javascript/host/dom/DocumentTypeTest.java index 74cd6a4358d..685fe1a8041 100644 --- a/src/test/java/org/htmlunit/javascript/host/dom/DocumentTypeTest.java +++ b/src/test/java/org/htmlunit/javascript/host/dom/DocumentTypeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2024 Gargoyle Software Inc. + * Copyright (c) 2002-2025 Gargoyle Software Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,12 +15,9 @@ package org.htmlunit.javascript.host.dom; import org.htmlunit.WebDriverTestCase; -import org.htmlunit.html.HtmlPageTest; -import org.htmlunit.junit.BrowserRunner; -import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.annotation.Alerts; import org.htmlunit.util.MimeType; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; /** * Tests for {@link DocumentType}. @@ -28,8 +25,8 @@ * @author Ahmed Ashour * @author Marc Guillemot * @author Frank Danek + * @author Ronald Brill */ -@RunWith(BrowserRunner.class) public class DocumentTypeTest extends WebDriverTestCase { /** @@ -73,8 +70,8 @@ public void doctype() throws Exception { @Alerts({"[object DocumentType]", "greeting,10,null,undefined,undefined,undefined", "greeting,MyIdentifier,hello.dtd,undefined,undefined,undefined"}) public void doctype_xml() throws Exception { - final String html = - "\n" + final String html = DOCTYPE_HTML + + "\n" + " \n" + " \n" + "\n" + " \n" + " \n" - + " \n" + + LOG_TEXTAREA + ""; final WebDriver driver = loadPage2(html); @@ -120,23 +117,21 @@ public void clickEvents() throws Exception { driver.findElement(By.id("testInput")).click(); driver.findElement(By.id("testImage")).click(); driver.findElement(By.id("testTextarea")).click(); - final String expected = getExpectedAlerts()[0]; - assertEquals(expected, driver.findElement(By.id("myTextarea")).getAttribute("value")); + + verifyTextArea2(driver, getExpectedAlerts()); } /** * @throws Exception if the test fails */ @Test - @Alerts("mousedown label,mouseup label,click label,focus text,click text,") + @Alerts({"mousedown label", "mouseup label", "click label", "focus text", "click text"}) public void clickEventsLabel() throws Exception { - final String html = "\n" + final String html = DOCTYPE_HTML + + "\n" + "\n" + " \n" + "\n" + "