Documentation ¶
Overview ¶
Package videocuj contains the test code for VideoCUJ.
Index ¶
- Constants
- func Run(ctx context.Context, resources TestResources, param TestParams) error
- type TestParams
- type TestResources
- type VideoApp
- type VideoSrc
- type YtApp
- type YtWeb
- func (y *YtWeb) Close(ctx context.Context)
- func (y *YtWeb) EnterFullscreen(ctx context.Context) error
- func (y *YtWeb) IsPaused() uiauto.Action
- func (y *YtWeb) IsPlaying() uiauto.Action
- func (y *YtWeb) MaximizeWindow(ctx context.Context) error
- func (y *YtWeb) MinimizeWindow(ctx context.Context) error
- func (y *YtWeb) OpenAndPlayVideo(ctx context.Context) (err error)
- func (y *YtWeb) Pause() uiauto.Action
- func (y *YtWeb) PauseAndPlayVideo(ctx context.Context) error
- func (y *YtWeb) PerformFrameDropsTest(ctx context.Context) error
- func (y *YtWeb) Play() uiauto.Action
- func (y *YtWeb) RestoreWindow(ctx context.Context) error
- func (y *YtWeb) SkipAd() uiauto.Action
- func (y *YtWeb) YtWebConn() *chrome.Conn
Constants ¶
const ( // YoutubeWeb indicates to test against Youtube web. YoutubeWeb = "YoutubeWeb" // YoutubeApp indicates to test against Youtube app. YoutubeApp = "YoutubeApp" )
Variables ¶
This section is empty.
Functions ¶
func Run ¶
func Run(ctx context.Context, resources TestResources, param TestParams) error
Run runs the VideoCUJ test.
Types ¶
type TestParams ¶
type TestParams struct { OutDir string App string TabletMode bool Tier cuj.Tier ExtendedDisplay bool }
TestParams holds the cuj test parameters passed in from main test case.
type TestResources ¶
type TestResources struct { Cr *chrome.Chrome LFixtVal lacrosfixt.FixtValue Tconn *chrome.TestConn A *arc.ARC Kb *input.KeyboardEventWriter UIHandler cuj.UIActionHandler }
TestResources holds the cuj test resources passed in from main test case.
type VideoApp ¶
type VideoApp interface { // OpenAndPlayVideo opens a video. OpenAndPlayVideo(ctx context.Context) error // EnterFullscreen switches video to fullscreen. EnterFullscreen(ctx context.Context) error // PauseAndPlayVideo verifies video playback. PauseAndPlayVideo(ctx context.Context) error // Close closes the resources related to video. Close(ctx context.Context) }
VideoApp declares video operation.
type VideoSrc ¶
type VideoSrc struct { URL string Title string // Quality is the string that test will look for in youtube // "Settings / Quality" menu to change video playback quality. Quality string }
VideoSrc struct defines video src for testing.
type YtApp ¶
type YtApp struct {
// contains filtered or unexported fields
}
YtApp defines the members related to youtube app.
func NewYtApp ¶
func NewYtApp(tconn *chrome.TestConn, kb *input.KeyboardEventWriter, a *arc.ARC, d *androidui.Device, video VideoSrc) *YtApp
NewYtApp creates an instance of YtApp.
func (*YtApp) EnterFullscreen ¶
EnterFullscreen switches youtube video to fullscreen.
func (*YtApp) OpenAndPlayVideo ¶
OpenAndPlayVideo opens a video on youtube app.
type YtWeb ¶
type YtWeb struct {
// contains filtered or unexported fields
}
YtWeb defines the struct related to youtube web.
func NewYtWeb ¶
func NewYtWeb(br *browser.Browser, tconn *chrome.TestConn, kb *input.KeyboardEventWriter, video VideoSrc, extendedDisplay bool, ui *uiauto.Context, uiHdl cuj.UIActionHandler) *YtWeb
NewYtWeb creates an instance of YtWeb.
func (*YtWeb) EnterFullscreen ¶
EnterFullscreen switches youtube video to fullscreen.
func (*YtWeb) MaximizeWindow ¶
MaximizeWindow maximizes the youtube video.
func (*YtWeb) MinimizeWindow ¶
MinimizeWindow minimizes the youtube video.
func (*YtWeb) OpenAndPlayVideo ¶
OpenAndPlayVideo opens a youtube video on chrome.
func (*YtWeb) PauseAndPlayVideo ¶
PauseAndPlayVideo verifies video playback on youtube web.
func (*YtWeb) PerformFrameDropsTest ¶
PerformFrameDropsTest checks for dropped frames percent and checks if it is below the threshold.
func (*YtWeb) Play ¶
Play plays the video by clicking the video itself. If the video has already started playing, the function does nothing.
func (*YtWeb) RestoreWindow ¶
RestoreWindow restores the youtube video to normal state.