@@ -86,7 +86,7 @@ public class Test_org_eclipse_swt_browser_Browser extends Test_org_eclipse_swt_w
86
86
public TestName name = new TestName ();
87
87
88
88
Browser browser ;
89
- boolean isChromium = false , isEdge = false ;
89
+ boolean isEdge = false ;
90
90
91
91
static int [] webkitGtkVersionInts = new int [3 ];
92
92
@@ -112,7 +112,6 @@ public void setUp() {
112
112
shell .setLayout (new FillLayout ());
113
113
browser = new Browser (shell , SWT .NONE );
114
114
115
- isChromium = browser .getBrowserType ().equals ("chromium" );
116
115
isEdge = browser .getBrowserType ().equals ("edge" );
117
116
118
117
String shellTitle = name .getMethodName ();
@@ -226,7 +225,7 @@ public void test_get_set_Cookies() {
226
225
public void test_getChildren () {
227
226
// Win32's Browser is a special case. It has 1 child by default, the OleFrame.
228
227
// See Bug 499387 and Bug 511874
229
- if (SwtTestUtil .isWindows && !isChromium && ! isEdge ) {
228
+ if (SwtTestUtil .isWindows && !isEdge ) {
230
229
int childCount = composite .getChildren ().length ;
231
230
String msg = "Browser on Win32 is a special case, the first child is an OleFrame (ActiveX control). Actual child count is: " + childCount ;
232
231
assertTrue (msg , childCount == 1 );
@@ -313,11 +312,7 @@ public void test_LocationListener_changing() {
313
312
AtomicBoolean changingFired = new AtomicBoolean (false );
314
313
browser .addLocationListener (changingAdapter (e -> changingFired .set (true )));
315
314
shell .open ();
316
- if (isChromium ) {
317
- browser .setUrl ("about:version" );
318
- } else { // Chromium cannot fire changing event for setText
319
- browser .setText ("Hello world" );
320
- }
315
+ browser .setText ("Hello world" );
321
316
boolean passed = waitForPassCondition (changingFired ::get );
322
317
assertTrue ("LocationListener.changing() event was never fired" , passed );
323
318
}
@@ -354,11 +349,7 @@ public void changed(LocationEvent event) {
354
349
}
355
350
});
356
351
shell .open ();
357
- if (isChromium ) {
358
- browser .setUrl ("about:version" );
359
- } else { // Chromium cannot fire changing event for setText
360
- browser .setText ("Hello world" );
361
- }
352
+ browser .setText ("Hello world" );
362
353
waitForPassCondition (finished ::get );
363
354
364
355
if (finished .get () && changingFired .get () && changedFired .get () && !changedFiredTooEarly .get ()) {
@@ -435,11 +426,7 @@ public void changed(LocationEvent event) {
435
426
}
436
427
}));
437
428
shell .open ();
438
- if (isChromium ) {
439
- browser .setUrl ("about:version" );
440
- } else { // Chromium cannot fire changing event for setText
441
- browser .setText ("You should not see this message." );
442
- }
429
+ browser .setText ("You should not see this message." );
443
430
444
431
// We must wait for events *not* to fire.
445
432
// On Gtk, Quadcore (Intel i7-4870HQ pci-e SSD, all events fire after ~80ms.
@@ -993,7 +980,6 @@ public void show(WindowEvent event) {
993
980
/** Verify that if multiple child shells are open, no duplicate visibility events are sent. */
994
981
@ Test
995
982
public void test_VisibilityWindowListener_multiple_shells () {
996
- assumeTrue (!isChromium ); // this fails sometimes due cef limitation, can be enabled on newer versions.
997
983
AtomicBoolean secondChildCompleted = new AtomicBoolean (false );
998
984
AtomicInteger childCount = new AtomicInteger (0 );
999
985
@@ -1257,13 +1243,9 @@ public void changed(LocationEvent event) {
1257
1243
});
1258
1244
1259
1245
shell .open ();
1260
- if (isChromium ) {
1261
- browser .setUrl ("about:version" );
1262
- } else { // Chromium cannot fire changing event for setText
1263
- browser .setText ("<body>Hello <b>World</b></body>" );
1264
- }
1246
+ browser .setText ("<body>Hello <b>World</b></body>" );
1265
1247
// Wait till both listeners were fired.
1266
- if (SwtTestUtil .isWindows && ! isChromium ) {
1248
+ if (SwtTestUtil .isWindows ) {
1267
1249
waitForPassCondition (changingFinished ::get ); // Windows doesn't reach changedFinished.get();
1268
1250
} else
1269
1251
waitForPassCondition (() -> (changingFinished .get () && changedFinished .get ()));
@@ -1279,10 +1261,7 @@ public void changed(LocationEvent event) {
1279
1261
"\n changed: fired:" + changedFinished .get () + " evaluated:" + changed ;
1280
1262
boolean passed = false ;
1281
1263
1282
- if (isChromium ) {
1283
- // On Chromium, evaluation in 'changing' fails.
1284
- passed = changingFinished .get () && changedFinished .get () && changed ; // && changing (broken)
1285
- } else if (SwtTestUtil .isGTK ) {
1264
+ if (SwtTestUtil .isGTK ) {
1286
1265
// Evaluation works in all cases.
1287
1266
passed = changingFinished .get () && changedFinished .get () && changed && changing ;
1288
1267
} else if (SwtTestUtil .isCocoa ) {
@@ -1299,7 +1278,6 @@ public void changed(LocationEvent event) {
1299
1278
/** Verify that evaluation works inside an OpenWindowListener */
1300
1279
@ Test
1301
1280
public void test_OpenWindowListener_evaluateInCallback () {
1302
- assumeTrue (!isChromium ); // This works on Webkit1, but can sporadically fail, see Bug 509411
1303
1281
AtomicBoolean eventFired = new AtomicBoolean (false );
1304
1282
browser .addOpenWindowListener (event -> {
1305
1283
browser .evaluate ("SWTopenListener = true" );
@@ -1401,7 +1379,7 @@ public void test_setFocus_toChild_beforeOpen() {
1401
1379
/** Text without html tags */
1402
1380
@ Test
1403
1381
public void test_getText () {
1404
- if (SwtTestUtil .isWindows || isChromium ) {
1382
+ if (SwtTestUtil .isWindows ) {
1405
1383
// Windows' Browser implementation returns the processed HTML rather than the original one.
1406
1384
// The processed webpage has html tags added to it.
1407
1385
getText_helper ("helloWorld" , "<html><head></head><body>helloWorld</body></html>" );
@@ -1423,7 +1401,7 @@ public void test_getText_html() {
1423
1401
@ Test
1424
1402
public void test_getText_script () {
1425
1403
String testString = "<html><head></head><body>hello World<script>document.body.style.backgroundColor = \" red\" ;</script></body></html>" ;
1426
- if (SwtTestUtil .isWindows || isChromium ) {
1404
+ if (SwtTestUtil .isWindows ) {
1427
1405
// Windows' Browser implementation returns the processed HTML rather than the original one.
1428
1406
// The processed page injects "style" property into the body from the script.
1429
1407
getText_helper (testString , "<html><head></head><body style=\" background-color: red;\" >hello World<script>document.body.style.backgroundColor = \" red\" ;</script></body></html>" );
@@ -1439,7 +1417,7 @@ public void test_getText_script() {
1439
1417
@ Test
1440
1418
public void test_getText_doctype () {
1441
1419
String testString = "<!DOCTYPE html><html><head></head><body>hello World</body></html>" ;
1442
- if (SwtTestUtil .isWindows && ! isChromium ) {
1420
+ if (SwtTestUtil .isWindows ) {
1443
1421
// Windows' Browser implementation returns the processed HTML rather than the original one.
1444
1422
// The processed page strips out DOCTYPE.
1445
1423
getText_helper (testString , "<html><head></head><body>hello World</body></html>" );
0 commit comments