diff --git a/src/main/java/org/htmlunit/javascript/host/worker/DedicatedWorkerGlobalScope.java b/src/main/java/org/htmlunit/javascript/host/worker/DedicatedWorkerGlobalScope.java index 346ac6ba01..933fa5f4dd 100644 --- a/src/main/java/org/htmlunit/javascript/host/worker/DedicatedWorkerGlobalScope.java +++ b/src/main/java/org/htmlunit/javascript/host/worker/DedicatedWorkerGlobalScope.java @@ -49,10 +49,19 @@ import org.htmlunit.javascript.configuration.JsxGetter; import org.htmlunit.javascript.configuration.JsxSetter; import org.htmlunit.javascript.configuration.WorkerJavaScriptConfiguration; +import org.htmlunit.javascript.host.PermissionStatus; +import org.htmlunit.javascript.host.Permissions; +import org.htmlunit.javascript.host.PushManager; +import org.htmlunit.javascript.host.PushSubscription; +import org.htmlunit.javascript.host.PushSubscriptionOptions; import org.htmlunit.javascript.host.Window; import org.htmlunit.javascript.host.WindowOrWorkerGlobalScopeMixin; import org.htmlunit.javascript.host.event.Event; import org.htmlunit.javascript.host.event.MessageEvent; +import org.htmlunit.javascript.host.event.SecurityPolicyViolationEvent; +import org.htmlunit.javascript.host.media.MediaSource; +import org.htmlunit.javascript.host.media.SourceBuffer; +import org.htmlunit.javascript.host.media.SourceBufferList; import org.htmlunit.util.MimeType; /** @@ -155,16 +164,19 @@ public void jsConstructor() { // hack for the moment if (browserVersion.isFirefox()) { - delete("MediaSource"); - delete("Permissions"); - delete("PermissionStatus"); - delete("PushManager"); - delete("PushSubscription"); - delete("PushSubscriptionOptions"); - delete("SecurityPolicyViolationEvent"); - delete("ServiceWorkerRegistration"); - delete("SourceBuffer"); - delete("SourceBufferList"); + delete(MediaSource.class.getSimpleName()); + delete(SecurityPolicyViolationEvent.class.getSimpleName()); + delete(SourceBuffer.class.getSimpleName()); + delete(SourceBufferList.class.getSimpleName()); + } + + if (browserVersion.isFirefoxESR()) { + delete(Permissions.class.getSimpleName()); + delete(PermissionStatus.class.getSimpleName()); + delete(PushManager.class.getSimpleName()); + delete(PushSubscription.class.getSimpleName()); + delete(PushSubscriptionOptions.class.getSimpleName()); + delete(ServiceWorkerRegistration.class.getSimpleName()); } if (!webClient.getOptions().isWebSocketEnabled()) { diff --git a/src/test/java/org/htmlunit/general/DedicatedWorkerGlobalScopeClassNameTest.java b/src/test/java/org/htmlunit/general/DedicatedWorkerGlobalScopeClassNameTest.java index 2b2c0852e0..8cca03d150 100644 --- a/src/test/java/org/htmlunit/general/DedicatedWorkerGlobalScopeClassNameTest.java +++ b/src/test/java/org/htmlunit/general/DedicatedWorkerGlobalScopeClassNameTest.java @@ -23,6 +23,7 @@ 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.htmlunit.util.MimeType; import org.junit.Test; import org.junit.runner.RunWith; @@ -6046,7 +6047,6 @@ public void periodicWave() throws Exception { */ @Test @Alerts(DEFAULT = "function Permissions() { [native code] }", - FF = "exception", FF_ESR = "exception") public void permissions() throws Exception { test("Permissions"); @@ -6066,7 +6066,6 @@ public void permissionSettings() throws Exception { */ @Test @Alerts(DEFAULT = "function PermissionStatus() { [native code] }", - FF = "exception", FF_ESR = "exception") public void permissionStatus() throws Exception { test("PermissionStatus"); @@ -6348,7 +6347,6 @@ public void pushEvent() throws Exception { */ @Test @Alerts(DEFAULT = "function PushManager() { [native code] }", - FF = "exception", FF_ESR = "exception") public void pushManager() throws Exception { test("PushManager"); @@ -6377,7 +6375,6 @@ public void pushRegistrationManager() throws Exception { */ @Test @Alerts(DEFAULT = "function PushSubscription() { [native code] }", - FF = "exception", FF_ESR = "exception") public void pushSubscription() throws Exception { test("PushSubscription"); @@ -6388,7 +6385,6 @@ public void pushSubscription() throws Exception { */ @Test @Alerts(DEFAULT = "function PushSubscriptionOptions() { [native code] }", - FF = "exception", FF_ESR = "exception") public void pushSubscriptionOptions() throws Exception { test("PushSubscriptionOptions"); @@ -6717,7 +6713,9 @@ public void selection() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts(DEFAULT = "exception", + FF = "function ServiceWorker() { [native code] }") + @HtmlUnitNYI(FF = "exception") public void serviceWorker() throws Exception { test("ServiceWorker"); } @@ -6726,7 +6724,9 @@ public void serviceWorker() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("exception") + @Alerts(DEFAULT = "exception", + FF = "function ServiceWorkerContainer() { [native code] }") + @HtmlUnitNYI(FF = "exception") public void serviceWorkerContainer() throws Exception { test("ServiceWorkerContainer"); } @@ -6754,7 +6754,6 @@ public void serviceWorkerMessageEvent() throws Exception { */ @Test @Alerts(DEFAULT = "function ServiceWorkerRegistration() { [native code] }", - FF = "exception", FF_ESR = "exception") public void serviceWorkerRegistration() throws Exception { test("ServiceWorkerRegistration"); diff --git a/src/test/java/org/htmlunit/general/DedicatedWorkerGlobalScopeTypeOfTest.java b/src/test/java/org/htmlunit/general/DedicatedWorkerGlobalScopeTypeOfTest.java index 357ee78741..d66d066515 100644 --- a/src/test/java/org/htmlunit/general/DedicatedWorkerGlobalScopeTypeOfTest.java +++ b/src/test/java/org/htmlunit/general/DedicatedWorkerGlobalScopeTypeOfTest.java @@ -6043,7 +6043,6 @@ public void periodicWave() throws Exception { */ @Test @Alerts(DEFAULT = "function", - FF = "undefined", FF_ESR = "undefined") public void permissions() throws Exception { test("Permissions"); @@ -6063,7 +6062,6 @@ public void permissionSettings() throws Exception { */ @Test @Alerts(DEFAULT = "function", - FF = "undefined", FF_ESR = "undefined") public void permissionStatus() throws Exception { test("PermissionStatus"); @@ -6345,7 +6343,6 @@ public void pushEvent() throws Exception { */ @Test @Alerts(DEFAULT = "function", - FF = "undefined", FF_ESR = "undefined") public void pushManager() throws Exception { test("PushManager"); @@ -6374,7 +6371,6 @@ public void pushRegistrationManager() throws Exception { */ @Test @Alerts(DEFAULT = "function", - FF = "undefined", FF_ESR = "undefined") public void pushSubscription() throws Exception { test("PushSubscription"); @@ -6385,7 +6381,6 @@ public void pushSubscription() throws Exception { */ @Test @Alerts(DEFAULT = "function", - FF = "undefined", FF_ESR = "undefined") public void pushSubscriptionOptions() throws Exception { test("PushSubscriptionOptions"); @@ -6714,7 +6709,8 @@ public void selection() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("undefined") + @Alerts(DEFAULT = "undefined", + FF = "function") public void serviceWorker() throws Exception { test("ServiceWorker"); } @@ -6723,7 +6719,8 @@ public void serviceWorker() throws Exception { * @throws Exception if the test fails */ @Test - @Alerts("undefined") + @Alerts(DEFAULT = "undefined", + FF = "function") public void serviceWorkerContainer() throws Exception { test("ServiceWorkerContainer"); } @@ -6751,7 +6748,6 @@ public void serviceWorkerMessageEvent() throws Exception { */ @Test @Alerts(DEFAULT = "function", - FF = "undefined", FF_ESR = "undefined") public void serviceWorkerRegistration() throws Exception { test("ServiceWorkerRegistration");