Skip to content

Commit

Permalink
Remove broken JSNI references from MSIE cleanup (#10022)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
niloc132 authored Oct 30, 2024
1 parent 2ec0134 commit 69e2aba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 90 deletions.
26 changes: 2 additions & 24 deletions user/test/com/google/gwt/canvas/client/CanvasTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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());
Expand All @@ -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);
Expand Down Expand Up @@ -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
Expand Down
44 changes: 0 additions & 44 deletions user/test/com/google/gwt/canvas/dom/client/Context2dTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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);
Expand All @@ -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");
Expand Down
26 changes: 4 additions & 22 deletions user/test/com/google/gwt/storage/client/StorageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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());
}
}

0 comments on commit 69e2aba

Please sign in to comment.