Documentation ¶
Overview ¶
Package voicerecorder wraps method and constant of voice recorder app for MTBF testing.
Index ¶
- type VoiceRecorder
- func (vr *VoiceRecorder) AppName() string
- func (vr *VoiceRecorder) Close(ctx context.Context, cr *chrome.Chrome, hasError func() bool, outDir string) error
- func (vr *VoiceRecorder) DeleteAudio(fileName string) error
- func (vr *VoiceRecorder) Launch(ctx context.Context) error
- func (vr *VoiceRecorder) PlayFile(fileName string) uiauto.Action
- func (vr *VoiceRecorder) RecordAudio(ctx context.Context) (string, error)
- func (vr *VoiceRecorder) UpdateOutDir(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type VoiceRecorder ¶
type VoiceRecorder struct {
// contains filtered or unexported fields
}
VoiceRecorder creates a struct that contains *apputil.App
func New ¶
func New(ctx context.Context, kb *input.KeyboardEventWriter, tconn *chrome.TestConn, a *arc.ARC) (*VoiceRecorder, error)
New returns an instance of VoiceRecorder.
func (*VoiceRecorder) AppName ¶
func (vr *VoiceRecorder) AppName() string
AppName returns the name of voice recorder app.
func (*VoiceRecorder) Close ¶
func (vr *VoiceRecorder) Close(ctx context.Context, cr *chrome.Chrome, hasError func() bool, outDir string) error
Close closes voice recorder app.
func (*VoiceRecorder) DeleteAudio ¶
func (vr *VoiceRecorder) DeleteAudio(fileName string) error
DeleteAudio deletes the audio file created by RecordSound method. The file deletion functionality provide by Voice Recorder might comes with ads show up, to avoid dealing with ads, here delete those files by os.Remove().
func (*VoiceRecorder) Launch ¶
func (vr *VoiceRecorder) Launch(ctx context.Context) error
Launch installs app first if the app doesn't exist. And then launches app.
func (*VoiceRecorder) PlayFile ¶
func (vr *VoiceRecorder) PlayFile(fileName string) uiauto.Action
PlayFile plays a specified file.
func (*VoiceRecorder) RecordAudio ¶
func (vr *VoiceRecorder) RecordAudio(ctx context.Context) (string, error)
RecordAudio clicks on record button to record audio and returns the name of recorded file.
func (*VoiceRecorder) UpdateOutDir ¶
func (vr *VoiceRecorder) UpdateOutDir(ctx context.Context) error
UpdateOutDir updates the output directory from default to downloads.