22
22
import static org .junit .Assert .assertNotNull ;
23
23
import static org .junit .Assert .assertNull ;
24
24
import static org .junit .Assert .assertSame ;
25
+ import static org .junit .Assert .assertThrows ;
25
26
import static org .junit .Assert .assertTrue ;
26
27
import static org .junit .Assert .fail ;
27
28
import static org .junit .Assume .assumeFalse ;
@@ -258,14 +259,13 @@ private Browser createBrowser(Shell s, int flags) {
258
259
* Test that if Browser is constructed with the parent being "null", Browser throws an exception.
259
260
*/
260
261
@ Override
261
- @ Test (expected = IllegalArgumentException .class )
262
262
public void test_ConstructorLorg_eclipse_swt_widgets_CompositeI () {
263
263
Browser browser = createBrowser (shell , SWT .NONE );
264
264
browser .dispose ();
265
265
browser = createBrowser (shell , SWT .BORDER );
266
266
// System.out.println("Test_org_eclipse_swt_browser_Browser#test_Constructor*#getBrowserType(): " + browser.getBrowserType());
267
267
browser .dispose ();
268
- browser = createBrowser (null , SWT .NONE ); // Should throw.
268
+ assertThrows ( IllegalArgumentException . class , () -> createBrowser (null , SWT .NONE ));
269
269
}
270
270
271
271
/**
@@ -529,6 +529,8 @@ public void test_LocationListener_changing() {
529
529
}
530
530
@ Test
531
531
public void test_LocationListener_changed () {
532
+ assumeFalse ("behavior is not (yet) supported by Edge browser" , isEdge );
533
+
532
534
AtomicBoolean changedFired = new AtomicBoolean (false );
533
535
browser .addLocationListener (changedAdapter (e -> changedFired .set (true )));
534
536
shell .open ();
@@ -538,6 +540,8 @@ public void test_LocationListener_changed() {
538
540
}
539
541
@ Test
540
542
public void test_LocationListener_changingAndOnlyThenChanged () {
543
+ assumeFalse ("behavior is not (yet) supported by Edge browser" , isEdge );
544
+
541
545
// Test proper order of events.
542
546
// Check that 'changed' is only fired after 'changing' has fired at least once.
543
547
AtomicBoolean changingFired = new AtomicBoolean (false );
@@ -581,6 +585,8 @@ else if (!changingFired.get())
581
585
582
586
@ Test
583
587
public void test_LocationListener_then_ProgressListener () {
588
+ assumeFalse ("behavior is not (yet) supported by Edge browser" , isEdge );
589
+
584
590
AtomicBoolean locationChanged = new AtomicBoolean (false );
585
591
AtomicBoolean progressChanged = new AtomicBoolean (false );
586
592
AtomicBoolean progressChangedAfterLocationChanged = new AtomicBoolean (false );
@@ -674,6 +680,8 @@ public void changed(LocationEvent event) {
674
680
@ Test
675
681
/** Ensue that only one changed and one completed event are fired for url changes */
676
682
public void test_LocationListener_ProgressListener_noExtraEvents () {
683
+ assumeFalse ("behavior is not (yet) supported by Edge browser" , isEdge );
684
+
677
685
AtomicInteger changedCount = new AtomicInteger (0 );
678
686
AtomicInteger completedCount = new AtomicInteger (0 );
679
687
@@ -780,6 +788,8 @@ public void test_OpenWindowListener_open_ChildPopup() {
780
788
/** Validate event order : Child's visibility should come before progress completed event */
781
789
@ Test
782
790
public void test_OpenWindow_Progress_Listener_ValidateEventOrder () {
791
+ assumeFalse ("behavior is not (yet) supported by Edge browser" , isEdge );
792
+
783
793
AtomicBoolean windowOpenFired = new AtomicBoolean (false );
784
794
AtomicBoolean childCompleted = new AtomicBoolean (false );
785
795
AtomicBoolean visibilityShowed = new AtomicBoolean (false );
@@ -1259,6 +1269,8 @@ public void completed(ProgressEvent event) {
1259
1269
*/
1260
1270
@ Test
1261
1271
public void test_VisibilityWindowListener_eventSize () {
1272
+ assumeFalse ("behavior is not (yet) supported by Edge browser" , isEdge );
1273
+
1262
1274
shell .setSize (200 ,300 );
1263
1275
AtomicBoolean childCompleted = new AtomicBoolean (false );
1264
1276
AtomicReference <Point > result = new AtomicReference <>(new Point (0 ,0 ));
@@ -1448,6 +1460,8 @@ public void completed(ProgressEvent event) {
1448
1460
*/
1449
1461
@ Test
1450
1462
public void test_LocationListener_evaluateInCallback () {
1463
+ assumeFalse ("behavior is not (yet) supported by Edge browser" , isEdge );
1464
+
1451
1465
AtomicBoolean changingFinished = new AtomicBoolean (false );
1452
1466
AtomicBoolean changedFinished = new AtomicBoolean (false );
1453
1467
browser .addLocationListener (new LocationListener () {
@@ -1496,6 +1510,8 @@ public void changed(LocationEvent event) {
1496
1510
/** Verify that evaluation works inside an OpenWindowListener */
1497
1511
@ Test
1498
1512
public void test_OpenWindowListener_evaluateInCallback () {
1513
+ assumeFalse ("behavior is not (yet) supported by Edge browser" , isEdge );
1514
+
1499
1515
AtomicBoolean eventFired = new AtomicBoolean (false );
1500
1516
browser .addOpenWindowListener (event -> {
1501
1517
browser .evaluate ("SWTopenListener = true" );
0 commit comments