storage

package
v0.0.0-...-9474aff Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2022 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package storage contains helper functions to test different FilesApp storage folders, e.g. Drive FS, Downloads

Index

Constants

View Source
const (

	// ActionID is the id of the action label.
	ActionID = "org.chromium.arc.testapp.filereader:id/action"
	// ExpectedAction should be VIEW intent.
	ExpectedAction = "android.intent.action.VIEW"
	// URIID is the id of the uri label.
	URIID = "org.chromium.arc.testapp.filereader:id/uri"
	// FileContentID is the id of the file content label.
	FileContentID = "org.chromium.arc.testapp.filereader:id/file_content"
	// ExpectedFileContent in the test file.
	ExpectedFileContent = "this is a test"
)

Variables

This section is empty.

Functions

func TestOpenWithAndroidApp

func TestOpenWithAndroidApp(ctx context.Context, s *testing.State, a *arc.ARC, cr *chrome.Chrome, d *androidui.Device, config TestConfig, expectations []Expectation)

TestOpenWithAndroidApp opens a test file in the specified directory, e.g. Google Drive, Downloads, MyFiles etc, using the test android app, ArcFileReaderTest. The app will display the respective Action, URI and FileContent on its UI, to be validated against our expected values.

Types

type Expectation

type Expectation struct {
	LabelID string
	Value   string
}

Expectation is used for validating app label contents.

type TestConfig

type TestConfig struct {
	// Name of the directory.
	DirName string
	// Title of the directory.
	DirTitle string
	// If specified, open the sub-directories under "DirName".
	SubDirectories []string
	// Actual path of the directory on the file system.
	DirPath string
	// If set to true, create the test file at "DirPath". For directory where there is no actual
	// file path, set this to false and create the file before running the test (e.g. MTP).
	CreateTestFile bool
	// Optional: If set to true, wait for file type to appear before opening the file.
	// Currently used by DriveFS to ensure metadata has arrived.
	CheckFileType bool
	// Name of the test file to be used in the test.
	FileName string
	// If set to true, retain the test file created early in "DirPath".
	// Currently used by DriveFS to avoid creating and deleting files.
	KeepFile bool
}

TestConfig stores the details of the directory under test and misc test configurations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL