OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 chrome.test.runTests([ | 5 chrome.test.runTests([ |
6 // logout/restart/shutdown don't do anything as we don't want to kill the | 6 // logout/restart/shutdown don't do anything as we don't want to kill the |
7 // browser with these tests. | 7 // browser with these tests. |
8 function logout() { | 8 function logout() { |
9 chrome.autotestPrivate.logout(); | 9 chrome.autotestPrivate.logout(); |
10 chrome.test.succeed(); | 10 chrome.test.succeed(); |
11 }, | 11 }, |
12 function restart() { | 12 function restart() { |
13 chrome.autotestPrivate.restart(); | 13 chrome.autotestPrivate.restart(); |
14 chrome.test.succeed(); | 14 chrome.test.succeed(); |
15 }, | 15 }, |
16 function shutdown() { | 16 function shutdown() { |
17 chrome.autotestPrivate.shutdown(true); | 17 chrome.autotestPrivate.shutdown(true); |
18 chrome.test.succeed(); | 18 chrome.test.succeed(); |
19 }, | 19 }, |
20 function loginStatus() { | 20 function loginStatus() { |
21 chrome.autotestPrivate.loginStatus( | 21 chrome.autotestPrivate.loginStatus( |
22 chrome.test.callbackPass(function(status) { | 22 chrome.test.callbackPass(function(status) { |
23 chrome.test.assertEq(typeof(status), 'string'); | 23 chrome.test.assertEq(typeof(status), 'object'); |
24 chrome.test.assertTrue(status != ""); | 24 chrome.test.assertTrue(status.hasOwnProperty("isLoggedIn")); |
25 // TODO(achuith): Add tests for various login states. | 25 chrome.test.assertTrue(status.hasOwnProperty("isOwner")); |
| 26 chrome.test.assertTrue(status.hasOwnProperty("isScreenLocked")); |
| 27 chrome.test.assertTrue(status.hasOwnProperty("isRegularUser")); |
| 28 chrome.test.assertTrue(status.hasOwnProperty("isGuest")); |
| 29 chrome.test.assertTrue(status.hasOwnProperty("isKiosk")); |
| 30 chrome.test.assertTrue(status.hasOwnProperty("email")); |
| 31 chrome.test.assertTrue(status.hasOwnProperty("displayEmail")); |
| 32 chrome.test.assertTrue(status.hasOwnProperty("userImage")); |
26 })); | 33 })); |
27 } | 34 } |
28 ]); | 35 ]); |
OLD | NEW |