android-unit-test
Skill by chromium
Guides developers through writing and converting Chromium Android unit tests across Robolectric host tests and on-device test suites. It explains which test tier to choose, migration rules, BUILD.gn setup and run commands.
Install android-unit-test
Built from the published package, never by AI.
git clone --depth 1 https://github.com/chromium/chromium /tmp/chromium && mkdir -p ~/.claude/skills && cp -r /tmp/chromium/agents/skills/android-unit-test ~/.claude/skills/android-unit-testRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/chromium/chromium /tmp/chromium && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/chromium/agents/skills/android-unit-test ~/.gemini/antigravity-cli/skills/android-unit-testAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
The android-unit-test skill is a guide for choosing, writing, running and migrating Android Java tests in Chromium. It covers three test tiers: chrome_junit_tests, which runs on the host JVM through Robolectric; chrome_public_unit_test_apk, which runs on a device or emulator; and chrome_public_test_apk, the heaviest instrumentation tier for full browser flows. The guide includes rules for moving tests between tiers, such as removing @Batch and @UiThreadTest when moving to host tests, plus BUILD.gn examples and build and run commands.
It is aimed at developers working on Chromium Android code who need to add or move unit tests. The skill advises using the lightest tier that fits the code under test. It says code that uses real NDK native methods that cannot be mocked belongs in the on-device suite, and that View and Activity should not be mocked.
Written from the project's SKILL.md and checked against it.
What it can do
- Test tier selectionExplains which of the three Chromium Android test suites fits a given piece of code.
- Converting to host unit testsSteps to move a test to chrome_junit_tests using BaseRobolectricTestRunner and a robolectric_library target.
- Converting to on-device unit testsSteps to keep a test in chrome_public_unit_test_apk with a unit_device_javatests target.
- Annotation clean-up rulesRules for removing @Batch and @UiThreadTest when converting tests to host Robolectric tests.
- Build and run commandsExample autoninja and run commands for host JVM and on-device unit test suites.
What you need
- A Chromium source checkout with autoninja build tooling
- Host JVM for Robolectric tests in chrome_junit_tests
- Android emulator or device for chrome_public_unit_test_apk tests
Try asking
- Convert this javatests file to a chrome_junit_tests Robolectric test
- Which Chromium test tier should I use for this mediator unit test?
- Write the BUILD.gn target for an on-device unit_device_javatests suite
Good to know
- Host tests cannot run real native NDK code without shadows or stubs.
- The unit test APK fails if a test starts the main browser process or ChromeTabbedActivity.
- The skill covers Chromium-specific test suites and build targets only.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: agents/skills/android-unit-test/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
OWNERS24 B -
SKILL.md7 KB
Alternatives to android-unit-test
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
android-unit-test: common questions
Which Chromium Android test suite is the fastest?
The source says chrome_junit_tests is the fastest tier. It runs on the host JVM via Robolectric and needs no emulator or device.
When should a test go in chrome_public_unit_test_apk instead of chrome_junit_tests?
The source says tests that use real NDK native methods that cannot be mocked belong in chrome_public_unit_test_apk. Its example is CurrencyFormatter in PriceUtils.formatPrice.
Should I add @Batch to Robolectric tests?
No. The source says Robolectric host tests under junit/ are batched by default, so @Batch should not be added to them.
How do I install android-unit-test?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is android-unit-test free?
The code is published under the BSD-3-Clause licence. The service it connects to may have its own pricing.
Is android-unit-test safe to use?
It scores 94 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to android-unit-test?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
