Skip to content

Enable cobalt browser tests for media* tests - #1

Open
linxinan-yt wants to merge 48 commits into
brfrom
br2
Open

Enable cobalt browser tests for media* tests#1
linxinan-yt wants to merge 48 commits into
brfrom
br2

Conversation

@linxinan-yt

@linxinan-yt linxinan-yt commented Dec 22, 2025

Copy link
Copy Markdown
Owner

Enable cobalt browser tests for media* tests

Issue: 433354983

@github-actions

Copy link
Copy Markdown

🤖 Gemini Suggested Commit Message


Error: Could not parse a valid response from the Gemini API. Please check the API response logs in the workflow run.

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message

@linxinan-yt linxinan-yt changed the title bBr2 Enable cobalt browser tests for media* tests Dec 22, 2025
aee and others added 10 commits January 6, 2026 10:32
Unit test jobs in CI occasionally time out, even when tests
are configured to retry. The existing job timeout of 2100
seconds does not provide sufficient time for a second attempt
to complete after an initial test timeout of 1800 seconds.
Increase the default job timeout to 2700 seconds to give a 
subsequent test attempts a fighting chance.

Issue: 470590965
The android.text.TextUtils class was being used in CobaltActivity
without a corresponding import statement. This change adds the
necessary import to ensure proper compilation and functionality.

It was removed in youtube#8504 but used
in youtube#8485, as PRs were merged out
of order, resulting in missing this import.

Issue: 471083158
Issue: 418842688
Patch by @abhijeetk and myself.

Now that the tvOS app entry point is no longer in Starboard, make Cobalt
start the Starboard machinery from main.mm together with the `//content`
machinery.

Doing so requires a few changes and cleanups:

* Make: the `QueueApplication` dependency internal to
`application_darwin.mm` so that its header can be used without any
Starboard implementation-specific includes.

* Make `starboard_group`'s dependency on `starboard` (and consequently
`starboard_platform`) public just like it already is on Android. Both
Android and tvOS need to reference platform-specific files from Cobalt,
so they need to be able to depend on "starboard_platform" even if
indirectly.

Bug: 432823234
Bug: 456692793

---------

Co-authored-by: fayev-g <fayev@google.com>
Introduce NullMarked and related nullability annotations to the Cobalt
Android shell classes. This change aligns the null-safety practices
with Chromium upstream's Content shell, improving static analysis
and preventing potential null pointer exceptions. It involves adding
`Nullable` to fields and parameters, and utilizing assertNonNull and
assumeNonNull for explicit null checks.

Issue: 471076830
Issue: 418842688

Reviewed-on:
https://chromium-review.googlesource.com/c/chromium/src/+/6472891
Currently, our nl_langinfo test data is mostly based off of glibc
specifications. Most of the glibc data in regards to locales has not
been updated since the early 2000s due to the preservation of legacy
systems. This makes the data incorrect when comparing them to data
received from the more recently updated ICU library.

This PR changes the test data to better reflect the data received from
our ICU library. **This change is currently no-op** as these tests are
not currently ran. Follow-up PRs will use this test data to test our
implementations.

Bug: 466160361
youtube#8506)

These changes ensure WidevineTimer follows the same portable pthread
patterns established in commits 9d29311 and 42a3596, and
correctly handles platform-specific pthread_setname_np() semantics on
Apple platforms.

Bug: 432507888
Bug: 438955200
Bug: 471365322
johnedocampo and others added 21 commits January 7, 2026 10:39
Introduce a mechanism to expose Cobalt-specific base::feature flags to
the Android Java codebase. This involves new build targets, JNI
interfaces, and Java classes to query feature status from C++. This code
loosely follows this Chromium guide as an example.

For ease of use, we have made it so that all STARBOARD_FEATURES are now
exposed to our Java code. This makes adding a new feature for Cobalt
Java code simple, as a developer only needs to define a
STARBOARD_FEATURE for the java feature they want to add. A new method
was added to Starboard's FeatureList class
(FeatureList::IsEnabledByName)to be able to retrieve an SbFeature by
name.

To get the Python script java_cpp_features.py to work with our
STARBOARD_FEATURE macro, this PR:

- Edits the Python script to support STARBOARD_FEATURES 
- Places the starboard/extension/feature_config.h file inside a GN
source_set, allowing the script to read feature_config.h

This PR is extremely similar to youtube#8377, but was made into its own PR due
to JNI differences between m114 and m138.

Bug: 447651764
This should only run on `.github` files and statically check to see if
github actions files for syntax and common mistakes.

Fixed: 473609586
Refactor command-line argument logging to improve testability and
clarity.

- Extracted the command-line formatting logic into a new helper function
'FormatCommandLineSwitchesForDebugging' in
'cobalt/browser/command_line_debugging_test_support.cc'.
- Updated 'LogCommandLineForDebugging' to use this new formatting
function.
- Added a dedicated unit test
'cobalt_command_line_debugging_unittest.cc' to verify the correctness of
the command-line formatting, ensuring order-independent assertions.
- Updated 'BUILD.gn' files to correctly integrate the new test and its
dependencies.

Test: Manually verified flag output to console.
Test: `out/android-x86_devel/bin/run_cobalt_unittests
--gtest_filter=CommandLineDebuggingTest.* `
Bug: 473056330
…lity list (youtube#8531)

This fixes `gn gen` after youtube#8283. These targets are generated
automatically by other GN actions and need to be allowed to depend on
`for_content_tests`.

Bug: 456692793
Bug: 463395742
…build (youtube#8532)

PR youtube#8442 started calling `SbSystemGetErrorString()` in shared code, so
an implementation is needed for tvOS as well.

Bug: 469772944
Bug: 456692793
…ng-format when the naming is not the same (youtube#8295)

Bug: 466129151

Follow up from youtube#8241, where we
update clang-format to the m138 version. Google C++ style guide and
clang-format enforce that an impl file's "relevant header" is at the
top, but the cobalt codebase contains impl names that don't exactly
match the header name and so clang-format moves those headers in the
includes order. After offline discussion, exclude those headers from
clang-format for now. Gemini recommends that we consolidate impls or
split headers to satisfy formatting and style rules.
…ube#8454)

Refactors the navigation browser tests and related utilities. This
includes updating dependencies, modifying test logic to align with new
APIs, and merging the duplicate test switches.

This is one of several changes to navigation_browsertests as part of the
effort to enable browser tests on the main branch for Cobalt.
Note: This is branched on top of
youtube#8452 as part of a chain.

Bug: 459831767
…youtube#8455)

This change enables the navigation_browsertest and addresses
several issues preventing cobalt_browsertests from building and
running correctly.

Key updates include integrating StarboardBridge into the Android test
application, unifying TestShell with Shell in browser test
utilities, and streamlining the Android manifest for test builds.
These changes are part of the ongoing effort to ensure browser tests
function reliably on the main branch.

Note: This is branched on top of
youtube#8454 as part of a chain.

Bug: 459831767
Bug: 474079809
(cherry picked from commit ae7c6b8)
Integrate the cobalt_browsertests target into the Android test
suite for both android-arm and android-arm64 architectures.

This enables browser tests to be executed on Android devices,
significantly broadening test coverage for Cobalt on the Android
platform. It includes a new Python script to simulate test
execution and cleanup in Cobalt's CI, improving local
integration testing efforts. Although initially all tests are
filtered as failing, this lays the necessary groundwork for
future stabilization and enabling.

This is one of several changes to navigation_browsertests as part of the
effort to enable browser tests on the main branch for Cobalt.
Note: This is branched on top of
youtube#8455 as part of a chain.
Also note: This is essentially a cherry-pick of
youtube#8328, which merged these same
changes to the 26.android branch.

Test: vpython3
cobalt/testing/browser_tests/integration/run_android_tests_test.py
Test: python3
cobalt/testing/browser_tests/integration/run_android_tests.py --apk-path
out/android-x86_qa/cobalt_browsertests_apk/cobalt_browsertests-debug.apk
--build-dir out/android-x86_qa --test-list test_list.txt
--android-serial localhost:27359
Bug: 459831767
…#8557)

Extract fake_graphics_context_provider into its own
static_library target under starboard/testing. This
encapsulates the build logic for this testing utility.

Previously, its source files were included directly in
multiple test targets. Moving it to a dedicated target
improves build system modularity and reusability,
allowing consumers to simply depend on the library.

Bug: 468356861
…espected (youtube#8474)

After running tests in PR#8455, the only test failure was
`NavigationBrowserTest.DeprecateUnloadOptOutFlagRespected`. This
disables that test to make all currently enabled browsertests green on
the main branch.

This is one of several changes to navigation_browsertests as part of the
effort to enable browser tests on the main branch for Cobalt.
Note: This is branched on top of
youtube#8455 as part of a chain.

Test: `out/android-x86_qa/bin/run_cobalt_browsertests -vvvvv -f
*NavigationBrowserTest*`
Bug: 459831767
This change modifies the GitHub Actions workflows for internal and
on-device tests. It adds the current Git branch name as a label to the
test invocation command for Sponge.

Bug: 474168791
…utube#8319)

This is part of the required changes to make SBPlayer-rendered videos
show on the screen together with the rest of the web contents.

The idea here is to make hole punching to work by having the videos
handled by SbPlayer be shown as underlays: the UIViews with videos are
added before the web contents view and are thus supposed to be shown
"under" it (this is done in youtube#8350).

On the Viz side, this is done by treating video hole quads (which are
already added by Starboard media code in `//media`) specially: when
found, these quads disable the default quads-to-CALayers code path that
normally renders each quad as a separate CALayer (with other CALayers
underneath, managed and described by `CARendererLayerTree` and [1]).

[1]
https://docs.google.com/document/d/1DtSN9zzvCF44_FQPM7ie01UxGHagQ66zfF5L9HnigQY/edit?usp=sharing

By doing so:

- `CALayerOverlayProcessor::PutForcedOverlayContentIntoUnderlays()` and
`CALayerOverlayProcessor::PutQuadInSeparateOverlay()` are always called,
and we use `PutQuadInSeparateOverlay()` to replace the video hole quad
with a transparent quad just like the existing code in
`OverlayStrategyUnderlayStarboard`.
- The entire page is received by `CARendererLayerTree` as a single
CALayer (like in C25), which includes the transparent quad created
above, effectively making the video UIViews poke through the web
contents.

Bug: 459366150
Reverts youtube#8457

Reasoning: On the infra side, it looks like the client isn't correctly
identifying that the entire suite is filtered.

Bug: 459831767
Enable cobalt_browsertests on Linux with starboard.

1. add cobalt_browser_tests_main.cc as the entrance for browser tests on
starboard
2. remove ShellTestPlatformDelegate as it is not used in cobalt_browsertests
3. tune the expectations to adjust cobalt's single process mode in
ContentMainRunnerImplBrowserTest as a demo

Test:

```
out/linux-x64x11_devel/cobalt_browsertests --single-process-tests --gtest_filter=*ContentMainRunnerImplBrowserTest.*  --no-sandbox --single-process --no-zygote --ozone-platform=starboard
...
[       OK ] ContentMainRunnerImplBrowserTest.StartupSequence (50 ms)
[----------] 1 test from ContentMainRunnerImplBrowserTest (50 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (50 ms total)
[  PASSED  ] 1 test.
```

Issue: 433354983
If an `activeNetworkCheck` is intentionally interrupted or canceled (ie.
`managementFuture.cancel(true)`), it throws an `InterruptedException` or
`CancellationException` and briefly raises a network error dialog. This
PR catches those exceptions to not raise a network error dialog as an
interruption indicates that another `activeNetworkCheck` was started,
not that there is not a valid internet signal. A `TimeoutException` and
any other exception type will still call `handleFailure()` and raise a
network error dialog.

Bug: 473635416
linxinan-yt pushed a commit that referenced this pull request Jul 8, 2026
…:ThreadPool (youtube#11184)

CobaltPerformance memory measurement APIs (MeasureAvailableCpuMemory,
MeasureUsedCpuMemory, MeasureUsedSwapMemory,
MeasureReservedVirtualMemory)
were executing synchronous system metrics queries and file reads on the
Renderer thread sequence, causing UI thread stalls of up to 2.37 ms per
invocation (11.04 ms total during trace analysis).
    
This change wraps the system queries using
base::ThreadPool::PostTaskAndReplyWithResult,
ensuring system file reads run on a background thread pool without
blocking
the main Renderer message loop.

  ### Quantitative Performance Metrics (Optimization #1)
  
  1. Invocation Frequency & Call Count:
      •  MeasureUsedSwapMemory : Called 3 times during the trace period.
      •  MeasureUsedCpuMemory : Called 2 times.
      •  MeasureAvailableCpuMemory : Called 1 time.
      •  MeasureReservedVirtualMemory : Called 1 time.
      • Total synchronous calls on Renderer thread sequence: 7 calls.
  2. Main Thread Blocking Duration (CPU / IO Stall Savings):         
      •  MeasureUsedSwapMemory : 7.11 ms total (avg 2.37 ms per call).
      •  MeasureUsedCpuMemory : 1.91 ms total (avg 0.96 ms per call). 
      •  MeasureAvailableCpuMemory : 1.24 ms total (1.24 ms per call).
• MeasureReservedVirtualMemory : 0.78 ms total (0.78 ms per call).
• Total direct Renderer thread blocking time saved: 11.04 ms (over 7
invocations).
  3. Impact Summary for CL Description:
• Before Change: Every call to window.performance memory metrics / H5VCC
settings triggered synchronous system calls ( /proc file reads & system
stats) on the Renderer message loop, blocking
JavaScript execution by up to 2.37 ms per invocation (total 11.04 ms
stall during the trace).
• After Change: Memory metrics are queried off-thread via
base::ThreadPool , reducing Chrome_InProcRendererThread blocking time to
0.00 ms for memory measurement API calls.


Bug: 530222962
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.