feat(driver): optional launcher_activity on Launch RPC for multi-alias apps

This commit is contained in:
pj committed 2026-04-18 01:59:36 +07:00
1 parent 6d81e24e71
commit c4cf0ff530
11 files changed
+69 -64

No files matched your search

+10 -9
View File
@@ -23,13 +23,14 @@ const (
)
type Action struct {
Kind ActionKind
BundleID string
ClearState bool
X, Y int
Selector string
Text string
Idle time.Duration
Kind ActionKind
BundleID string
LauncherActivity string
ClearState bool
X, Y int
Selector string
Text string
Idle time.Duration
}
// Driver is an in-memory Driver implementation for unit tests.
@@ -76,11 +77,11 @@ func (d *Driver) failure(kind ActionKind) error {
return d.Failures[kind]
}
func (d *Driver) Launch(ctx context.Context, bundleID string, clearState bool) error {
func (d *Driver) Launch(ctx context.Context, bundleID, launcherActivity string, clearState bool) error {
if err := d.failure(ActionLaunch); err != nil {
return err
}
d.record(Action{Kind: ActionLaunch, BundleID: bundleID, ClearState: clearState})
d.record(Action{Kind: ActionLaunch, BundleID: bundleID, LauncherActivity: launcherActivity, ClearState: clearState})
return nil
}
+1 -1
View File
@@ -29,7 +29,7 @@ func TestRecordsAllActionsInOrder(t *testing.T) {
mock := New()
ctx := context.Background()
if err := mock.Launch(ctx, "com.example", true); err != nil {
if err := mock.Launch(ctx, "com.example", "com.example/.MainActivity", true); err != nil {
t.Fatal(err)
}
if err := mock.Tap(ctx, 100, 200); err != nil {