1# Copyright 2019 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4from autotest_lib.client.cros.enterprise import enterprise_policy_base
5from autotest_lib.client.common_lib import utils
6
7
8class policy_KioskModeEnabled(
9        enterprise_policy_base.EnterprisePolicyTest):
10    """Test for verifying that the DUT entered kiosk mode."""
11    version = 1
12
13    def run_once(self):
14        """Entry point of this test."""
15
16        # ID of the kiosk app to start.
17        kId = 'afhcomalholahplbjhnmahkoekoijban'
18
19        self.DEVICE_POLICIES = {
20            'DeviceLocalAccounts': [
21                {'account_id': kId, 'kiosk_app': {'app_id': kId}, 'type': 1}],
22            'DeviceLocalAccountAutoLoginId': kId
23        }
24
25        self.setup_case(
26            device_policies=self.DEVICE_POLICIES,
27            enroll=True,
28            kiosk_mode=True,
29            auto_login=False)
30        self.ui.start_ui_root(self.cr)
31        self.ui.wait_for_ui_obj(name='/Kiosk/', isRegex=True, timeout=30)
32