1 // Copyright 2014 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.
8 chrome.screenlockPrivate.getLocked(function gotLocked(locked) {
11 chrome.test.fail('locked at stage ' + stage);
13 chrome.screenlockPrivate.setLocked(true);
17 } else if (stage === 1) {
19 chrome.test.fail('unlocked at stage ' + stage);
21 chrome.screenlockPrivate.setLocked(false);
25 } else if (stage === 2) {
27 chrome.test.fail('locked at stage ' + stage);
29 chrome.test.succeed();
35 chrome.screenlockPrivate.onChanged.addListener(function(locked) {
36 if (locked != (1 == (stage % 2))) {
37 chrome.test.fail((locked ? '' : 'un') + 'locked at stage ' + stage +
44 chrome.test.runTests([
45 function testLockUnlock() {