Documentation ¶
Overview ¶
Package nearbytestutils provides utility functions for Nearby Share tests.
Index ¶
- func ClearCrOSDownloads(ctx context.Context) error
- func ExtractAndroidTestFile(ctx context.Context, zipPath string, a *nearbysnippet.AndroidNearbyDevice) (string, error)
- func ExtractCrosTestFiles(ctx context.Context, zipPath string) ([]string, error)
- func FileHashComparison(ctx context.Context, filenames []string, crosFileDir, androidFileDir string, ...) error
- func HashFile(ctx context.Context, filePath, fileName string) (string, error)
- func HashFiles(ctx context.Context, filenames []string, fileDir string) ([]string, error)
- func UnzipTestFiles(ctx context.Context, zipPath string) (filenames []string, tempDir string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearCrOSDownloads ¶
ClearCrOSDownloads clears the Downloads folder (where incoming shares are received).
func ExtractAndroidTestFile ¶
func ExtractAndroidTestFile(ctx context.Context, zipPath string, a *nearbysnippet.AndroidNearbyDevice) (string, error)
ExtractAndroidTestFile prepares a test file to send from an Android device.
func ExtractCrosTestFiles ¶
ExtractCrosTestFiles prepares test files to send from a CrOS device. The test files will be staged in SendDir, which is a subdirectory of the current user's download directory. Callers should defer removing the test files to clean up after tests.
func FileHashComparison ¶
func FileHashComparison(ctx context.Context, filenames []string, crosFileDir, androidFileDir string, androidDevice *nearbysnippet.AndroidNearbyDevice) error
FileHashComparison compares file hashes on CrOS and Android after a share has been completed.
func UnzipTestFiles ¶
func UnzipTestFiles(ctx context.Context, zipPath string) (filenames []string, tempDir string, err error)
UnzipTestFiles extracts test data files to a temporary directory. Returns an array of base filenames and the name of the temporary dir. The extracted files can then be pushed to the Android device or copied to a user-accessible directory on CrOS, depending on which device is the sender. The data files supplied for file transfer tests should be contained in a .zip file regardless of how many files are being transferred.
Types ¶
This section is empty.