Skip to content

Commit cd57bb5

Browse files
Merge
2 parents f6ec5f1 + 126637f commit cd57bb5

File tree

135 files changed

+45900
-2187
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+45900
-2187
lines changed

WEBKIT-MEDIA-STUBS.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Web Testing
2+
3+
The web project needs WebKit and Media shared libraries to run tests.
4+
5+
These can be supplied in a number of ways. See sections below.
6+
7+
## Compiled from source
8+
9+
Specify these Gradle properties to enable building of WebKit and Media libraries from source:
10+
11+
-PCOMPILE_WEBKIT=true -PCOMPILE_MEDIA=true
12+
13+
Note that these require additional build tooling and take some time to build.
14+
15+
If you are not actively working on these sources, you may want to cache the output by copying it to one of the folders mentioned below.
16+
17+
18+
## Cached libraries
19+
20+
You can manually place WebKit and Media shared libraries in these folders:
21+
22+
* Unix libraries (*.so or *.dylib files)
23+
````
24+
$projectDir/../caches/sdk/lib
25+
````
26+
27+
* Windows libraries (*.dll files)
28+
````
29+
$projectDir/../caches/sdk/bin
30+
````
31+
32+
## Officially released libraries
33+
34+
Gradle has a task to automate downloading officially released libraries from MavenCentral.
35+
36+
You can enable the task by specifying this Gradle property:
37+
38+
-PSTUB_RUNTIME_OPENJFX="15-ea+4"
39+
40+
Note that these libraries may not be compatible with the source tree you are working with. Always use the [latest version](https://search.maven.org/search?q=g:org.openjfx%20AND%20a:javafx); this may improve your chances of compatibility.
41+
42+
43+
## Skip Web tests
44+
45+
You can also skip the web module tests.
46+
47+
Specify these options to Gradle
48+
49+
-x :web:test
50+
51+
Note that this is fine for local work. But a full test *is* required before submitting a PR, see [CONTRIBUTING.md](https://github.com/openjdk/jfx/blob/master/CONTRIBUTING.md).

build.gradle

+57-20
Original file line numberDiff line numberDiff line change
@@ -1249,9 +1249,15 @@ if (gradle.gradleVersion != jfxGradleVersion) {
12491249

12501250
// Look for stub runtime in bundled sdk, standalone sdk, or boot JDK
12511251

1252+
// Allows automatic provisioning of webkit+media shared libraries
1253+
// from official OpenJFX releases, downloaded from MavenCentral
1254+
defineProperty("STUB_RUNTIME_OPENJFX", "")
1255+
ext.IS_STUB_RUNTIME_OPENJFX = !STUB_RUNTIME_OPENJFX.isBlank()
1256+
12521257
def String cachedBundledRuntime = cygpath("$projectDir") + "/../caches/modular-sdk"
12531258
def String cachedStandaloneRuntime = cygpath("$projectDir") + "/../caches/sdk"
12541259
def String jdkStubRuntime = cygpath("$JDK_HOME")
1260+
def String openjfxStubRuntime = cygpath("$projectDir") + "/buildSrc/build/openjfxStub"
12551261

12561262
def defaultStubRuntime = ""
12571263
if (file(cachedBundledRuntime).exists()) {
@@ -1260,6 +1266,8 @@ if (file(cachedBundledRuntime).exists()) {
12601266
defaultStubRuntime = cachedStandaloneRuntime
12611267
} else if (BUILD_CLOSED) {
12621268
defaultStubRuntime = cachedBundledRuntime
1269+
} else if (IS_STUB_RUNTIME_OPENJFX) {
1270+
defaultStubRuntime = openjfxStubRuntime
12631271
} else {
12641272
defaultStubRuntime = jdkStubRuntime
12651273
}
@@ -2862,15 +2870,7 @@ project(":media") {
28622870
"CC=${mediaProperties.compiler}", "AR=${mediaProperties.ar}", "LINKER=${mediaProperties.linker}")
28632871

28642872
if (t.name == "win") {
2865-
Map winEnv = new HashMap(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
2866-
2867-
String sdkDir = System.getenv("BASECLASSES_SDK_DIR");
2868-
if (sdkDir == null) {
2869-
sdkDir = "C:/Program Files/Microsoft SDKs/Windows/v7.1" // Default value
2870-
winEnv["BASECLASSES_SDK_DIR"] = sdkDir
2871-
}
2872-
environment(winEnv)
2873-
2873+
environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
28742874
args("RESOURCE=${nativeOutputDir}/${buildType}/${WIN.media.fxpluginsRcFile}")
28752875
}
28762876
}
@@ -3381,16 +3381,21 @@ project(":web") {
33813381

33823382
test {
33833383
doFirst {
3384-
if (!IS_COMPILE_WEBKIT) {
3385-
println "*****************************************************"
3384+
if (IS_STUB_RUNTIME_OPENJFX) {
3385+
println "********************************************************"
3386+
println "WARNING: running web tests with officially built webkit."
3387+
println "The webkit native library may not be compatible with the"
3388+
println "source tree you are using."
3389+
println "If tests fail, try compiling webkit instead."
3390+
println "See WEBKIT-MEDIA-STUBS.md"
3391+
println "********************************************************"
3392+
} else if (!IS_COMPILE_WEBKIT) {
3393+
println "******************************************************"
33863394
println "WARNING: running web tests without building webkit."
33873395
println "The webkit native library will be copied from the JDK,"
33883396
println "which might lead to failures in some web tests."
3389-
println "To avoid these failures, you should either build"
3390-
println "webkit locally, copy the native webkit library from a"
3391-
println "recent build, or skip execution of web test cases with"
3392-
println "'-x :web:test'"
3393-
println "*****************************************************"
3397+
println "See WEBKIT-MEDIA-STUBS.md"
3398+
println "******************************************************"
33943399
}
33953400
}
33963401
// Run web tests in headless mode
@@ -3578,6 +3583,7 @@ project(":systemTests") {
35783583
testapp5
35793584
testapp6
35803585
testscriptapp1
3586+
testscriptapp2
35813587
}
35823588

35833589
def nonModSrcSets = [
@@ -3591,7 +3597,8 @@ project(":systemTests") {
35913597
sourceSets.testapp4,
35923598
sourceSets.testapp5,
35933599
sourceSets.testapp6,
3594-
sourceSets.testscriptapp1
3600+
sourceSets.testscriptapp1,
3601+
sourceSets.testscriptapp2
35953602
]
35963603

35973604
project.ext.buildModule = false
@@ -3691,7 +3698,7 @@ project(":systemTests") {
36913698
}
36923699
test.dependsOn(createTestApps);
36933700

3694-
def modtestapps = [ "testapp2", "testapp3", "testapp4", "testapp5", "testapp6", "testscriptapp1" ]
3701+
def modtestapps = [ "testapp2", "testapp3", "testapp4", "testapp5", "testapp6", "testscriptapp1", "testscriptapp2" ]
36953702
modtestapps.each { testapp ->
36963703
def testappCapital = testapp.capitalize()
36973704
def copyTestAppTask = task("copy${testappCapital}", type: Copy) {
@@ -4327,6 +4334,36 @@ compileTargets { t ->
43274334
}
43284335

43294336

4337+
/******************************************************************************
4338+
* *
4339+
* OpenJFX Stubs *
4340+
* *
4341+
*****************************************************************************/
4342+
4343+
configurations {
4344+
openjfxStubs
4345+
}
4346+
4347+
if (IS_STUB_RUNTIME_OPENJFX) {
4348+
def String platform = IS_MAC ? "mac" : IS_WINDOWS ? "win" : IS_LINUX ? "linux" : ""
4349+
dependencies {
4350+
openjfxStubs "org.openjfx:javafx-media:$STUB_RUNTIME_OPENJFX:$platform@jar"
4351+
openjfxStubs "org.openjfx:javafx-web:$STUB_RUNTIME_OPENJFX:$platform@jar"
4352+
}
4353+
}
4354+
4355+
// Extract binary libraries from OpenJFX artifacts for use as stubs
4356+
task prepOpenJfxStubs(type: Copy) {
4357+
enabled = IS_STUB_RUNTIME_OPENJFX
4358+
4359+
from configurations.openjfxStubs.files.collect { zipTree(it) }
4360+
include("*.dll")
4361+
include("*.dylib")
4362+
include("*.so")
4363+
into IS_WINDOWS ? file("$openjfxStubRuntime/bin") : file("$openjfxStubRuntime/lib")
4364+
}
4365+
4366+
43304367
/******************************************************************************
43314368
* *
43324369
* Modules *
@@ -4921,7 +4958,7 @@ compileTargets { t ->
49214958
}
49224959
}
49234960

4924-
def buildModuleMediaTask = task("buildModuleMedia$t.capital", type: Copy, dependsOn: mediaProject.assemble) {
4961+
def buildModuleMediaTask = task("buildModuleMedia$t.capital", type: Copy, dependsOn: [mediaProject.assemble, prepOpenJfxStubs]) {
49254962
group = "Basic"
49264963
description = "copies javafx.media native libraries"
49274964

@@ -4958,7 +4995,7 @@ compileTargets { t ->
49584995
}
49594996
}
49604997

4961-
def buildModuleWeb = task("buildModuleWeb$t.capital", type: Copy, dependsOn: webProject.assemble) {
4998+
def buildModuleWeb = task("buildModuleWeb$t.capital", type: Copy, dependsOn: [webProject.assemble, prepOpenJfxStubs]) {
49624999
group = "Basic"
49635000
description = "copies javafx.web native libraries"
49645001

modules/javafx.controls/src/main/java/javafx/scene/control/TreeTablePosition.java

+10
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@ public TreeTablePosition(@NamedArg("treeTableView") TreeTableView<S> treeTableVi
7777
nonFixedColumnIndex = treeTableView == null || tableColumn == null ? -1 : treeTableView.getVisibleLeafIndex(tableColumn);
7878
}
7979

80+
// Not public API. A Copy-like constructor with a different row.
81+
// It is used for updating the selection when the TreeItems are
82+
// sorted using TreeTableView.sort() or reordered using setAll().
83+
TreeTablePosition(@NamedArg("treeTableView") TreeTablePosition<S, T> pos, @NamedArg("row") int row) {
84+
super(row, pos.getTableColumn());
85+
this.controlRef = new WeakReference<>(pos.getTreeTableView());
86+
this.treeItemRef = new WeakReference<>(pos.getTreeItem());
87+
nonFixedColumnIndex = pos.getColumn();
88+
}
89+
8090

8191

8292
/***************************************************************************

0 commit comments

Comments
 (0)