mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 11:07:10 +00:00
feat(driver): optional launcher_activity on Launch RPC for multi-alias apps
This commit is contained in:
1 parent
6d81e24e71
commit
c4cf0ff530
11 files changed
+69
-64
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user