| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 var stage = 0; | 5 var stage = 0; |
| 6 | 6 |
| 7 function step() { | 7 function step() { |
| 8 chrome.screenlockPrivate.getLocked(function gotLocked(locked) { | 8 chrome.screenlockPrivate.getLocked(function gotLocked(locked) { |
| 9 if (stage === 0) { | 9 if (stage === 0) { |
| 10 if (locked) { | 10 if (locked) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 chrome.screenlockPrivate.onChanged.addListener(function(locked) { | 35 chrome.screenlockPrivate.onChanged.addListener(function(locked) { |
| 36 if (locked != (1 == (stage % 2))) { | 36 if (locked != (1 == (stage % 2))) { |
| 37 chrome.test.fail((locked ? '' : 'un') + 'locked at stage ' + stage + | 37 chrome.test.fail((locked ? '' : 'un') + 'locked at stage ' + stage + |
| 38 ' onChanged'); | 38 ' onChanged'); |
| 39 } else { | 39 } else { |
| 40 return step(); | 40 return step(); |
| 41 } | 41 } |
| 42 }); | 42 }); |
| 43 | 43 |
| 44 step(); | 44 chrome.test.runTests([ |
| 45 function testLockUnlock() { |
| 46 step(); |
| 47 } |
| 48 ]); |
| OLD | NEW |