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. 2. 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: .. test_list:: generic_ec_component_accel_examples:AccelerometerIMUTests. GoToTabletModeAndGoBack Set lid_filter to choose the lid sensor explicitly: .. test_list:: generic_ec_component_accel_examples:AccelerometerIMUTests. GoToTabletModeAndGoBackSetLid To test screen rotation for Chrome and prompt operator to flip before and after the test, we can combine the test with `tablet_rotation.py <./tablet_rotation.html>`_: .. test_list:: generic_ec_component_accel_examples:AccelerometerIMUTests.ScreenRotation Test Arguments -------------- .. list-table:: :widths: 20 10 60 :header-rows: 1 :align: left * - 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.)