Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion android_env/components/simulators/fake/fake_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

"""Fake Simulator for testing AndroidEnv infrastructure."""

import datetime
import random
import threading
import time
Expand Down Expand Up @@ -67,7 +68,7 @@ class FakeAdbController(adb_controller.AdbController):
def execute_command(
self,
args: list[str],
timeout: float | None = None,
timeout: datetime.timedelta | float | None = None,
device_specific: bool = True,
) -> bytes:
"""Returns fake output for adb commands."""
Expand Down
9 changes: 7 additions & 2 deletions android_env/components/simulators/fake/fake_simulator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

"""Tests for fake_simulator."""

import datetime
import re
from absl.testing import absltest
from android_env.components import config_classes
Expand Down Expand Up @@ -74,8 +75,12 @@ def test_adb_output(self):
config_classes.FakeSimulatorConfig(screen_dimensions=(320, 480))
)
simulator.launch()
adb_controller = simulator.create_adb_controller()
line = adb_controller.execute_command(['shell', 'dumpsys', 'input'])
adb_controller: fake_simulator.FakeAdbController = (
simulator.create_adb_controller()
)
line = adb_controller.execute_command(
['shell', 'dumpsys', 'input'], timeout=datetime.timedelta(seconds=5)
)
line = line.decode('utf-8')
matches = re.match(r'\s+SurfaceOrientation:\s+(\d)', line)
self.assertIsNotNone(matches)
Expand Down
Loading