Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main into Ozone #4659

Merged
merged 38 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
1322f53
Create StarboardBridge native class with jni_generator (#4606)
haozheng-cobalt Dec 19, 2024
768aefe
Allow insecure websocket in QA builds (#4614)
andrewsavage1 Dec 19, 2024
6fe94b3
Add cipd directory to android_deps/.gitignore
dahlstrom-g Dec 19, 2024
d13b664
Disable is_official_build for QA builds (#4618)
andrewsavage1 Dec 20, 2024
3a76d1e
Add web IDL interface for crash annotations (#4574)
hlwarriner Dec 20, 2024
4cc5341
Avoid triggering DCHECK() on playback end (#4620)
xiaomings Dec 20, 2024
9ae46a4
Remove Chromium Android debug builds. (#4619)
briantting Dec 20, 2024
f7a9b09
Include runtime deps in test archive (#4569)
oxve Dec 21, 2024
b7b2d76
Copy Cobalt binary and APK to GCS
dahlstrom-g Dec 19, 2024
f79e30f
[media] Support media suspend and resume (#4580)
borongc Dec 27, 2024
9847279
Make cobalt_unittests android only (#4630)
oxve Dec 27, 2024
7fce4a7
Update check for progressive formats (#4624)
osagie98 Dec 27, 2024
2d18198
Define ANDROID_ABI in Cobalt (#4622)
haozheng-cobalt Dec 30, 2024
56d05dc
[media] Remove decode_target_internal.cc (#4631)
xiaomings Dec 31, 2024
8e7db49
Remove linux debug target, and change test results publisher to test-…
imindich Jan 2, 2025
8e80e03
[android] Fix Cobalt crash in official build (#4617)
borongc Jan 3, 2025
e663c95
[cc] Simplify and adjust memory limits on Android
Sep 19, 2023
5e524cf
[cc] Simplify and adjust memory limits on Android (#4636)
borongc Jan 3, 2025
32040d2
[cc] Use simple compositor memory limits on Android
Nov 29, 2023
affac16
Remove unneeded #include and nogncheck annotation (#4633)
hlwarriner Jan 3, 2025
a6d7996
[media] Move concrete SbAudioSink impl to namespace (#4634)
xiaomings Jan 3, 2025
e581321
[cc] Use simple compositor memory limits on Android (#4637)
borongc Jan 3, 2025
173ecc3
[android] Enable low end device mode (#4625)
borongc Jan 6, 2025
3b068ec
Simplify cleanup script and use correct path
dahlstrom-g Jan 4, 2025
5a10f25
Add safe.directory path in Kokoro cleanup script
dahlstrom-g Jan 4, 2025
387b23b
Add nplb sources to fix include check on android (#4638)
hlwarriner Jan 6, 2025
7e87947
Stop calling configure_environment
dahlstrom-g Jan 4, 2025
35e154f
Stop setting WORKSPACE_COBALT in dind_build.sh
dahlstrom-g Jan 6, 2025
182a34a
Avoid stopping ATV activity on suspend (#4642)
johnxwork Jan 7, 2025
6c6f249
[android] Disable RGBA_4444 textures with overlay video (#4650)
borongc Jan 7, 2025
6c07cf6
Remove unused variables
dahlstrom-g Jan 7, 2025
7a689b6
Implement SourceBuffer.writeHead attribute (#4559)
osagie98 Jan 8, 2025
fde29f2
[android] Fix CommandLine initialization (#4639)
borongc Jan 8, 2025
ba698f5
[android] Disable low-end-device-mode (#4662)
borongc Jan 8, 2025
54f9c57
Migrate StarboardBridge JNI functions in android_main.cc (#4632)
haozheng-cobalt Jan 8, 2025
f1505ad
[JNI Example] Call Java in native (#4649)
haozheng-cobalt Jan 8, 2025
cbd0f25
Don't read files from current working directory
dahlstrom-g Jan 7, 2025
baffdd5
[media] Rename SbMediaIs*Supported() functions (#4664)
xiaomings Jan 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .github/actions/on_host_tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ runs:
env

# Explicitly point to libraries in extracted dir.
LD_LIBRARY_PATH="${test_dir}/out/${{ matrix.platform }}_${{ matrix.config }}/starboard"
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${test_dir}/out/${{ matrix.platform }}_${{ matrix.config }}"
LD_LIBRARY_PATH="${test_dir}/starboard"
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${test_dir}"
export LD_LIBRARY_PATH

# Make results dir available to the archiving step below.
results_dir="${GITHUB_WORKSPACE}/results"
echo "results_dir=${results_dir}" >> $GITHUB_ENV

failed_suites=""
cd ${test_dir}
for test_binary_path in $(ls -d out/**/*tests out/**/nplb); do
test_binary=$(basename "${test_binary_path}")
for test_binary in $(ls {*tests,nplb}); do
echo "Running tests for suite: ${test_binary}"

test_filter="*"
Expand All @@ -57,9 +57,16 @@ runs:
echo "Test filter evaluated to: ${test_filter}"

xml_path="${results_dir}/${test_binary}_testoutput.xml"
/usr/bin/xvfb-run -a --server-args="${XVFB_SERVER_ARGS}" ./$test_binary_path --gtest_filter="${test_filter}" --gtest_output="xml:${xml_path}"
/usr/bin/xvfb-run -a --server-args="${XVFB_SERVER_ARGS}" "./${test_binary}" --gtest_filter="${test_filter}" --gtest_output="xml:${xml_path}" || {
# Set exit code on failure.
failed_suites="${failed_suites} ${test_binary}"
}
done
echo "Finished running all unit tests..."
if [ -n "${failed_suites}" ]; then
echo "Test suites failed:${failed_suites}"
exit 1
fi
- name: Archive Test Results
if: success() || failure()
uses: actions/upload-artifact@v4
Expand Down
15 changes: 10 additions & 5 deletions .github/actions/process_test_results/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,23 @@ inputs:
runs:
using: "composite"
steps:
- name: Download Artifacts
- name: Download Test Results
uses: actions/download-artifact@v4
with:
name: ${{ inputs.test_results_key }}
path: results/

- name: Publish Test Report
- name: Test Summary action
continue-on-error: true
uses: mikepenz/action-junit-report@992d97d6eb2e5f3de985fbf9df6a04386874114d
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86
with:
report_paths: results/*.xml
annotate_only: true
paths: "results/*.xml"
output: test-report-summary.md
show: "fail, skip"

- name: Output test summary markdown to github
run: cat test-report-summary.md >> $GITHUB_STEP_SUMMARY
shell: bash

- name: Get Datadog CLI
id: download-dd-cli
Expand Down
13 changes: 10 additions & 3 deletions .github/actions/upload_test_artifacts/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,20 @@ runs:
if: inputs.on_host == 'true'
run: |
set -x
cd src
tar cvf - out/${{ matrix.platform }}_${{ matrix.config }}/*tests out/${{ matrix.platform }}_${{ matrix.config }}/nplb out/${{ matrix.platform }}_${{ matrix.config }}/*.so out/${{ matrix.platform }}_${{ matrix.config }}/*.so.* out/${{ matrix.platform }}_${{ matrix.config }}/starboard/*.so.* out/${{ matrix.platform }}_${{ matrix.config }}/content/test | xz -T0 -1 -z - > test_artifacts.tar.xz
cd src/out/${{ matrix.platform }}_${{ matrix.config }}
test_deps_file="test.deps"
for test_binary in $(ls {nplb,*tests}); do
echo $test_binary
if [ -f "${test_binary}.runtime_deps" ]; then
cat "${test_binary}.runtime_deps" >> "${test_deps_file}"
fi
done
tar cvf - -T "${test_deps_file}" | xz -T0 -1 -z - > "${GITHUB_WORKSPACE}/test_artifacts.tar.xz"
shell: bash
- name: Upload On-Host Test Artifacts Archive
if: inputs.on_host == 'true'
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.test_artifacts_key }}
path: src/test_artifacts.tar.xz
path: test_artifacts.tar.xz
retention-days: 3
6 changes: 3 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:
matrix:
platform: ${{ fromJson(needs.initialize.outputs.platforms) }}
include: ${{ fromJson(needs.initialize.outputs.includes) }}
config: [devel, debug, qa, gold]
config: [devel, qa, gold]
container: ${{ needs.docker-build-image.outputs.docker_tag }}
env:
TEST_ARTIFACTS_KEY: ${{ matrix.platform }}_${{ matrix.name }}_test_artifacts
Expand All @@ -156,15 +156,15 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
# TODO(bug?): android debug builds are broken.
if: ${{ ! (startsWith(matrix.platform, 'android') && matrix.config == 'debug') }}
if: ${{ ! (contains(matrix.platform, 'android') && matrix.config == 'debug') }}
with:
path: src
# Use fetch depth of 0 to get full history for a valid build id.
fetch-depth: 0
- name: Build Cobalt
uses: ./src/.github/actions/build
# TODO(bug?): android debug builds are broken.
if: ${{ ! (startsWith(matrix.platform, 'android') && matrix.config == 'debug') }}
if: ${{ ! (contains(matrix.platform, 'android') && matrix.config == 'debug') }}
with:
targets: ${{ needs.initialize.outputs.targets }}
- name: Upload Test Artifacts
Expand Down
2 changes: 1 addition & 1 deletion build/build_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@
#define BUILDFLAG_INTERNAL_MODULAR_BUILD() (0)
#endif

#if defined(COBALT_IS_RELEASE_BUILD)
#if defined(ENABLE_BUILDFLAG_COBALT_IS_RELEASE_BUILD)
#define BUILDFLAG_INTERNAL_COBALT_IS_RELEASE_BUILD() (1)
#else
#define BUILDFLAG_INTERNAL_COBALT_IS_RELEASE_BUILD() (0)
Expand Down
22 changes: 12 additions & 10 deletions cobalt/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,18 @@ action("cobalt_build_info") {
]
}

test("cobalt_unittests") {
testonly = true
if (is_android) {
test("cobalt_unittests") {
testonly = true

sources = [ "//cobalt/user_agent/user_agent_platform_info_test.cc" ]
sources = [ "//cobalt/user_agent/user_agent_platform_info_test.cc" ]

deps = [
"//base/test:run_all_unittests",
"//cobalt/user_agent",
"//starboard:starboard_group",
"//testing/gmock",
"//testing/gtest",
]
deps = [
"//base/test:run_all_unittests",
"//cobalt/user_agent",
"//starboard:starboard_group",
"//testing/gmock",
"//testing/gtest",
]
}
}
10 changes: 9 additions & 1 deletion cobalt/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,21 @@ jinja_template("cobalt_manifest") {
variables = [ "manifest_package=dev.cobalt.coat" ]
}

generate_jni("jni_headers") {
sources = [ "apk/app/src/main/java/dev/cobalt/coat/StarboardBridge.java" ]
}

# TODO(cobalt): Re-enable or remove disabled java files.
android_library("cobalt_apk_java") {
testonly = true
resources_package = "dev.cobalt.coat"
annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]

deps = [
":cobalt_java_resources",
":jni_headers",
"//base:base_java",
"//base:jni_java",
"//base:process_launcher_java",
"//build/android:build_java",
"//components/embedder_support/android:view_java",
Expand All @@ -57,6 +65,7 @@ android_library("cobalt_apk_java") {
"//ui/android:ui_no_recycler_view_java",
"//url:gurl_java",
]

sources = [
"apk/app/src/app/java/dev/cobalt/app/CobaltApplication.java",
"apk/app/src/app/java/dev/cobalt/app/MainActivity.java",
Expand Down Expand Up @@ -202,7 +211,6 @@ content_shell_apk_tmpl("cobalt_apk") {
":cobalt_apk_java",
]
shared_libraries = [ ":libcobalt_content_shell_content_view" ]
command_line_flags_file = "content-shell-command-line"
include_size_info = is_official_build
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import android.widget.LinearLayout;
import android.widget.Toast;
import androidx.annotation.Nullable;
import dev.cobalt.app.CobaltApplication;
import dev.cobalt.coat.javabridge.CobaltJavaScriptAndroidObject;
import dev.cobalt.coat.javabridge.CobaltJavaScriptInterface;
import dev.cobalt.coat.javabridge.H5vccPlatformService;
Expand Down Expand Up @@ -102,13 +101,10 @@ public abstract class CobaltActivity extends Activity {
protected void createContent(final Bundle savedInstanceState) {
// Initializing the command line must occur before loading the library.
if (!CommandLine.isInitialized()) {
((CobaltApplication) getApplication()).initCommandLine();
CommandLine.init(null);

// Note that appendSwitchesAndArguments excludes cobaltCommandLineParams[0]
// as the program name, and all other arguments SHOULD start with '--'.
String[] cobaltCommandLineParams =
new String[] {
"",
// Disable first run experience.
"--disable-fre",
// Disable user prompts in the first run.
Expand Down Expand Up @@ -476,6 +472,11 @@ protected void onStop() {
getStarboardBridge().onActivityStop(this);
super.onStop();

WebContents webContents = getActiveWebContents();
if (webContents != null) {
webContents.onHide();
}

if (VideoSurfaceView.getCurrentSurface() != null) {
forceCreateNewVideoSurfaceView = true;
}
Expand Down
Loading
Loading