Skip to content

Commit b4732a3

Browse files
committed
Bug 576422 - Remove chromium sources
* Additional cleanup of build scripts * Cleanup tests Change-Id: I87eda0b582d1df7b122fffb91f8d8380503b59c8 Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/186290 Tested-by: Platform Bot <[email protected]> Reviewed-by: Alexander Kurtakov <[email protected]>
1 parent 85ed0e1 commit b4732a3

File tree

5 files changed

+13
-311
lines changed

5 files changed

+13
-311
lines changed

bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static int checkStyle(int style) {
197197
}
198198
}
199199
/* If particular backend isn't specified, use the value from the system property. */
200-
if ((style & (SWT.WEBKIT | SWT.CHROMIUM | SWT.EDGE)) == 0) {
200+
if ((style & (SWT.WEBKIT | SWT.EDGE)) == 0) {
201201
style |= DefaultType;
202202
}
203203
if ("win32".equals (platform) && (style & SWT.EDGE) != 0) { //$NON-NLS-1$

bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ CAIRO_LIB = lib$(CAIRO_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
5151
ATK_LIB = lib$(ATK_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
5252
GLX_LIB = lib$(GLX_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
5353
WEBKIT_LIB = lib$(WEBKIT_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
54-
CHROMIUM_LIB = lib$(CHROMIUM_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
5554
ALL_SWT_LIBS = $(SWT_LIB) $(AWT_LIB) $(SWTPI_LIB) $(CAIRO_LIB) $(ATK_LIB) $(GLX_LIB) $(WEBKIT_LIB)
5655

5756
# Webkit extension lib has to be put into a separate folder and is treated differently from the other libraries.

bundles/org.eclipse.swt/buildFragment.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@
260260
<copy todir="${destination.temp.folder}/${full.name}">
261261
<fileset dir="${fragmentdir}" includes="fragment.properties,about.html,about_files/,swt*.dll,libswt*.so,libswt*.sl,libswt*.a,libswt*.jnilib,libXm.so.2,webkitextensions*/libswt*.so,META-INF/,WebView2Loader.dll" />
262262
</copy>
263-
<chmod perm="755" dir="${destination.temp.folder}/${full.name}" includes="swt*.dll,libswt*.so,libswt*.sl,libswt*.a,libswt*.jnilib,libXm.so.2,webkitextensions*/libswt*.so,chromium-*/*.so,WebView2Loader.dll" />
263+
<chmod perm="755" dir="${destination.temp.folder}/${full.name}" includes="swt*.dll,libswt*.so,libswt*.sl,libswt*.a,libswt*.jnilib,libXm.so.2,webkitextensions*/libswt*.so,WebView2Loader.dll" />
264264
<eclipse.versionReplacer path="${destination.temp.folder}/${full.name}" version="${version.suffix}" />
265265
</target>
266266

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

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public class Test_org_eclipse_swt_browser_Browser extends Test_org_eclipse_swt_w
8686
public TestName name = new TestName();
8787

8888
Browser browser;
89-
boolean isChromium = false, isEdge = false;
89+
boolean isEdge = false;
9090

9191
static int[] webkitGtkVersionInts = new int[3];
9292

@@ -112,7 +112,6 @@ public void setUp() {
112112
shell.setLayout(new FillLayout());
113113
browser = new Browser(shell, SWT.NONE);
114114

115-
isChromium = browser.getBrowserType().equals("chromium");
116115
isEdge = browser.getBrowserType().equals("edge");
117116

118117
String shellTitle = name.getMethodName();
@@ -226,7 +225,7 @@ public void test_get_set_Cookies() {
226225
public void test_getChildren() {
227226
// Win32's Browser is a special case. It has 1 child by default, the OleFrame.
228227
// See Bug 499387 and Bug 511874
229-
if (SwtTestUtil.isWindows && !isChromium && !isEdge) {
228+
if (SwtTestUtil.isWindows && !isEdge) {
230229
int childCount = composite.getChildren().length;
231230
String msg = "Browser on Win32 is a special case, the first child is an OleFrame (ActiveX control). Actual child count is: " + childCount;
232231
assertTrue(msg, childCount == 1);
@@ -313,11 +312,7 @@ public void test_LocationListener_changing() {
313312
AtomicBoolean changingFired = new AtomicBoolean(false);
314313
browser.addLocationListener(changingAdapter(e -> changingFired.set(true)));
315314
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");
321316
boolean passed = waitForPassCondition(changingFired::get);
322317
assertTrue("LocationListener.changing() event was never fired", passed);
323318
}
@@ -354,11 +349,7 @@ public void changed(LocationEvent event) {
354349
}
355350
});
356351
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");
362353
waitForPassCondition(finished::get);
363354

364355
if (finished.get() && changingFired.get() && changedFired.get() && !changedFiredTooEarly.get()) {
@@ -435,11 +426,7 @@ public void changed(LocationEvent event) {
435426
}
436427
}));
437428
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.");
443430

444431
// We must wait for events *not* to fire.
445432
// On Gtk, Quadcore (Intel i7-4870HQ pci-e SSD, all events fire after ~80ms.
@@ -993,7 +980,6 @@ public void show(WindowEvent event) {
993980
/** Verify that if multiple child shells are open, no duplicate visibility events are sent. */
994981
@Test
995982
public void test_VisibilityWindowListener_multiple_shells() {
996-
assumeTrue(!isChromium); // this fails sometimes due cef limitation, can be enabled on newer versions.
997983
AtomicBoolean secondChildCompleted = new AtomicBoolean(false);
998984
AtomicInteger childCount = new AtomicInteger(0);
999985

@@ -1257,13 +1243,9 @@ public void changed(LocationEvent event) {
12571243
});
12581244

12591245
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>");
12651247
// Wait till both listeners were fired.
1266-
if (SwtTestUtil.isWindows && !isChromium) {
1248+
if (SwtTestUtil.isWindows) {
12671249
waitForPassCondition(changingFinished::get); // Windows doesn't reach changedFinished.get();
12681250
} else
12691251
waitForPassCondition(() -> (changingFinished.get() && changedFinished.get()));
@@ -1279,10 +1261,7 @@ public void changed(LocationEvent event) {
12791261
"\n changed: fired:" + changedFinished.get() + " evaluated:" + changed;
12801262
boolean passed = false;
12811263

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) {
12861265
// Evaluation works in all cases.
12871266
passed = changingFinished.get() && changedFinished.get() && changed && changing;
12881267
} else if (SwtTestUtil.isCocoa) {
@@ -1299,7 +1278,6 @@ public void changed(LocationEvent event) {
12991278
/** Verify that evaluation works inside an OpenWindowListener */
13001279
@Test
13011280
public void test_OpenWindowListener_evaluateInCallback() {
1302-
assumeTrue(!isChromium); // This works on Webkit1, but can sporadically fail, see Bug 509411
13031281
AtomicBoolean eventFired = new AtomicBoolean(false);
13041282
browser.addOpenWindowListener(event -> {
13051283
browser.evaluate("SWTopenListener = true");
@@ -1401,7 +1379,7 @@ public void test_setFocus_toChild_beforeOpen() {
14011379
/** Text without html tags */
14021380
@Test
14031381
public void test_getText() {
1404-
if (SwtTestUtil.isWindows || isChromium) {
1382+
if (SwtTestUtil.isWindows) {
14051383
// Windows' Browser implementation returns the processed HTML rather than the original one.
14061384
// The processed webpage has html tags added to it.
14071385
getText_helper("helloWorld", "<html><head></head><body>helloWorld</body></html>");
@@ -1423,7 +1401,7 @@ public void test_getText_html() {
14231401
@Test
14241402
public void test_getText_script() {
14251403
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) {
14271405
// Windows' Browser implementation returns the processed HTML rather than the original one.
14281406
// The processed page injects "style" property into the body from the script.
14291407
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() {
14391417
@Test
14401418
public void test_getText_doctype() {
14411419
String testString = "<!DOCTYPE html><html><head></head><body>hello World</body></html>";
1442-
if (SwtTestUtil.isWindows && !isChromium) {
1420+
if (SwtTestUtil.isWindows) {
14431421
// Windows' Browser implementation returns the processed HTML rather than the original one.
14441422
// The processed page strips out DOCTYPE.
14451423
getText_helper(testString, "<html><head></head><body>hello World</body></html>");

0 commit comments

Comments
 (0)