| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 'use strict'; | 4 'use strict'; |
| 5 | 5 |
| 6 /** | 6 /** |
| 7 * Mock of chrome.runtime. | 7 * Mock of chrome.runtime. |
| 8 * @type {Object} | 8 * @type {Object} |
| 9 * @const | 9 * @const |
| 10 */ | 10 */ |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 */ | 70 */ |
| 71 var DIRECTORY_SIZE = -1; | 71 var DIRECTORY_SIZE = -1; |
| 72 | 72 |
| 73 /** | 73 /** |
| 74 * Creates test file system. | 74 * Creates test file system. |
| 75 * @param {string} id File system ID. | 75 * @param {string} id File system ID. |
| 76 * @param {Object.<string, number>} entries Map of entries' paths and their | 76 * @param {Object.<string, number>} entries Map of entries' paths and their |
| 77 * size. If the size is equals to DIRECTORY_SIZE, the entry is derectory. | 77 * size. If the size is equals to DIRECTORY_SIZE, the entry is derectory. |
| 78 */ | 78 */ |
| 79 function createTestFileSystem(id, entries) { | 79 function createTestFileSystem(id, entries) { |
| 80 var fileSystem = new TestFileSystem(id); | 80 var fileSystem = new MockFileSystem(id, 'filesystem:' + id); |
| 81 for (var path in entries) { | 81 for (var path in entries) { |
| 82 if (entries[path] === DIRECTORY_SIZE) { | 82 if (entries[path] === DIRECTORY_SIZE) { |
| 83 fileSystem.entries[path] = new MockDirectoryEntry(fileSystem, path); | 83 fileSystem.entries[path] = new MockDirectoryEntry(fileSystem, path); |
| 84 } else { | 84 } else { |
| 85 fileSystem.entries[path] = | 85 fileSystem.entries[path] = |
| 86 new MockFileEntry(fileSystem, path, {size: entries[path]}); | 86 new MockFileEntry(fileSystem, path, {size: entries[path]}); |
| 87 } | 87 } |
| 88 } | 88 } |
| 89 return fileSystem; | 89 return fileSystem; |
| 90 } | 90 } |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 assertTrue(events.some(function(event) { | 424 assertTrue(events.some(function(event) { |
| 425 return event.type === 'entries-changed' && | 425 return event.type === 'entries-changed' && |
| 426 event.entries[0].fullPath === '/test.zip'; | 426 event.entries[0].fullPath === '/test.zip'; |
| 427 })); | 427 })); |
| 428 }), callback); | 428 }), callback); |
| 429 | 429 |
| 430 fileOperationManager.zipSelection( | 430 fileOperationManager.zipSelection( |
| 431 fileSystem.entries['/'], | 431 fileSystem.entries['/'], |
| 432 [fileSystem.entries['/test.txt']]); | 432 [fileSystem.entries['/test.txt']]); |
| 433 } | 433 } |
| OLD | NEW |