Skip to content

Commit 648c9a5

Browse files
committed
Add some debug output
1 parent a92c14b commit 648c9a5

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/Edge.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,7 @@ void setupBrowser(int hr, long pv) {
596596
error(SWT.ERROR_THREAD_INVALID_ACCESS, hr);
597597
break;
598598
default:
599+
System.err.println("WebView instantiation failed with result: " + hr);
599600
containingEnvironment.instances().remove(this);
600601
error(SWT.ERROR_NO_HANDLES, hr);
601602
}

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -735,14 +735,17 @@ public void changed(LocationEvent event) {
735735

736736
@Test
737737
public void test_LocationListener_LocationListener_ordered_changing () {
738-
List<String> locations = new ArrayList<>();
739-
browser.addLocationListener(changingAdapter(event -> locations.add(event.location)));
738+
List<String> locations = Collections.synchronizedList(new ArrayList<>());
739+
browser.addLocationListener(changingAdapter(event -> {
740+
System.err.println("Location: " + event.location);
741+
locations.add(event.location);
742+
}));
740743
shell.open();
741744
browser.setText("You should not see this message.");
742745
String url = getValidUrl();
743746
browser.setUrl(url);
744-
waitForPassCondition(() -> locations.size() == 2);
745-
assertTrue("Change of locations do not fire in order.", locations.get(0).equals("about:blank") && locations.get(1).contains("testWebsiteWithTitle.html"));
747+
assertTrue("Change of locations do not fire in order: " + locations.toString(), waitForPassCondition(() -> locations.size() == 2));
748+
assertTrue("Change of locations do not fire in order", locations.get(0).equals("about:blank") && locations.get(1).contains("testWebsiteWithTitle.html"));
746749
}
747750

748751
private String getValidUrl() {
@@ -1942,6 +1945,7 @@ public void test_evaluate_null() {
19421945
// Boolen only used as dummy placeholder so the object is not null.
19431946
final AtomicReference<Object> returnValue = new AtomicReference<>(true);
19441947
browser.addProgressListener(completedAdapter(event -> {
1948+
returnValue.set(false);
19451949
Object evalResult = browser.evaluate("return null");
19461950
returnValue.set(evalResult);
19471951
if (debug_verbose_output)
@@ -1951,7 +1955,7 @@ public void test_evaluate_null() {
19511955
browser.setText("<html><body>HelloWorld</body></html>");
19521956
shell.open();
19531957
boolean passed = waitForPassCondition(() -> returnValue.get() == null);
1954-
assertTrue("Evaluate did not return a null. Timed out.", passed);
1958+
assertTrue("Evaluate did not return a null (current value: " + returnValue.get() + "). Timed out.", passed);
19551959
}
19561960

19571961
/**

0 commit comments

Comments
 (0)