Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / test / data / extensions / api_test / autotest_private / test.js
blob142077edebc512aa7a12aede36a809863434d398
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.
5 chrome.test.runTests([
6   // logout/restart/shutdown don't do anything as we don't want to kill the
7   // browser with these tests.
8   function logout() {
9     chrome.autotestPrivate.logout();
10     chrome.test.succeed();
11   },
12   function restart() {
13     chrome.autotestPrivate.restart();
14     chrome.test.succeed();
15   },
16   function shutdown() {
17     chrome.autotestPrivate.shutdown(true);
18     chrome.test.succeed();
19   },
20   function lockScreen() {
21     chrome.autotestPrivate.lockScreen();
22     chrome.test.succeed();
23   },
24   function simulateAsanMemoryBug() {
25     chrome.autotestPrivate.simulateAsanMemoryBug();
26     chrome.test.succeed();
27   },
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"));
41         }));
42   },
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(
58                 'hostPermissions'));
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(
66                 'apiPermissions'));
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(
72                 'isUserInstalled'));
73             chrome.test.assertTrue(extension.hasOwnProperty('isEnabled'));
74             chrome.test.assertTrue(extension.hasOwnProperty(
75                 'allowedInIncognito'));
76             chrome.test.assertTrue(extension.hasOwnProperty('hasPageAction'));
77           }
78         }));
79   },
80   function setTouchpadSensitivity() {
81     chrome.autotestPrivate.setTouchpadSensitivity(3);
82     chrome.test.succeed();
83   },
84   function setTapToClick() {
85     chrome.autotestPrivate.setTapToClick(true);
86     chrome.test.succeed();
87   },
88   function setThreeFingerClick() {
89     chrome.autotestPrivate.setThreeFingerClick(true);
90     chrome.test.succeed();
91   },
92   function setTapDragging() {
93     chrome.autotestPrivate.setTapDragging(false);
94     chrome.test.succeed();
95   },
96   function setNaturalScroll() {
97     chrome.autotestPrivate.setNaturalScroll(true);
98     chrome.test.succeed();
99   },
100   function setMouseSensitivity() {
101     chrome.autotestPrivate.setMouseSensitivity(3);
102     chrome.test.succeed();
103   },
104   function setPrimaryButtonRight() {
105     chrome.autotestPrivate.setPrimaryButtonRight(false);
106     chrome.test.succeed();
107   }