@@ -3,18 +3,11 @@ import crypto from 'node:crypto';
33import { promises as fs } from 'node:fs' ;
44import os from 'node:os' ;
55import path from 'node:path' ;
6- import { beforeEach , test } from 'vitest' ;
7- import {
8- ensureAndroidMultiTouchHelper ,
9- resetAndroidMultiTouchHelperInstallCache ,
10- } from '../multitouch-helper-install.ts' ;
6+ import { test } from 'vitest' ;
7+ import { ensureAndroidMultiTouchHelper } from '../multitouch-helper-install.ts' ;
118import type { AndroidAdbExecutor , AndroidAdbProvider } from '../adb-executor.ts' ;
129import { ANDROID_MULTITOUCH_HELPER_MANIFEST } from './multitouch-helper.fixtures.ts' ;
1310
14- beforeEach ( ( ) => {
15- resetAndroidMultiTouchHelperInstallCache ( ) ;
16- } ) ;
17-
1811test ( 'helper install uses replace and test-package semantics' , async ( ) => {
1912 const fixture = await makeInstallFixture ( 'helper-apk' ) ;
2013 const installCalls : unknown [ ] = [ ] ;
@@ -36,7 +29,7 @@ test('helper install uses replace and test-package semantics', async () => {
3629 adb,
3730 adbProvider : provider ,
3831 artifact : fixture . artifact ,
39- deviceKey : 'android:emulator-5554 ' ,
32+ deviceKey : 'android:install-semantics ' ,
4033 } ) ;
4134
4235 assert . equal ( result . reason , 'missing' ) ;
@@ -64,7 +57,7 @@ test('same-version helper is current only when installed APK bytes match', async
6457 adb,
6558 adbProvider : provider ,
6659 artifact : fixture . artifact ,
67- deviceKey : 'android:emulator-5554 ' ,
60+ deviceKey : 'android:matching-bytes ' ,
6861 } ) ;
6962
7063 assert . equal ( result . reason , 'current' ) ;
@@ -85,7 +78,7 @@ test('same-version helper is replaced when installed APK bytes differ', async ()
8578 adb,
8679 adbProvider : provider ,
8780 artifact : fixture . artifact ,
88- deviceKey : 'android:emulator-5554 ' ,
81+ deviceKey : 'android:mismatched-bytes ' ,
8982 } ) ;
9083
9184 assert . equal ( result . reason , 'mismatched' ) ;
@@ -104,7 +97,7 @@ test('same-version helper is replaced when installed APK identity is unavailable
10497 adb,
10598 adbProvider : provider ,
10699 artifact : fixture . artifact ,
107- deviceKey : 'android:emulator-5554 ' ,
100+ deviceKey : 'android:unverifiable-identity ' ,
108101 } ) ;
109102
110103 assert . equal ( result . reason , 'unverifiable' ) ;
@@ -122,7 +115,7 @@ test('newer installed helper remains current without an unsafe downgrade', async
122115 adb,
123116 adbProvider : provider ,
124117 artifact : fixture . artifact ,
125- deviceKey : 'android:emulator-5554 ' ,
118+ deviceKey : 'android:newer-helper ' ,
126119 } ) ;
127120
128121 assert . equal ( result . reason , 'current' ) ;
@@ -143,14 +136,14 @@ test('install memo includes artifact identity, not only version code', async ()
143136 adb : device . adb ,
144137 adbProvider : device . provider ,
145138 artifact : first . artifact ,
146- deviceKey : 'android:emulator-5554 ' ,
139+ deviceKey : 'android:artifact-identity ' ,
147140 } ) ;
148141 device . setInstalledApk ( 'first-helper' ) ;
149142 const result = await ensureAndroidMultiTouchHelper ( {
150143 adb : device . adb ,
151144 adbProvider : device . provider ,
152145 artifact : second . artifact ,
153- deviceKey : 'android:emulator-5554 ' ,
146+ deviceKey : 'android:artifact-identity ' ,
154147 } ) ;
155148
156149 assert . equal ( result . reason , 'mismatched' ) ;
@@ -168,7 +161,7 @@ test('install memo skips repeated APK reads for the same artifact identity', asy
168161 adb : device . adb ,
169162 adbProvider : device . provider ,
170163 artifact : fixture . artifact ,
171- deviceKey : 'android:emulator-5554 ' ,
164+ deviceKey : 'android:install-memo ' ,
172165 } ) ;
173166 await fs . rm ( fixture . artifact . apkPath ) ;
174167 const result = await ensureAndroidMultiTouchHelper ( {
@@ -181,7 +174,7 @@ test('install memo skips repeated APK reads for the same artifact identity', asy
181174 } ,
182175 } ,
183176 artifact : fixture . artifact ,
184- deviceKey : 'android:emulator-5554 ' ,
177+ deviceKey : 'android:install-memo ' ,
185178 } ) ;
186179
187180 assert . equal ( result . reason , 'current' ) ;
0 commit comments