tablet_mode

Source code: tablet_mode.py

Tests that certain conditions are met when in tablet mode.

Description

Currently, it check that the lid switch is not triggered and tablet mode event is triggered and in correct state.

Turning devices into tablet mode exercises the GMR sensor and the accelerometer.

Test Procedure

  1. If prompt_flip_tablet is set:

  1. The operator flips the device to make it enter tablet mode.

  2. The operator clicks the button by using touch screen or external mouse.

  1. If prompt_flip_notebook is set:

  1. The operator flips the device to make it enter notebook mode.

  2. The operator presses the space key.

Dependency

  • cros.factory.external.py_lib.evdev

  • cros.factory.test.utils.evdev_utils

Examples

To run the test, add this in test list:

{
  "pytest_name": "tablet_mode",
  "args": {
    "prompt_flip_tablet": true,
    "prompt_flip_notebook": true
  }
}

Set lid_filter to choose the lid sensor explicitly:

{
  "pytest_name": "tablet_mode",
  "args": {
    "prompt_flip_tablet": true,
    "prompt_flip_notebook": true,
    "lid_filter": "Lid Switch"
  }
}

You can also use the ScreenRotation, which is defined in generic_common.test_list.json.

Test Arguments

Name

Type

Description

timeout_secs

int

(optional; default: 30) Timeout value for the test.

lid_filter

int, str, None

(optional; default: None) Lid event ID or name for evdev. None for auto probe.

tablet_filter

int, str, None

(optional; default: None) Tablet event ID or name for evdev. None for auto probe.

prompt_flip_tablet

bool

(optional; default: False) Assume the notebook is not yet in tablet mode, and operator should first be instructed to flip it as such. (This is useful to unset if the previous test finished in tablet mode.)

prompt_flip_notebook

bool

(optional; default: False) After the test, prompt the operator to flip back into notebook mode. (This is useful to unset if the next test requires tablet mode.)