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.
10 import pyauto_functional
# Must be imported before 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]
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()