| 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 function readFile(entry, successCallback, errorCallback) { | 5 function readFile(entry, successCallback, errorCallback) { |
| 6 var reader = new FileReader(); | 6 var reader = new FileReader(); |
| 7 reader.onloadend = function(e) { | 7 reader.onloadend = function(e) { |
| 8 successCallback(reader.result); | 8 successCallback(reader.result); |
| 9 }; | 9 }; |
| 10 reader.onerror = function(e) { | 10 reader.onerror = function(e) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 error = {message: 'File content not as expected. ' + | 34 error = {message: 'File content not as expected. ' + |
| 35 'Expected: "' + expectedText + '", ' + | 35 'Expected: "' + expectedText + '", ' + |
| 36 'Read: ' + text + '".'}; | 36 'Read: ' + text + '".'}; |
| 37 } | 37 } |
| 38 callback(error); | 38 callback(error); |
| 39 }, | 39 }, |
| 40 callback); | 40 callback); |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 chrome.test.runTests([function tab() { | 43 chrome.test.runTests([function tab() { |
| 44 var expectedTasks = {'TextAction': ['filesystem:*.txt'], | 44 var expectedTasks = {'AbcAction': ['filesystem:*.abc'], |
| 45 'BaseAction': ['filesystem:*', 'filesystem:*.*']}; | 45 'BaseAction': ['filesystem:*', 'filesystem:*.*']}; |
| 46 var expectations = new TestExpectations(expectedTasks, verifyFileContent); | 46 var expectations = new TestExpectations(expectedTasks, verifyFileContent); |
| 47 | 47 |
| 48 var testRunner = new TestRunner(expectations); | 48 var testRunner = new TestRunner(expectations); |
| 49 testRunner.runTest(); | 49 testRunner.runTest(); |
| 50 }]); | 50 }]); |
| OLD | NEW |