gca

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: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Apk is the name of the apk of GoogleCameraArc (GCA).
	Apk = "GoogleCameraArc.apk"
)

Variables

View Source
var (
	// ImagePattern is the filename format of images taken by GCA.
	// See: google3/java/com/google/android/apps/chromeos/camera/storage/filenamer/FileNamerModule.java
	ImagePattern = regexp.MustCompile(`^IMG_\d{8}_\d{6}(?:_BURST)?(?:_COVER)?\.\w+$`)

	// VideoPattern is the filename format of videos taken by GCA.
	// See: google3/java/com/google/android/apps/chromeos/camera/storage/filenamer/FileNamerModule.java
	VideoPattern = regexp.MustCompile(`^VID_\d{8}_\d{6}\.\w+$`)
)

Functions

func ClickShutterButton

func ClickShutterButton(ctx context.Context, d *ui.Device) error

ClickShutterButton clicks the shutter button on the screen. This can be a regular photo shutter button or a recording button.

func RestartApp

func RestartApp(ctx context.Context, a *arc.ARC, d *ui.Device) error

RestartApp restarts GCA.

func RunTest

func RunTest(ctx context.Context, s *testing.State, f TestFunc)

RunTest sets up the device, runs the specified test and tears down the device afterwards.

func SetTimerOption

func SetTimerOption(ctx context.Context, d *ui.Device, t TimerOption) error

SetTimerOption sets the countdown timer to the specified timer option.

func SwitchCamera

func SwitchCamera(ctx context.Context, d *ui.Device) error

SwitchCamera synchronously switches the app to the next camera.

func SwitchMode

func SwitchMode(ctx context.Context, d *ui.Device, mode Mode) error

SwitchMode synchronously switches the current mode of GCA to the specified mode.

func VerifyFile

func VerifyFile(ctx context.Context, cr *chrome.Chrome, pat *regexp.Regexp, ts time.Time) error

VerifyFile examines the Downloads directory for any new files (modification time after specified timestamp) that match the specified pattern.

Types

type Facing

type Facing int

Facing refers to the direction a camera is facing.

const (
	// Back means the camera is back-facing.
	Back Facing = iota
	// Front means the camera is front-facing.
	Front
	// External means the camera is an external USB camera.
	External
)

func GetFacing

func GetFacing(ctx context.Context, d *ui.Device) (Facing, error)

GetFacing returns the direction the current camera is facing.

func (Facing) String

func (facing Facing) String() string

type Mode

type Mode int

Mode refers to the capture mode GCA is in.

const (
	// PhotoMode refers to photo mode, in which users can take a photo.
	PhotoMode Mode = iota
	// VideoMode refers to video mode, in which users can record a video.
	VideoMode
)

type TestFunc

type TestFunc func(context.Context, *arc.ARC, *ui.Device)

TestFunc is the body of a test and is called after the test environment is setup.

type TimerOption

type TimerOption int

TimerOption refers to the setting of the countdown timer for capturing photos.

const (
	// NoTimer option disables the timer.
	NoTimer TimerOption = iota
	// ThreeSecondTimer sets the timer to 3 seconds.
	ThreeSecondTimer
	// TenSecondTimer sets the timer to 10 seconds.
	TenSecondTimer
)

Jump to

Keyboard shortcuts

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