New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 765878 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Feature



Sign in to add a comment

Add Keyboard support to BR/EDR and LE tests

Project Member Reported by alent@google.com, Sep 16 2017

Issue description

We'd like to enable tests that use keyboards as well.

My parting thoughts on this are: (I started work on this but didn't get more than a messy draft.)

Have a KeyboardSendRawHIDReport(modifier_codes, key_codes) method in PeripheralKit, and (IMPORTANTLY) change the getattr hack to prevent access like we did for the Mouse* methods. (If args are zero-equivalent, then that's release all held keys. We might want to add an arg for the reserved byte, but that's usually zero so it's optional.) This is the only method we need since both kits do raw reports.

Then we can implement the state in the generic BluetoothHIDKeyboard, unlike the Mouse where the kit needed to have state and made things more complicated.

Then in BluetoothHIDKeyboard, we'd have methods like PressKey which takes an ASCII character and presses it, sending the shift modifier if applicable. (Maybe extend to non-ASCII key codes in the future.) PressKeys would press a few keys simultaneously (w/ shift limited to binary on or off of course).
We'd have other methods that would be Type which uses PressKey and loops to type an address for example, and then we'd have a HoldModifier/ReleaseModifier that let you add modifiers so you can hold control and then press n to get a new tab, for example. The modifiers would be abstracted with string constants, not the raw key codes.

(Though maybe we should just expose raw key events so that autotest can issue them and check that they match. Thoughts?)
This probably needs some more thought, but in general we want to build simple methods like Type or ControlAndKeyPressRelease from these so that tests can do Ctrl-N, http://google.com and then move the mouse, etc.
 

Comment 2 by alent@google.com, Sep 16 2017

Labels: -Type-Bug Type-Feature
Status: Assigned (was: Unconfirmed)

Sign in to add a comment