-
-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
'Illegal constructor' is a type error
- Loading branch information
Showing
6 changed files
with
153 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
src/test/java/org/htmlunit/javascript/host/geo/GeolocationCoordinatesTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright (c) 2002-2025 Gargoyle 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.host.geo; | ||
|
||
import org.htmlunit.WebDriverTestCase; | ||
import org.htmlunit.junit.BrowserRunner; | ||
import org.htmlunit.junit.annotation.Alerts; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
/** | ||
* Tests for {@link GeolocationCoordinates}. | ||
* | ||
* @author Ronald Brill | ||
*/ | ||
@RunWith(BrowserRunner.class) | ||
public class GeolocationCoordinatesTest extends WebDriverTestCase { | ||
|
||
/** | ||
* @throws Exception if the test fails | ||
*/ | ||
@Test | ||
@Alerts("TypeError") | ||
public void ctor() throws Exception { | ||
final String html = | ||
"<html><head><script>\n" | ||
+ LOG_TITLE_FUNCTION | ||
+ " function test() {\n" | ||
+ " try {\n" | ||
+ " new GeolocationCoordinates();\n" | ||
+ " } catch(e) { logEx(e) }\n" | ||
+ " }\n" | ||
+ "</script></head><body onload='test()'>\n" | ||
+ "</body></html>"; | ||
|
||
loadPageVerifyTitle2(html); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
src/test/java/org/htmlunit/javascript/host/geo/GeolocationPositionErrorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright (c) 2002-2025 Gargoyle 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.host.geo; | ||
|
||
import org.htmlunit.WebDriverTestCase; | ||
import org.htmlunit.junit.BrowserRunner; | ||
import org.htmlunit.junit.annotation.Alerts; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
/** | ||
* Tests for {@link GeolocationPositionError}. | ||
* | ||
* @author Ronald Brill | ||
*/ | ||
@RunWith(BrowserRunner.class) | ||
public class GeolocationPositionErrorTest extends WebDriverTestCase { | ||
|
||
/** | ||
* @throws Exception if the test fails | ||
*/ | ||
@Test | ||
@Alerts("TypeError") | ||
public void ctor() throws Exception { | ||
final String html = | ||
"<html><head><script>\n" | ||
+ LOG_TITLE_FUNCTION | ||
+ " function test() {\n" | ||
+ " try {\n" | ||
+ " new GeolocationPositionError();\n" | ||
+ " } catch(e) { logEx(e) }\n" | ||
+ " }\n" | ||
+ "</script></head><body onload='test()'>\n" | ||
+ "</body></html>"; | ||
|
||
loadPageVerifyTitle2(html); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
src/test/java/org/htmlunit/javascript/host/geo/GeolocationPositionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright (c) 2002-2025 Gargoyle 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.host.geo; | ||
|
||
import org.htmlunit.WebDriverTestCase; | ||
import org.htmlunit.junit.BrowserRunner; | ||
import org.htmlunit.junit.annotation.Alerts; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
/** | ||
* Tests for {@link GeolocationPosition}. | ||
* | ||
* @author Ronald Brill | ||
*/ | ||
@RunWith(BrowserRunner.class) | ||
public class GeolocationPositionTest extends WebDriverTestCase { | ||
|
||
/** | ||
* @throws Exception if the test fails | ||
*/ | ||
@Test | ||
@Alerts("TypeError") | ||
public void ctor() throws Exception { | ||
final String html = | ||
"<html><head><script>\n" | ||
+ LOG_TITLE_FUNCTION | ||
+ " function test() {\n" | ||
+ " try {\n" | ||
+ " new GeolocationPosition();\n" | ||
+ " } catch(e) { logEx(e) }\n" | ||
+ " }\n" | ||
+ "</script></head><body onload='test()'>\n" | ||
+ "</body></html>"; | ||
|
||
loadPageVerifyTitle2(html); | ||
} | ||
} |