phonehub

package
v0.0.0-...-683b059 Latest Latest
Warning

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

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

Documentation

Overview

Package phonehub is for controlling Chrome OS Phone Hub functionality.

Index

Constants

This section is empty.

Variables

View Source
var LocatePhonePod = phoneHubSettingPod.NameContaining("Toggle Locate phone")

LocatePhonePod is the finder for Phone Hub's "Locate phone" pod.

View Source
var PhoneHubShelfIcon = nodewith.Name("Phone Hub").Role(role.Button).ClassName("PhoneHubTray")

PhoneHubShelfIcon is the finder for the Phone Hub shelf icon.

View Source
var PhoneHubTray = nodewith.Name("Phone Hub").ClassName("Widget")

PhoneHubTray is the finder for the Phone Hub tray UI.

View Source
var RecentTabChipFinder = nodewith.Role(role.Button).HasClass("ContinueBrowsingChip")

RecentTabChipFinder is the finder for Phone Hub "Recent Chrome tab" chips.

View Source
var SilencePhonePod = phoneHubSettingPod.NameContaining("Toggle Silence phone")

SilencePhonePod is the finder for Phone Hub's Silence Phone pod.

Functions

func BatteryLevel

func BatteryLevel(ctx context.Context, tconn *chrome.TestConn) (int, error)

BatteryLevel returns the battery level displayed in Phone Hub.

func DownloadMostRecentPhoto

func DownloadMostRecentPhoto(ctx context.Context, tconn *chrome.TestConn) error

DownloadMostRecentPhoto downloads the first photo shown in Phone Hub's Recent Photos section to Tote.

func Enable

func Enable(ctx context.Context, tconn *chrome.TestConn, cr *chrome.Chrome) error

Enable enables Phone Hub from OS Settings using JS. Assumes a connected device has already been paired. Hide should be called afterwards to close the Phone Hub tray. It is left open here so callers can capture the UI state upon error if needed.

func FindRecentPhotosSetupButton

func FindRecentPhotosSetupButton() *nodewith.Finder

FindRecentPhotosSetupButton returns a finder which locates the Set up button for the Recent Photos feature.

func Hide

func Hide(ctx context.Context, tconn *chrome.TestConn) error

Hide hides Phone Hub if it's not already hidden.

func LocatePhoneEnabled

func LocatePhoneEnabled(ctx context.Context, tconn *chrome.TestConn) (bool, error)

LocatePhoneEnabled returns true if the "Locate phone" pod is active, and false otherwise.

func OptInRecentPhotos

func OptInRecentPhotos(ctx context.Context, tconn *chrome.TestConn, cr *chrome.Chrome) error

OptInRecentPhotos enables the Recent Photos feature by clicking on the Set up button displayed in the Phone Hub bubble and run the set up flow right before user consent on the phone.

func PhoneSilenced

func PhoneSilenced(ctx context.Context, tconn *chrome.TestConn) (bool, error)

PhoneSilenced returns true if the "Silence phone" pod is active, and false otherwise.

func Show

func Show(ctx context.Context, tconn *chrome.TestConn) error

Show opens Phone Hub if it's not already open.

func ToggleLocatePhonePod

func ToggleLocatePhonePod(ctx context.Context, tconn *chrome.TestConn, enable bool) error

ToggleLocatePhonePod toggles Phone Hub's "Locate phone" pod on/off.

func ToggleRecentPhotosSetting

func ToggleRecentPhotosSetting(ctx context.Context, tconn *chrome.TestConn, cr *chrome.Chrome, enable bool) error

ToggleRecentPhotosSetting toggles the Recent Photos setting using JS. This assumes that a connected device has already been paired.

func ToggleSilencePhonePod

func ToggleSilencePhonePod(ctx context.Context, tconn *chrome.TestConn, silence bool) error

ToggleSilencePhonePod toggles Phone Hub's "Silence Phone" pod on/off.

func WaitForLocatePhoneEnabled

func WaitForLocatePhoneEnabled(ctx context.Context, tconn *chrome.TestConn, silenced bool, timeout time.Duration) error

WaitForLocatePhoneEnabled waits for the "Locate phone" pod to be toggled on/off.

func WaitForPhoneSilenced

func WaitForPhoneSilenced(ctx context.Context, tconn *chrome.TestConn, silenced bool, timeout time.Duration) error

WaitForPhoneSilenced waits for the "Phone Silenced" pod to be toggled on/off, since its state can be changed from the Android side.

Types

type RecentTabChip

type RecentTabChip struct {
	URL    string
	Finder *nodewith.Finder
}

RecentTabChip represents one of Phone Hub's "Recent Chrome tab" chips.

func RecentTabChips

func RecentTabChips(ctx context.Context, tconn *chrome.TestConn) ([]RecentTabChip, error)

RecentTabChips returns all of the "Recent Chrome tab" chips currently displayed in Phone Hub.

Jump to

Keyboard shortcuts

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