| Index: chrome/test/data/extensions/api_test/system/storage/test_storage_api.js
|
| diff --git a/chrome/test/data/extensions/api_test/system/storage/test_storage_api.js b/chrome/test/data/extensions/api_test/system/storage/test_storage_api.js
|
| index 594f2bcf99899fdfb9d75f83506cfcb5f135aed0..8926aece48d32ac87cc8b53549b501c3c37998bc 100644
|
| --- a/chrome/test/data/extensions/api_test/system/storage/test_storage_api.js
|
| +++ b/chrome/test/data/extensions/api_test/system/storage/test_storage_api.js
|
| @@ -8,13 +8,16 @@
|
| // Testing data should be the same as |kTestingData| in
|
| // system_storage_apitest.cc.
|
| var testData = [
|
| - { id:"", name: "0xbeaf", type: "removable", capacity: 4098 },
|
| - { id:"", name: "/home", type: "fixed", capacity: 4098 },
|
| - { id:"", name: "/data", type: "fixed", capacity: 10000 }
|
| + { id:"", name: "0xbeaf", type: "removable", capacity: 4098,
|
| + availableCapacity: 1},
|
| + { id:"", name: "/home", type: "fixed", capacity: 4098,
|
| + availableCapacity: 2},
|
| + { id:"", name: "/data", type: "fixed", capacity: 10000,
|
| + availableCapacity: 3}
|
| ];
|
|
|
| chrome.test.runTests([
|
| - function testGet() {
|
| + function testGetInfo() {
|
| chrome.system.storage.getInfo(chrome.test.callbackPass(function(units) {
|
| chrome.test.assertTrue(units.length == 3);
|
| for (var i = 0; i < units.length; ++i) {
|
| @@ -24,5 +27,23 @@ chrome.test.runTests([
|
| chrome.test.assertEq(testData[i].capacity, units[i].capacity);
|
| }
|
| }));
|
| + },
|
| + function testGetAvailableCapacity() {
|
| + chrome.system.storage.getInfo(chrome.test.callbackPass(function(units) {
|
| + chrome.test.assertTrue(units.length == 3);
|
| + // Record all storage devices' |id| in testData.
|
| + for (var i = 0; i < units.length; ++i)
|
| + testData[i].id = units[i].id;
|
| + for (var i = 0; i < units.length; ++i) {
|
| + chrome.system.storage.getAvailableCapacity(units[i].id, function(info) {
|
| + for (var j = 0; j < units.length; ++j) {
|
| + if (info.id == testData[j].id) {
|
| + chrome.test.assertEq(testData[j].availableCapacity,
|
| + info.availableCapacity);
|
| + }
|
| + }
|
| + });
|
| + }
|
| + }));
|
| }
|
| ]);
|
|
|