Make hitting "Enter" submit the add/change profile dialog.
[chromium-blink-merge.git] / chrome / test / functional / chromeos_prefs.py
blobf6b8e64da41f5f70be5cbc24c397885928d12451
1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 import os
7 import sys
8 import time
10 import pyauto_functional # Must be imported before pyauto
11 import pyauto
13 sys.path.append('/usr/local') # Required to import autotest libs
14 from autotest.cros import constants
17 class ChromeosPrefsTest(pyauto.PyUITest):
18 """TestCase for ChromeOS Preferences."""
20 # Defined in src/chrome/browser/chromeos/login/user_manager.cc
21 k_logged_in_users = 'LoggedInUsers'
22 k_user_images = 'UserImages'
23 k_image_path_node_name = 'path'
25 def testAllUserImage(self):
26 """Verify changing all available default user images in Change picture."""
28 logged_in_user = constants.CREDENTIALS['$default'][0]
29 for i in range(19):
30 image = {
31 "index": i,
32 "path": ""
34 user_images = {}
35 user_images[logged_in_user] = image
36 self.SetLocalStatePrefs(ChromeosPrefsTest.k_user_images, user_images)
37 self.RestartBrowser(clear_profile=False)
38 current_user_images = self.GetLocalStatePrefsInfo().Prefs(
39 ChromeosPrefsTest.k_user_images)
40 current_image = current_user_images.get(logged_in_user)
41 self.assertEqual(image, current_image,
42 msg='Default user image was not set in preferences.')
45 if __name__ == '__main__':
46 pyauto_functional.Main()