| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // This just tests the interface. It does not test for specific results, only | 5 // This just tests the interface. It does not test for specific results, only |
| 6 // that callbacks are correctly invoked, expected parameters are correct, | 6 // that callbacks are correctly invoked, expected parameters are correct, |
| 7 // and failures are detected. | 7 // and failures are detected. |
| 8 | 8 |
| 9 var availableTests = [ | 9 var availableTests = [ |
| 10 function removeSavedPassword() { | 10 function removeSavedPassword() { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 function requestPlaintextPassword() { | 57 function requestPlaintextPassword() { |
| 58 var callback = function() { | 58 var callback = function() { |
| 59 // Ensure that the callback is invoked. | 59 // Ensure that the callback is invoked. |
| 60 chrome.test.succeed(); | 60 chrome.test.succeed(); |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 chrome.passwordsPrivate.onPlaintextPasswordRetrieved.addListener(callback); | 63 chrome.passwordsPrivate.onPlaintextPasswordRetrieved.addListener(callback); |
| 64 chrome.passwordsPrivate.requestPlaintextPassword( | 64 chrome.passwordsPrivate.requestPlaintextPassword( |
| 65 {originUrl: 'http://www.test.com', username: 'test@test.com'}); | 65 {originUrl: 'http://www.test.com', username: 'test@test.com'}); |
| 66 }, | 66 }, |
| 67 |
| 68 function getSavedPasswordList() { |
| 69 var callback = function(list) { |
| 70 chrome.test.assertTrue(!!list); |
| 71 // Ensure that the callback is invoked. |
| 72 chrome.test.succeed(); |
| 73 }; |
| 74 |
| 75 chrome.passwordsPrivate.getSavedPasswordList(callback); |
| 76 }, |
| 77 |
| 78 function getPasswordExceptionList() { |
| 79 var callback = function(list) { |
| 80 chrome.test.assertTrue(!!list); |
| 81 // Ensure that the callback is invoked. |
| 82 chrome.test.succeed(); |
| 83 }; |
| 84 |
| 85 chrome.passwordsPrivate.getPasswordExceptionList(callback); |
| 86 }, |
| 67 ]; | 87 ]; |
| 68 | 88 |
| 69 var testToRun = window.location.search.substring(1); | 89 var testToRun = window.location.search.substring(1); |
| 70 chrome.test.runTests(availableTests.filter(function(op) { | 90 chrome.test.runTests(availableTests.filter(function(op) { |
| 71 return op.name == testToRun; | 91 return op.name == testToRun; |
| 72 })); | 92 })); |
| OLD | NEW |