Skip to content

Commit d35c5c5

Browse files
committed
Sporadically failing Browser Tests logging #1466
This commit adds relevant loggings for debugging purposes to the Browser tests which sporadically fail for Edge Browser. contributes to #2098, #2113 and #2063
1 parent 9d3227d commit d35c5c5

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,10 +587,14 @@ public void test_LocationListener_changing() {
587587
@Test
588588
public void test_LocationListener_changed() {
589589
AtomicBoolean changedFired = new AtomicBoolean(false);
590-
browser.addLocationListener(changedAdapter(e -> changedFired.set(true)));
590+
browser.addLocationListener(changedAdapter(e -> {
591+
changedFired.set(true);
592+
System.out.println(e.location);
593+
}));
591594
shell.open();
592595
browser.setText("Hello world");
593596
boolean passed = waitForPassCondition(changedFired::get);
597+
System.out.println(browser.getUrl());
594598
assertTrue("LocationListener.changed() event was never fired", passed);
595599
}
596600
@Test
@@ -658,6 +662,7 @@ public void test_LocationListener_then_ProgressListener() {
658662
browser.addLocationListener(changedAdapter(event -> locationChanged.set(true)));
659663

660664
browser.addProgressListener(completedAdapter(event -> {
665+
System.out.println(browser.getText());
661666
if (locationChanged.get()) {
662667
progressChangedAfterLocationChanged.set(true);
663668
}
@@ -672,7 +677,7 @@ public void test_LocationListener_then_ProgressListener() {
672677
+ "Location changed: " + locationChanged.get() + "\n"
673678
+ "ProgressChangedAfterLocationChanged: " + progressChangedAfterLocationChanged.get() + "\n"
674679
+ "progressChanged: " + progressChanged.get();
675-
680+
System.out.println(browser.getText());
676681
assertTrue(errorMsg, progressChangedAfterLocationChanged.get());
677682
}
678683

@@ -995,13 +1000,14 @@ public void completed(ProgressEvent event) {
9951000

9961001
@Override
9971002
public void changed(ProgressEvent event) {
998-
1003+
System.out.println(browser.getText());
9991004
}
10001005
};
10011006
browser.addProgressListener(l);
10021007
browser.setText("<html><body>This test ensures that the completed listener is called.</body></html>");
10031008
shell.open();
10041009
boolean passed = waitForPassCondition(childCompleted::get);
1010+
System.out.println(browser.getUrl());
10051011
assertTrue(passed);
10061012
}
10071013

0 commit comments

Comments
 (0)