| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 test file checks if we can read the expected contents | 5 // This test file checks if we can read the expected contents |
| 6 // (kExpectedContents) from the target file (kFileName). We will try to read | 6 // (kExpectedContents) from the target file (kFileName). We will try to read |
| 7 // the file directly, and using a filesystem handler | 7 // the file directly, and using a filesystem handler |
| 8 // (chorme/test/data/extensions/api_test/filesystem_handler/). What's | 8 // (chorme/test/data/extensions/api_test/filesystem_handler/). What's |
| 9 // interesting is that we'll read the file via a remote mount point. | 9 // interesting is that we'll read the file via a remote mount point. |
| 10 // See external_filesystem_apitest.cc for how this is set up. | 10 // See external_filesystem_apitest.cc for how this is set up. |
| 11 | 11 |
| 12 // These should match the counterparts in feeds used in | 12 // These should match the counterparts in feeds used in |
| 13 // external_filesystem_apitest.cc. | 13 // external_filesystem_apitest.cc. |
| 14 // The feeds are located in chrome/test/data/chromeos/drive/. | 14 // The feeds are located in chrome/test/data/chromeos/drive/. |
| 15 var kDirectoryPath = 'drive/Folder'; | 15 var kDirectoryPath = 'drive/Folder'; |
| 16 var kFileName = 'File.aBc'; | 16 var kFileName = 'File.aBc'; |
| 17 var kExpectedContents = 'hello, world!'; | 17 // The drive service returns "x"s of the file size defined in the JSON file. |
| 18 var kWriteOffset = 12; | 18 // The file size for File.aBc is set to 13. |
| 19 var kExpectedContents = 'xxxxxxxxxxxxx'; |
| 20 var kWriteOffset = 13; |
| 19 var kWriteData = '!!!'; | 21 var kWriteData = '!!!'; |
| 20 var kExpectedAfterWrite = 'hello, world!!!'; | 22 var kExpectedAfterWrite = 'xxxxxxxxxxxxx!!!'; |
| 21 var kTruncateShortLength = 5; | 23 var kTruncateShortLength = 5; |
| 22 var kExpectedAfterTruncateShort = 'hello'; | 24 var kExpectedAfterTruncateShort = 'xxxxx'; |
| 23 var kTruncateLongLength = 7; | 25 var kTruncateLongLength = 7; |
| 24 var kExpectedAfterTruncateLong = 'hello\0\0'; | 26 var kExpectedAfterTruncateLong = 'xxxxx\0\0'; |
| 25 var kNewDirectoryPath = 'drive/FolderNew'; | 27 var kNewDirectoryPath = 'drive/FolderNew'; |
| 26 var kFileManagerExtensionId = 'hhaomjibdihmijegdhdafkllkbggdgoj'; | 28 var kFileManagerExtensionId = 'hhaomjibdihmijegdhdafkllkbggdgoj'; |
| 27 | 29 |
| 28 // Gets local filesystem used in tests. | 30 // Gets local filesystem used in tests. |
| 29 TestRunner.prototype.init = function() { | 31 TestRunner.prototype.init = function() { |
| 30 // Get local FS. | 32 // Get local FS. |
| 31 console.log('Requesting local file system...'); | 33 console.log('Requesting local file system...'); |
| 32 chrome.fileBrowserPrivate.requestLocalFileSystem( | 34 chrome.fileBrowserPrivate.requestLocalFileSystem( |
| 33 this.onFileSystemFetched_.bind(this)); | 35 this.onFileSystemFetched_.bind(this)); |
| 34 }; | 36 }; |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 testRunner.runCancelTest(kFileName, 'write'); | 302 testRunner.runCancelTest(kFileName, 'write'); |
| 301 }, | 303 }, |
| 302 function cancelTruncate() { | 304 function cancelTruncate() { |
| 303 testRunner.runCancelTest(kFileName, 'truncate'); | 305 testRunner.runCancelTest(kFileName, 'truncate'); |
| 304 }, | 306 }, |
| 305 function createDir() { | 307 function createDir() { |
| 306 // Creates new directory. | 308 // Creates new directory. |
| 307 testRunner.runGetDirTest(kNewDirectoryPath, true); | 309 testRunner.runGetDirTest(kNewDirectoryPath, true); |
| 308 }, | 310 }, |
| 309 ]); | 311 ]); |
| OLD | NEW |