mirror of
https://github.com/TencentCloud/Octop.git
synced 2026-10-19 06:10:07 +08:00
* feat(mobile): add Remote Android probe, API, stream, and dashboard Multi-backend mobile support for self-hosted Octop: install-time host capability probe, gated /api/mobile routes, adb WebSocket stream, and Control → Remote Android dashboard page for Mac/emulator dev paths. * feat(mobile): wire harness agent adb tools for Remote Android Register mobile_screenshot, mobile_tap, mobile_swipe, mobile_launch_app, mobile_ui_dump, and mobile_handoff_to_user when capabilities.mobile is enabled, with permission and readiness checks. * feat(mobile): polish Remote Phone UX and session-bound agent control Rename the surface to Remote Phone, add quality presets, device info, AI panel, and chat-dock phone tab; bind agent tools to the active stream session and cover with unit tests. * chore(mobile): drop docs/specs/remote-android.md from the PR * fix(mobile): ruff I001 import formatting in device_info tests * fix(mobile): resolve adb via PATH and SDK env only Drop hardcoded per-OS SDK layout guesses; honor PATH, ANDROID_HOME, and ANDROID_SDK_ROOT (with adb.exe on Windows). * style(mobile): apply ruff format to mobile modules CI runs ruff format --check; keep these files format-clean. --------- Co-authored-by: jubaoliang <jubaoliang@gmail.com>
38 lines
1.1 KiB
Python
38 lines
1.1 KiB
Python
"""tests/unit/mobile/test_probe.py"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from unittest.mock import patch
|
|
|
|
import pytest
|
|
|
|
from octop.infra.mobile.probe import probe_host_capability
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
("system", "binder", "kvm", "enabled", "backend"),
|
|
[
|
|
("Darwin", False, False, True, "physical"),
|
|
("Windows", False, False, True, "physical"),
|
|
("Linux", True, False, True, "redroid"),
|
|
("Linux", False, True, True, "emulator"),
|
|
("Linux", False, False, False, "none"),
|
|
],
|
|
)
|
|
def test_probe_host_matrix(
|
|
system: str,
|
|
binder: bool,
|
|
kvm: bool,
|
|
enabled: bool,
|
|
backend: str,
|
|
) -> None:
|
|
with (
|
|
patch("octop.infra.mobile.probe.platform.system", return_value=system),
|
|
patch("octop.infra.mobile.probe.linux_binder_available", return_value=binder),
|
|
patch("octop.infra.mobile.probe.kvm_available", return_value=kvm),
|
|
):
|
|
result = probe_host_capability(probed_at="2026-01-01T00:00:00Z")
|
|
assert result.enabled is enabled
|
|
assert result.backend == backend
|
|
assert result.probed_at == "2026-01-01T00:00:00Z"
|