From 69e2aba347a27a60394795e640fdb214ab453146 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Wed, 30 Oct 2024 06:11:52 -0500 Subject: [PATCH] Remove broken JSNI references from MSIE cleanup (#10022) The previous PR broke three tests which still had JSNI references to removed methods - not caught by the "compile.tests" task. This patch finishes removing these checks in tests, so that we never skip certain assertions based on old browsers, which no longer exist. Follow-up #10014 --- .../google/gwt/canvas/client/CanvasTest.java | 26 +---------- .../gwt/canvas/dom/client/Context2dTest.java | 44 ------------------- .../gwt/storage/client/StorageTest.java | 26 ++--------- 3 files changed, 6 insertions(+), 90 deletions(-) diff --git a/user/test/com/google/gwt/canvas/client/CanvasTest.java b/user/test/com/google/gwt/canvas/client/CanvasTest.java index 47d1a413256..e12bff10bfa 100644 --- a/user/test/com/google/gwt/canvas/client/CanvasTest.java +++ b/user/test/com/google/gwt/canvas/client/CanvasTest.java @@ -31,14 +31,6 @@ */ @DoNotRunWith(Platform.HtmlUnitUnknown) public class CanvasTest extends GWTTestCase { - private static native boolean isFirefox35OrLater() /*-{ - var geckoVersion = @com.google.gwt.dom.client.DOMImplMozilla::getGeckoVersion()(); - return (geckoVersion != -1) && (geckoVersion >= 1009001); - }-*/; - - private static native boolean isWebkit525OrBefore() /*-{ - return @com.google.gwt.dom.client.DOMImplWebkit::isWebkit525OrBefore()(); - }-*/; protected Canvas canvas1; @@ -62,12 +54,6 @@ public void testBlankDataUrl() { return; // don't continue if not supported } - // Safari 3.0 does not support toDataURL(), so the following tests are - // disabled for Safari 3.0 and before. - if (isWebkit525OrBefore()) { - return; - } - canvas1.setHeight("0px"); canvas1.setWidth("0px"); assertEquals(0, canvas1.getOffsetHeight()); @@ -85,12 +71,6 @@ public void testDataUrlWithType() { return; // don't continue if not supported } - // Safari 3.0 does not support toDataURL(), so the following tests are - // disabled for Safari 3.0 and before. - if (isWebkit525OrBefore()) { - return; - } - canvas1.setHeight("10px"); canvas1.setWidth("10px"); canvas1.setCoordinateSpaceHeight(10); @@ -169,10 +149,8 @@ public void testIsSupported() { } // test the isxxxSupported() call if running known-sup or known-not-sup // browsers - if (isFirefox35OrLater()) { - assertTrue(Canvas.isSupported()); - assertTrue(Canvas.isSupported()); - } + assertTrue(Canvas.isSupported()); + assertTrue(Canvas.isSupported()); } @Override diff --git a/user/test/com/google/gwt/canvas/dom/client/Context2dTest.java b/user/test/com/google/gwt/canvas/dom/client/Context2dTest.java index c9dddf70bff..884ba42fd1f 100644 --- a/user/test/com/google/gwt/canvas/dom/client/Context2dTest.java +++ b/user/test/com/google/gwt/canvas/dom/client/Context2dTest.java @@ -41,14 +41,6 @@ public class Context2dTest extends GWTTestCase { protected Canvas canvas1; protected Canvas canvas2; - native boolean isGecko190OrBefore() /*-{ - return @com.google.gwt.dom.client.DOMImplMozilla::isGecko190OrBefore()(); - }-*/; - - native boolean isWebkit525OrBefore() /*-{ - return @com.google.gwt.dom.client.DOMImplWebkit::isWebkit525OrBefore()(); - }-*/; - @Override public String getModuleName() { return "com.google.gwt.canvas.Canvas"; @@ -102,12 +94,6 @@ public void testFillRect() { return; // don't continue if not supported } - // Safari 3.0 does not support getImageData(), so the following tests are disabled for - // Safari 3.0 and before. - if (isWebkit525OrBefore()) { - return; - } - canvas1.setHeight("40px"); canvas1.setWidth("60px"); canvas1.setCoordinateSpaceHeight(80); @@ -232,12 +218,6 @@ public void testGradient() { return; // don't continue if not supported } - // Safari 3.0 does not support getImageData(), so the following tests are disabled for - // Safari 3.0 and before. - if (isWebkit525OrBefore()) { - return; - } - canvas1.setHeight("40px"); canvas1.setWidth("60px"); canvas1.setCoordinateSpaceHeight(40); @@ -277,18 +257,6 @@ public void testImageData() { if (canvas1 == null) { return; // don't continue if not supported } - - // Firefox 3.0 does not support createImageData(), so the following tests are disabled - // for FF 3.0 and before. - if (isGecko190OrBefore()) { - return; - } - - // Safari 3.0 does not support getImageData(), so the following tests are disabled for - // Safari 3.0 and before. - if (isWebkit525OrBefore()) { - return; - } canvas1.setHeight("40px"); canvas1.setWidth("60px"); @@ -406,12 +374,6 @@ public void testPixelManipulation() { return; // don't continue if not supported } - // Safari 3.0 does not support getImageData(), so the following tests are disabled for - // Safari 3.0 and before. - if (isWebkit525OrBefore()) { - return; - } - canvas1.setHeight("40px"); canvas1.setWidth("60px"); canvas1.setCoordinateSpaceHeight(40); @@ -436,12 +398,6 @@ public void testShadows() { if (canvas1 == null) { return; // don't continue if not supported } - - // Firefox 3.0 returns the incorrect shadowBlur value so the following tests are disabled - // for FF 3.0 and before. - if (isGecko190OrBefore()) { - return; - } canvas1.setHeight("40px"); canvas1.setWidth("60px"); diff --git a/user/test/com/google/gwt/storage/client/StorageTest.java b/user/test/com/google/gwt/storage/client/StorageTest.java index c4db8ad765f..bd33e70a891 100644 --- a/user/test/com/google/gwt/storage/client/StorageTest.java +++ b/user/test/com/google/gwt/storage/client/StorageTest.java @@ -28,15 +28,6 @@ public abstract class StorageTest extends GWTTestCase { protected StorageEvent.Handler handler; protected StorageEvent.Handler handler2; - private native boolean isFirefox35OrLater() /*-{ - var geckoVersion = @com.google.gwt.dom.client.DOMImplMozilla::getGeckoVersion()(); - return (geckoVersion != -1) && (geckoVersion >= 1009001); - }-*/; - - private native boolean isSafari3OrBefore() /*-{ - return @com.google.gwt.dom.client.DOMImplWebkit::isWebkit525OrBefore()(); - }-*/; - @Override public String getModuleName() { return "com.google.gwt.storage.Storage"; @@ -400,18 +391,9 @@ public void onStorageChange(StorageEvent event) { } public void testSupported() { - // test the isxxxSupported() call - if (isFirefox35OrLater()) { - assertNotNull(storage); - assertTrue(Storage.isLocalStorageSupported()); - assertTrue(Storage.isSessionStorageSupported()); - assertTrue(Storage.isSupported()); - } - if (isSafari3OrBefore()) { - assertNull(storage); - assertFalse(Storage.isLocalStorageSupported()); - assertFalse(Storage.isSessionStorageSupported()); - assertFalse(Storage.isSupported()); - } + assertNotNull(storage); + assertTrue(Storage.isLocalStorageSupported()); + assertTrue(Storage.isSessionStorageSupported()); + assertTrue(Storage.isSupported()); } }