Index: chrome/test/data/extensions/api_test/file_system/open_directory_with_write/test_util.js |
diff --git a/chrome/test/data/extensions/api_test/file_system/test_util.js b/chrome/test/data/extensions/api_test/file_system/open_directory_with_write/test_util.js |
similarity index 65% |
copy from chrome/test/data/extensions/api_test/file_system/test_util.js |
copy to chrome/test/data/extensions/api_test/file_system/open_directory_with_write/test_util.js |
index a768b029fbdfbdd14813c457d1bb741f3f5993ca..f0b37f739b8e8986fe3047d2e8669299befa7316 100644 |
--- a/chrome/test/data/extensions/api_test/file_system/test_util.js |
+++ b/chrome/test/data/extensions/api_test/file_system/open_directory_with_write/test_util.js |
@@ -2,9 +2,11 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-// This is a duplicate of the file test_util in |
+// This is a modified duplicate of the file test_util in |
// chrome/test/data/extensions/api_test/file_system |
+// TODO(sammc): Merge the changes back to the original test_util.js. See |
+// http://crbug.com/280942. |
function checkEntry(entry, expectedName, isNew, shouldBeWritable) { |
chrome.test.assertEq(expectedName, entry.name); |
@@ -36,19 +38,23 @@ function checkEntry(entry, expectedName, isNew, shouldBeWritable) { |
} else { |
if (shouldBeWritable) { |
// Get a new entry and check the data got to disk. |
- chrome.fileSystem.chooseEntry(chrome.test.callbackPass( |
- function(readEntry) { |
- readEntry.file(chrome.test.callback(function(readFile) { |
- var readReader = new FileReader(); |
- readReader.onloadend = function(e) { |
- chrome.test.assertEq(readReader.result.indexOf("HoHoHo!"), |
- 0); |
- chrome.test.succeed(); |
- }; |
- readReader.onerror = function(e) { |
- chrome.test.fail("Failed to read file after write."); |
- }; |
- readReader.readAsText(readFile); |
+ chrome.fileSystem.chooseEntry( |
+ {type: 'openDirectory'}, chrome.test.callbackPass( |
+ function(directoryEntry) { |
+ directoryEntry.getFile( |
+ entry.name, {}, chrome.test.callback(function(readEntry) { |
+ readEntry.file(chrome.test.callback(function(readFile) { |
+ var readReader = new FileReader(); |
+ readReader.onloadend = function(e) { |
+ chrome.test.assertEq(readReader.result.indexOf("HoHoHo!"), |
+ 0); |
+ chrome.test.succeed(); |
+ }; |
+ readReader.onerror = function(e) { |
+ chrome.test.fail("Failed to read file after write."); |
+ }; |
+ readReader.readAsText(readFile); |
+ })); |
})); |
})); |
} else { |