Bug 499387: Clean up, Speed up and document Browser test Suite

Fix:
- Adding setWidget(browser) to setUp(), so that browser occupies the
whole shell instead of half of it.

Refactor:
- Consolidated most browser tests into a single class. (There were many
classes with only a single test case).

Speeding up some test cases:
- test_forward : There is no need to wait in this test case as no pages
are loded.
- test_back : as above.
- test_isBackEnabled : as above.
- test_refresh : as above.
- test_stop : There is no need to sleep for 10 seconds after stop
finishes. Stop is not async.

- Split test_setTextLjava_lang_String into that and "test_setTextNull"

etc... similar logic for most refactored tests.

Change-Id: I31b79feeabcc28685b56e0ce1315fd4065f8e206
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=499387
Signed-off-by: Leo Ufimtsev <lufimtse@redhat.com>
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/AllBrowserTests.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/AllBrowserTests.java
index a4724f2..f069368 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/AllBrowserTests.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/AllBrowserTests.java
@@ -20,21 +20,11 @@
  */
 @RunWith(Suite.class)
 @Suite.SuiteClasses({
-	Test_org_eclipse_swt_browser_Browser.class,	
-	Test_org_eclipse_swt_browser_CloseWindowListener.class,
-	Test_org_eclipse_swt_browser_LocationAdapter.class,
-	Test_org_eclipse_swt_browser_LocationListener.class,
-	Test_org_eclipse_swt_browser_OpenWindowListener.class,
-	Test_org_eclipse_swt_browser_ProgressAdapter.class,
-	Test_org_eclipse_swt_browser_ProgressListener.class,
-	Test_org_eclipse_swt_browser_StatusTextListener.class,
-	Test_org_eclipse_swt_browser_TitleListener.class,
-	Test_org_eclipse_swt_browser_VisibilityWindowAdapter.class,
-	Test_org_eclipse_swt_browser_VisibilityWindowListener.class,
+	Test_org_eclipse_swt_browser_Browser.class,
 	org.eclipse.swt.tests.junit.browser.Test_BrowserSuite.class,
 })
 public class AllBrowserTests {
-	
+
 public static void main(String[] args) {
 	JUnitCore.main(AllBrowserTests.class.getName());
 }
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java
index 5d1a42e..ed6ef1b 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java
@@ -18,17 +18,21 @@
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.browser.Browser;
 import org.eclipse.swt.browser.CloseWindowListener;
+import org.eclipse.swt.browser.LocationAdapter;
 import org.eclipse.swt.browser.LocationEvent;
 import org.eclipse.swt.browser.LocationListener;
 import org.eclipse.swt.browser.OpenWindowListener;
+import org.eclipse.swt.browser.ProgressAdapter;
 import org.eclipse.swt.browser.ProgressEvent;
 import org.eclipse.swt.browser.ProgressListener;
 import org.eclipse.swt.browser.StatusTextListener;
 import org.eclipse.swt.browser.TitleListener;
+import org.eclipse.swt.browser.VisibilityWindowAdapter;
 import org.eclipse.swt.browser.VisibilityWindowListener;
 import org.eclipse.swt.browser.WindowEvent;
 import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -39,12 +43,15 @@
  */
 public class Test_org_eclipse_swt_browser_Browser extends Test_org_eclipse_swt_widgets_Composite {
 
+	Browser browser;
+
 @Override
 @Before
 public void setUp() {
 	super.setUp();
 	shell.setLayout(new FillLayout());
 	browser = new Browser(shell, SWT.NONE);
+	setWidget(browser);
 }
 
 /**
@@ -69,7 +76,7 @@
  * Test that if you invoke the addWindowListener without a listener, a proper IllegalArgumentException is thrown.
  */
 @Test
-public void test_addCloseWindowListenerLorg_eclipse_swt_browser_CloseWindowListener() {
+public void test_listener_addCloseWindowListenerLorg_eclipse_swt_browser_CloseWindowListener() {
 	shell.setText("test_addCloseWindowListenerLorg_eclipse_swt_browser_CloseWindowListener");
 	try {
 		browser.addCloseWindowListener(null);
@@ -88,7 +95,7 @@
  * Test that addLocationListener() throws a IllegalArgumentException if no arument given.
  */
 @Test
-public void test_addLocationListenerLorg_eclipse_swt_browser_LocationListener() {
+public void test_listener_addLocationListenerLorg_eclipse_swt_browser_LocationListener() {
 	shell.setText("test_addLocationListenerLorg_eclipse_swt_browser_LocationListener");
 	try {
 		browser.addLocationListener(null);
@@ -113,7 +120,7 @@
  * Tests that when addOpenWindowListener() is called without an argument, a IllegalArgumentException is thrown.
  */
 @Test
-public void test_addOpenWindowListenerLorg_eclipse_swt_browser_OpenWindowListener() {
+public void test_listener_addOpenWindowListenerLorg_eclipse_swt_browser_OpenWindowListener() {
 	shell.setText("test_addOpenWindowListenerLorg_eclipse_swt_browser_OpenWindowListener");
 	try {
 		browser.addOpenWindowListener(null);
@@ -132,7 +139,7 @@
  * Test that if addProgressListener() is called without a listener, IllegalArgumentException is thrown.
  */
 @Test
-public void test_addProgressListenerLorg_eclipse_swt_browser_ProgressListener() {
+public void test_listener_addProgressListenerLorg_eclipse_swt_browser_ProgressListener() {
 	shell.setText("test_addProgressListenerLorg_eclipse_swt_browser_ProgressListener");
 	try {
 		browser.addProgressListener(null);
@@ -158,7 +165,7 @@
  * Test that if addStatusTextListener() is called without a listener, IllegalArgumentException is thrown.
  */
 @Test
-public void test_addStatusTextListenerLorg_eclipse_swt_browser_StatusTextListener() {
+public void test_listener_addStatusTextListenerLorg_eclipse_swt_browser_StatusTextListener() {
 	shell.setText("test_addStatusTextListenerLorg_eclipse_swt_browser_StatusTextListener");
 	try {
 		browser.addStatusTextListener(null);
@@ -177,7 +184,7 @@
  * Test that if addTitleListener() is called without a listener, IllegalArgumentException is thrown.
  */
 @Test
-public void test_addTitleListenerLorg_eclipse_swt_browser_TitleListener() {
+public void test_listener_addTitleListenerLorg_eclipse_swt_browser_TitleListener() {
 	shell.setText("test_addTitleLorg_eclipse_swt_browser_TitleListener");
 	try {
 		browser.addTitleListener(null);
@@ -196,7 +203,7 @@
  * Test that if addTitleListener() is called without a listener, IllegalArgumentException is thrown.
  */
 @Test
-public void test_addVisibilityWindowListenerLorg_eclipse_swt_browser_VisibilityWindowListener() {
+public void test_listener_addVisibilityWindowListenerLorg_eclipse_swt_browser_VisibilityWindowListener() {
 	shell.setText("test_addVisibilityWindowListenerLorg_eclipse_swt_browser_VisibilityWindowListener");
 	try {
 		browser.addVisibilityWindowListener(null);
@@ -218,25 +225,10 @@
 }
 
 /**
- * Test that going back in history, when no new pages were visited, returns false.
- */
-@Test
-public void test_back() {
-	shell.setText("test_back");
-	for (int i = 0; i < 10; i++) {
-		browser.back();
-		runLoopTimer(1);
-	}
-	/* returning 10 times in history - expecting false is returned */
-	boolean result = browser.back();
-	assertFalse(result);
-}
-
-/**
  * Test that if execute() is called with 'null' as argument, IllegalArgumentException is thrown.
  */
 @Test
-public void test_executeLjava_lang_String() {
+public void test_listener_executeLjava_lang_String() {
 	shell.setText("test_executeLjava_lang_String");
 	try {
 		browser.execute(null);
@@ -249,15 +241,278 @@
 	 * since a document must have been loaded to execute a script on it.
 	 */
 }
+
+
+/**
+ * Test that going back in history, when no new pages were visited, returns false.
+ */
+@Test
+public void test_back() {
+	shell.setText("test_back");
+	for (int i = 0; i < 2; i++) {
+		browser.back();
+	}
+	/* returning 10 times in history - expecting false is returned */
+	boolean result = browser.back();
+	assertFalse(result);
+}
+
+/**
+ * Test that if removeLocationListener() is called without a listener, IllegalArgumentException is thrown.
+ */
+@Test
+public void test_listener_removeLocationListenerLorg_eclipse_swt_browser_LocationListener() {
+	try {
+		browser.removeLocationListener(null);
+		fail("No exception thrown for listener == null");
+	}
+	catch (IllegalArgumentException e) {
+	}
+	// tested in addLocationListener
+}
+
+/**
+ * Test that if removeOpenWindowListener() is called without a listener, IllegalArgumentException is thrown.
+ */
+@Test
+public void test_listener_removeOpenWindowListenerLorg_eclipse_swt_browser_OpenWindowListener() {
+	try {
+		browser.removeOpenWindowListener(null);
+		fail("No exception thrown for listener == null");
+	}
+	catch (IllegalArgumentException e) {
+	}
+	// tested in addOpenWindowListener
+}
+
+/**
+ * Test that if removeProgressListener() is called without a listener, IllegalArgumentException is thrown.
+ */
+@Test
+public void test_listener_removeProgressListenerLorg_eclipse_swt_browser_ProgressListener() {
+	try {
+		browser.removeProgressListener(null);
+		fail("No exception thrown for listener == null");
+	}
+	catch (IllegalArgumentException e) {
+	}
+	// tested in addProgressListener
+}
+
+/**
+ * Test that if removeStatusTextListener() is called without a listener, IllegalArgumentException is thrown.
+ */
+@Test
+public void test_listener_removeStatusTextListenerLorg_eclipse_swt_browser_StatusTextListener() {
+	try {
+		browser.removeStatusTextListener(null);
+		fail("No exception thrown for listener == null");
+	}
+	catch (IllegalArgumentException e) {
+	}
+	// tested in addStatusTextListener
+}
+
+/**
+ * Test that if removeTitleListener() is called without a listener, IllegalArgumentException is thrown.
+ */
+@Test
+public void test_listener_removeTitleListenerLorg_eclipse_swt_browser_TitleListener() {
+	try {
+		browser.removeTitleListener(null);
+		fail("No exception thrown for listener == null");
+	}
+	catch (IllegalArgumentException e) {
+	}
+	// tested in addTitleListener
+}
+
+/**
+ * Test that if removeVisibilityWindowListener() is called without a listener, IllegalArgumentException is thrown.
+ */
+@Test
+public void test_listener_removeVisibilityWindowListenerLorg_eclipse_swt_browser_VisibilityWindowListener() {
+	try {
+		browser.removeVisibilityWindowListener(null);
+		fail("No exception thrown for listener == null");
+	}
+	catch (IllegalArgumentException e) {
+	}
+	// tested in addVisibilityWindowListener
+}
+
+/**
+ * Test that if removeCloseWindowListener() is called without a listener, IllegalArgumentException is thrown.
+ */
+@Test
+public void test_listener_removeCloseWindowListenerLorg_eclipse_swt_browser_CloseWindowListener() {
+	try {
+		browser.removeCloseWindowListener(null);
+		fail("No exception thrown for listener == null");
+	}
+	catch (IllegalArgumentException e) {
+	}
+	// tested in addCloseWindowListener
+}
+
+
+
+/**
+ * Test that addCloseWindowListener() doesn't throw an error.
+ */
+@Test
+public void test_listener_closeLorg_eclipse_swt_browser_WindowEvent() {
+	Display display = Display.getCurrent();
+	Shell shell = new Shell(display);
+	Browser browser = new Browser(shell, SWT.NONE);
+	browser.addCloseWindowListener(event -> {
+	});
+	shell.close();
+}
+
+/**
+ * Test that addLocationListener() doesn't throw an error.
+ */
+@Test
+public void test_listener_changedLorg_eclipse_swt_browser_LocationEvent() {
+	Display display = Display.getCurrent();
+	Shell shell = new Shell(display);
+	Browser browser = new Browser(shell, SWT.NONE);
+	LocationAdapter adapter = new LocationAdapter() {
+	};
+	browser.addLocationListener(adapter);
+	shell.close();
+}
+
+
+@Test
+public void test_listener_openWindowLorg_eclipse_swt_browser_WindowEvent() {
+	Display display = Display.getCurrent();
+	Shell shell = new Shell(display);
+	Browser browser = new Browser(shell, SWT.NONE);
+	browser.addOpenWindowListener(event -> {
+	});
+	shell.close();
+}
+
+@Test
+public void test_adapter_ProgressAdaptor() {
+	new ProgressAdapter() {};
+}
+
+@Test
+public void test_listener_changedLorg_eclipse_swt_browser_ProgressEvent_adapter() {
+	Display display = Display.getCurrent();
+	Shell shell = new Shell(display);
+	Browser browser = new Browser(shell, SWT.NONE);
+	browser.addProgressListener(new ProgressAdapter() {});
+	shell.close();
+}
+
+
+@Test
+public void test_listener_changedLorg_eclipse_swt_browser_ProgressEvent() {
+	Display display = Display.getCurrent();
+	Shell shell = new Shell(display);
+	Browser browser = new Browser(shell, SWT.NONE);
+	browser.addProgressListener(new ProgressListener() {
+		@Override
+		public void changed(ProgressEvent event) {
+		}
+		@Override
+		public void completed(ProgressEvent event) {
+		}
+	});
+	shell.close();
+}
+
+@Test
+public void test_listener_changedLorg_eclipse_swt_browser_StatusTextEvent() {
+	Display display = Display.getCurrent();
+	Shell shell = new Shell(display);
+	Browser browser = new Browser(shell, SWT.NONE);
+	browser.addStatusTextListener(event -> {
+	});
+	shell.close();
+}
+
+@Test
+public void test_listener_changedLorg_eclipse_swt_browser_TitleEvent() {
+	Display display = Display.getCurrent();
+	Shell shell = new Shell(display);
+	Browser browser = new Browser(shell, SWT.NONE);
+	browser.addTitleListener(event -> {
+	});
+	shell.close();
+}
+
+@Test
+public void test_adapter_VisibilityWindowAdapter_() {
+	new VisibilityWindowAdapter() {};
+}
+
+@Test
+public void test_listener_hideLorg_eclipse_swt_browser_WindowEvent_adapter() {
+	Display display = Display.getCurrent();
+	Shell shell = new Shell(display);
+	Browser browser = new Browser(shell, SWT.NONE);
+	browser.addVisibilityWindowListener(new VisibilityWindowAdapter(){});
+	shell.close();
+}
+
+@Test
+public void test_listener_hideLorg_eclipse_swt_browser_WindowEvent() {
+	Display display = Display.getCurrent();
+	Shell shell = new Shell(display);
+	Browser browser = new Browser(shell, SWT.NONE);
+	browser.addVisibilityWindowListener(new VisibilityWindowListener() {
+		@Override
+		public void hide(WindowEvent event) {
+		}
+		@Override
+		public void show(WindowEvent event) {
+		}
+	});
+	shell.close();
+}
+
+/**
+ * Test that calling setText() with null as argument leads to IllegalArgumentException.
+ */
+@Test
+public void test_setTextNull() {
+	shell.setText("test_setTextNull");
+	try {
+		browser.setText(null);
+		fail("No exception thrown for text == null");
+	}
+	catch (IllegalArgumentException e) {
+	}
+}
+
+/**
+ * Test that setText() without an argument throws a IllegalArgumentException.
+ */
+@Test
+public void test_setUrlWithNullArg() {
+	shell.setText("test_setUrlLjava_lang_String");
+	try {
+		browser.setUrl(null);
+		fail("No exception thrown for url == null");
+	}
+	catch (IllegalArgumentException e) {
+	}
+}
+
+
 /**
  * Test that going forward in history (without having gone back before) returns false.
  */
 @Test
 public void test_forward() {
 	shell.setText("test_forward");
-	for (int i = 0; i < 10; i++) {
+	for (int i = 0; i < 2; i++) {
 		browser.forward();
-		runLoopTimer(1);
 	}
 	/* going forward 10 times in history - expecting false is returned */
 	boolean result = browser.forward();
@@ -287,9 +542,8 @@
 	/* back should return the same value that isBackEnabled previously returned */
 	assertEquals(browser.isBackEnabled(), browser.back());
 
-	for (int i = 0; i < 10; i++) {
+	for (int i = 0; i < 2; i++) {
 		browser.back();
-		runLoopTimer(1);
 	}
 	/* going back 10 times in history - expecting false is returned */
 	boolean result = browser.isBackEnabled();
@@ -310,7 +564,6 @@
 
 	for (int i = 0; i < 10; i++) {
 		browser.forward();
-		runLoopTimer(1);
 	}
 	/* going forward 10 times in history - expecting false is returned */
 	boolean result = browser.isForwardEnabled();
@@ -324,111 +577,12 @@
 @Test
 public void test_refresh() {
 	shell.setText("test_refresh");
-	for (int i = 0; i < 10; i++) {
+	for (int i = 0; i < 2; i++) {
 		browser.refresh();
-		runLoopTimer(1);
 	}
 }
 
 
-/**
- * Test that if removeCloseWindowListener() is called without a listener, IllegalArgumentException is thrown.
- */
-@Test
-public void test_removeCloseWindowListenerLorg_eclipse_swt_browser_CloseWindowListener() {
-	try {
-		browser.removeCloseWindowListener(null);
-		fail("No exception thrown for listener == null");
-	}
-	catch (IllegalArgumentException e) {
-	}
-	// tested in addCloseWindowListener
-}
-
-/**
- * Test that if removeLocationListener() is called without a listener, IllegalArgumentException is thrown.
- */
-@Test
-public void test_removeLocationListenerLorg_eclipse_swt_browser_LocationListener() {
-	try {
-		browser.removeLocationListener(null);
-		fail("No exception thrown for listener == null");
-	}
-	catch (IllegalArgumentException e) {
-	}
-	// tested in addLocationListener
-}
-
-/**
- * Test that if removeOpenWindowListener() is called without a listener, IllegalArgumentException is thrown.
- */
-@Test
-public void test_removeOpenWindowListenerLorg_eclipse_swt_browser_OpenWindowListener() {
-	try {
-		browser.removeOpenWindowListener(null);
-		fail("No exception thrown for listener == null");
-	}
-	catch (IllegalArgumentException e) {
-	}
-	// tested in addOpenWindowListener
-}
-
-/**
- * Test that if removeProgressListener() is called without a listener, IllegalArgumentException is thrown.
- */
-@Test
-public void test_removeProgressListenerLorg_eclipse_swt_browser_ProgressListener() {
-	try {
-		browser.removeProgressListener(null);
-		fail("No exception thrown for listener == null");
-	}
-	catch (IllegalArgumentException e) {
-	}
-	// tested in addProgressListener
-}
-
-/**
- * Test that if removeStatusTextListener() is called without a listener, IllegalArgumentException is thrown.
- */
-@Test
-public void test_removeStatusTextListenerLorg_eclipse_swt_browser_StatusTextListener() {
-	try {
-		browser.removeStatusTextListener(null);
-		fail("No exception thrown for listener == null");
-	}
-	catch (IllegalArgumentException e) {
-	}
-	// tested in addStatusTextListener
-}
-
-
-/**
- * Test that if removeTitleListener() is called without a listener, IllegalArgumentException is thrown.
- */
-@Test
-public void test_removeTitleListenerLorg_eclipse_swt_browser_TitleListener() {
-	try {
-		browser.removeTitleListener(null);
-		fail("No exception thrown for listener == null");
-	}
-	catch (IllegalArgumentException e) {
-	}
-	// tested in addTitleListener
-}
-
-/**
- * Test that if removeVisibilityWindowListener() is called without a listener, IllegalArgumentException is thrown.
- */
-@Test
-public void test_removeVisibilityWindowListenerLorg_eclipse_swt_browser_VisibilityWindowListener() {
-	try {
-		browser.removeVisibilityWindowListener(null);
-		fail("No exception thrown for listener == null");
-	}
-	catch (IllegalArgumentException e) {
-	}
-	// tested in addVisibilityWindowListener
-}
 
 /**
  * Test that HTML can be loaded into the browser.
@@ -447,37 +601,22 @@
 	html += "</BODY></HTML>";
 	boolean result = browser.setText(html);
 	assertTrue(result);
-	runLoopTimer(10);
-
-	try {
-		browser.setText(null);
-		fail("No exception thrown for text == null");
-	}
-	catch (IllegalArgumentException e) {
-	}
+	runLoopTimer(2);
 }
 
 /**
- * Test that setText() without an argument throws a IllegalArgumentException and that
- * setURL with a live URL doesn't throw an exception.
- * (TODO This should be split into two test cases)
+ * Test that setUrl() finishes without throwing an error.
  */
 @Test
-public void test_setUrlLjava_lang_String() {
-	shell.setText("test_setUrlLjava_lang_String");
-	try {
-		browser.setUrl(null);
-		fail("No exception thrown for url == null");
-	}
-	catch (IllegalArgumentException e) {
-	}
-
-
+public void test_setUrl() {
+	shell.setText("test_setUrl");
 	/* THIS TEST REQUIRES WEB ACCESS! How else can we really test the http:// part of a browser widget? */
-	browser.setUrl("http://www.eclipse.org/swt");
-	runLoopTimer(10);
+	assert(browser.setUrl("http://www.eclipse.org/swt"));
+	runLoopTimer(2);
+	// TODO - it would be good to verify that the page actually loaded. ex download the webpage etc..
 }
 
+
 /**
  * Test that a page load an be stopped (stop()) without throwing an exception.
  */
@@ -488,12 +627,9 @@
 	browser.setUrl("http://www.eclipse.org/swt");
 	runLoopTimer(1);
 	browser.stop();
-	runLoopTimer(10);
 }
 
 /* custom */
-Browser browser;
-
 void runLoopTimer(final int seconds) {
 	final boolean[] exit = {false};
 	new Thread() {
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_CloseWindowListener.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_CloseWindowListener.java
deleted file mode 100644
index bb4105e..0000000
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_CloseWindowListener.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.tests.junit;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.browser.Browser;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.junit.Test;
-
-/**
- * Automated Test Suite for class org.eclipse.swt.browser.CloseWindowListener
- *
- * @see org.eclipse.swt.browser.CloseWindowListener
- */
-public class Test_org_eclipse_swt_browser_CloseWindowListener {
-
-@Test
-public void test_closeLorg_eclipse_swt_browser_WindowEvent() {
-	Display display = Display.getCurrent();
-	Shell shell = new Shell(display);
-	Browser browser = new Browser(shell, SWT.NONE);
-	browser.addCloseWindowListener(event -> {
-	});
-	shell.close();
-}
-}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_LocationAdapter.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_LocationAdapter.java
deleted file mode 100644
index e25c576..0000000
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_LocationAdapter.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.tests.junit;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.browser.Browser;
-import org.eclipse.swt.browser.LocationAdapter;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.junit.Test;
-
-/**
- * Automated Test Suite for class org.eclipse.swt.browser.LocationAdapter
- *
- * @see org.eclipse.swt.browser.LocationAdapter
- */
-public class Test_org_eclipse_swt_browser_LocationAdapter {
-
-@Test
-public void test_Constructor() {
-	new LocationAdapter() {};
-}
-
-@Test
-public void test_changedLorg_eclipse_swt_browser_LocationEvent() {
-	Display display = Display.getCurrent();
-	Shell shell = new Shell(display);
-	Browser browser = new Browser(shell, SWT.NONE);
-	LocationAdapter adapter = new LocationAdapter() {	
-	};
-	browser.addLocationListener(adapter);
-	shell.close();
-}
-
-}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_LocationListener.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_LocationListener.java
deleted file mode 100644
index 678440a..0000000
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_LocationListener.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.tests.junit;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.browser.Browser;
-import org.eclipse.swt.browser.LocationEvent;
-import org.eclipse.swt.browser.LocationListener;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.junit.Test;
-
-/**
- * Automated Test Suite for class org.eclipse.swt.browser.LocationListener
- *
- * @see org.eclipse.swt.browser.LocationListener
- */
-public class Test_org_eclipse_swt_browser_LocationListener {
-
-@Test
-public void test_changedLorg_eclipse_swt_browser_LocationEvent() {
-	Display display = Display.getCurrent();
-	Shell shell = new Shell(display);
-	Browser browser = new Browser(shell, SWT.NONE);
-	browser.addLocationListener(new LocationListener() {
-		@Override
-		public void changed(LocationEvent event) {
-		}
-		@Override
-		public void changing(LocationEvent event) {
-		}		
-	});
-	shell.close();
-}
-}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_OpenWindowListener.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_OpenWindowListener.java
deleted file mode 100644
index 1d633d2..0000000
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_OpenWindowListener.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.tests.junit;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.browser.Browser;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.junit.Test;
-
-/**
- * Automated Test Suite for class org.eclipse.swt.browser.OpenWindowListener
- *
- * @see org.eclipse.swt.browser.OpenWindowListener
- */
-public class Test_org_eclipse_swt_browser_OpenWindowListener {
-
-@Test
-public void test_openWindowLorg_eclipse_swt_browser_WindowEvent() {
-	Display display = Display.getCurrent();
-	Shell shell = new Shell(display);
-	Browser browser = new Browser(shell, SWT.NONE);
-	browser.addOpenWindowListener(event -> {
-	});
-	shell.close();
-}
-}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_ProgressAdapter.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_ProgressAdapter.java
deleted file mode 100644
index 7d7be23..0000000
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_ProgressAdapter.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.tests.junit;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.browser.Browser;
-import org.eclipse.swt.browser.ProgressAdapter;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.junit.Test;
-
-/**
- * Automated Test Suite for class org.eclipse.swt.browser.ProgressAdapter
- *
- * @see org.eclipse.swt.browser.ProgressAdapter
- */
-public class Test_org_eclipse_swt_browser_ProgressAdapter {
-
-@Test
-public void test_Constructor() {
-	new ProgressAdapter() {};
-}
-@Test
-public void test_changedLorg_eclipse_swt_browser_ProgressEvent() {
-	Display display = Display.getCurrent();
-	Shell shell = new Shell(display);
-	Browser browser = new Browser(shell, SWT.NONE);
-	browser.addProgressListener(new ProgressAdapter() {});
-	shell.close();
-}
-}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_ProgressListener.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_ProgressListener.java
deleted file mode 100644
index 310d775..0000000
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_ProgressListener.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.tests.junit;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.browser.Browser;
-import org.eclipse.swt.browser.ProgressEvent;
-import org.eclipse.swt.browser.ProgressListener;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.junit.Test;
-
-/**
- * Automated Test Suite for class org.eclipse.swt.browser.ProgressListener
- *
- * @see org.eclipse.swt.browser.ProgressListener
- */
-public class Test_org_eclipse_swt_browser_ProgressListener {
-
-@Test
-public void test_changedLorg_eclipse_swt_browser_ProgressEvent() {
-	Display display = Display.getCurrent();
-	Shell shell = new Shell(display);
-	Browser browser = new Browser(shell, SWT.NONE);
-	browser.addProgressListener(new ProgressListener() {
-		@Override
-		public void changed(ProgressEvent event) {
-		}
-		@Override
-		public void completed(ProgressEvent event) {
-		}
-	});
-	shell.close();
-}
-}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_StatusTextListener.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_StatusTextListener.java
deleted file mode 100644
index 4389c6d..0000000
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_StatusTextListener.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.tests.junit;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.browser.Browser;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.junit.Test;
-
-/**
- * Automated Test Suite for class org.eclipse.swt.browser.StatusTextListener
- *
- * @see org.eclipse.swt.browser.StatusTextListener
- */
-public class Test_org_eclipse_swt_browser_StatusTextListener {
-
-@Test
-public void test_changedLorg_eclipse_swt_browser_StatusTextEvent() {
-	Display display = Display.getCurrent();
-	Shell shell = new Shell(display);
-	Browser browser = new Browser(shell, SWT.NONE);
-	browser.addStatusTextListener(event -> {
-	});
-	shell.close();
-}
-}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_TitleListener.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_TitleListener.java
deleted file mode 100644
index 0a375e8..0000000
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_TitleListener.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.tests.junit;
-
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.browser.Browser;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.junit.Test;
-
-/**
- * Automated Test Suite for class org.eclipse.swt.browser.TitleListener
- *
- * @see org.eclipse.swt.browser.TitleListener
- */
-public class Test_org_eclipse_swt_browser_TitleListener {
-@Test
-public void test_changedLorg_eclipse_swt_browser_TitleEvent() {
-	Display display = Display.getCurrent();
-	Shell shell = new Shell(display);
-	Browser browser = new Browser(shell, SWT.NONE);
-	browser.addTitleListener(event -> {
-	});
-	shell.close();
-}
-}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_VisibilityWindowAdapter.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_VisibilityWindowAdapter.java
deleted file mode 100644
index 6913339..0000000
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_VisibilityWindowAdapter.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.tests.junit;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.browser.Browser;
-import org.eclipse.swt.browser.VisibilityWindowAdapter;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.junit.Test;
-
-/**
- * Automated Test Suite for class org.eclipse.swt.browser.VisibilityWindowAdapter
- *
- * @see org.eclipse.swt.browser.VisibilityWindowAdapter
- */
-public class Test_org_eclipse_swt_browser_VisibilityWindowAdapter {
-@Test
-public void test_Constructor() {
-	new VisibilityWindowAdapter() {};
-}
-@Test
-public void test_hideLorg_eclipse_swt_browser_WindowEvent() {
-	Display display = Display.getCurrent();
-	Shell shell = new Shell(display);
-	Browser browser = new Browser(shell, SWT.NONE);
-	browser.addVisibilityWindowListener(new VisibilityWindowAdapter(){});
-	shell.close();
-}
-}
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_VisibilityWindowListener.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_VisibilityWindowListener.java
deleted file mode 100644
index 91af404..0000000
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_VisibilityWindowListener.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.tests.junit;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.browser.Browser;
-import org.eclipse.swt.browser.VisibilityWindowListener;
-import org.eclipse.swt.browser.WindowEvent;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.junit.Test;
-
-/**
- * Automated Test Suite for class org.eclipse.swt.browser.VisibilityWindowListener
- *
- * @see org.eclipse.swt.browser.VisibilityWindowListener
- */
-public class Test_org_eclipse_swt_browser_VisibilityWindowListener {
-@Test
-public void test_hideLorg_eclipse_swt_browser_WindowEvent() {
-	Display display = Display.getCurrent();
-	Shell shell = new Shell(display);
-	Browser browser = new Browser(shell, SWT.NONE);
-	browser.addVisibilityWindowListener(new VisibilityWindowListener() {
-		@Override
-		public void hide(WindowEvent event) {
-		}
-		@Override
-		public void show(WindowEvent event) {
-		}
-	});
-	shell.close();
-}
-}