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
3 // found in the LICENSE file.
6 // logout/restart/shutdown don't do anything as we don't want to kill the
7 // browser with these tests.
9 chrome.autotestPrivate.logout();
10 chrome.test.succeed();
13 chrome.autotestPrivate.restart();
14 chrome.test.succeed();
17 chrome.autotestPrivate.shutdown(true);
18 chrome.test.succeed();
20 function lockScreen() {
21 chrome.autotestPrivate.lockScreen();
22 chrome.test.succeed();
24 function simulateAsanMemoryBug() {
25 chrome.autotestPrivate.simulateAsanMemoryBug();
26 chrome.test.succeed();
28 function loginStatus() {
29 chrome.autotestPrivate.loginStatus(
30 chrome.test.callbackPass(function(status) {
31 chrome.test.assertEq(typeof(status), 'object');
32 chrome.test.assertTrue(status.hasOwnProperty("isLoggedIn"));
33 chrome.test.assertTrue(status.hasOwnProperty("isOwner"));
34 chrome.test.assertTrue(status.hasOwnProperty("isScreenLocked"));
35 chrome.test.assertTrue(status.hasOwnProperty("isRegularUser"));
36 chrome.test.assertTrue(status.hasOwnProperty("isGuest"));
37 chrome.test.assertTrue(status.hasOwnProperty("isKiosk"));
38 chrome.test.assertTrue(status.hasOwnProperty("email"));
39 chrome.test.assertTrue(status.hasOwnProperty("displayEmail"));
40 chrome.test.assertTrue(status.hasOwnProperty("userImage"));
43 function getExtensionsInfo() {
44 chrome.autotestPrivate.getExtensionsInfo(
45 chrome.test.callbackPass(function(extInfo) {
46 chrome.test.assertEq(typeof(extInfo), 'object');
47 chrome.test.assertTrue(extInfo.hasOwnProperty('extensions'));
48 chrome.test.assertTrue(extInfo.extensions.constructor === Array);
49 for (var i = 0; i < extInfo.extensions.length; ++i) {
50 var extension = extInfo.extensions[i];
51 chrome.test.assertTrue(extension.hasOwnProperty('id'));
52 chrome.test.assertTrue(extension.hasOwnProperty('version'));
53 chrome.test.assertTrue(extension.hasOwnProperty('name'));
54 chrome.test.assertTrue(extension.hasOwnProperty('publicKey'));
55 chrome.test.assertTrue(extension.hasOwnProperty('description'));
56 chrome.test.assertTrue(extension.hasOwnProperty('backgroundUrl'));
57 chrome.test.assertTrue(extension.hasOwnProperty(
59 chrome.test.assertTrue(
60 extension.hostPermissions.constructor === Array);
61 chrome.test.assertTrue(extension.hasOwnProperty(
62 'effectiveHostPermissions'));
63 chrome.test.assertTrue(
64 extension.effectiveHostPermissions.constructor === Array);
65 chrome.test.assertTrue(extension.hasOwnProperty(
67 chrome.test.assertTrue(
68 extension.apiPermissions.constructor === Array);
69 chrome.test.assertTrue(extension.hasOwnProperty('isComponent'));
70 chrome.test.assertTrue(extension.hasOwnProperty('isInternal'));
71 chrome.test.assertTrue(extension.hasOwnProperty(
73 chrome.test.assertTrue(extension.hasOwnProperty('isEnabled'));
74 chrome.test.assertTrue(extension.hasOwnProperty(
75 'allowedInIncognito'));
76 chrome.test.assertTrue(extension.hasOwnProperty('hasPageAction'));
80 function setTouchpadSensitivity() {
81 chrome.autotestPrivate.setTouchpadSensitivity(3);
82 chrome.test.succeed();
84 function setTapToClick() {
85 chrome.autotestPrivate.setTapToClick(true);
86 chrome.test.succeed();
88 function setThreeFingerClick() {
89 chrome.autotestPrivate.setThreeFingerClick(true);
90 chrome.test.succeed();
92 function setTapDragging() {
93 chrome.autotestPrivate.setTapDragging(false);
94 chrome.test.succeed();
96 function setNaturalScroll() {
97 chrome.autotestPrivate.setNaturalScroll(true);
98 chrome.test.succeed();
100 function setMouseSensitivity() {
101 chrome.autotestPrivate.setMouseSensitivity(3);
102 chrome.test.succeed();
104 function setPrimaryButtonRight() {
105 chrome.autotestPrivate.setPrimaryButtonRight(false);
106 chrome.test.succeed();