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 // Verifies that the filesystem_handler extension returned the content of the | 5 // Verifies that the filesystem_handler extension returned the content of the |
6 // file. | 6 // file. |
7 function verifyFileContent(file, originalText, receivedText, callback) { | 7 function verifyFileContent(file, originalText, receivedText, callback) { |
8 var error = undefined; | 8 var error = undefined; |
9 if (receivedText != originalText) | 9 if (receivedText != originalText) |
10 error = {message: 'Received content does not match. ' + | 10 error = {message: 'Received content does not match. ' + |
11 'Expected "' + originalText + '", ' + | 11 'Expected "' + originalText + '", ' + |
12 'Got "' + receivedText + '".'}; | 12 'Got "' + receivedText + '".'}; |
13 callback(error); | 13 callback(error); |
14 }; | 14 }; |
15 | 15 |
16 chrome.test.runTests([function tab() { | 16 chrome.test.runTests([function tab() { |
17 var expectedTasks = {'TextAction': ['filesystem:*.txt'], | 17 var expectedTasks = {'AbcAction': ['filesystem:*.abc'], |
18 'BaseAction': ['filesystem:*', 'filesystem:*.*']}; | 18 'BaseAction': ['filesystem:*', 'filesystem:*.*']}; |
19 var expectations = new TestExpectations(expectedTasks, verifyFileContent); | 19 var expectations = new TestExpectations(expectedTasks, verifyFileContent); |
20 | 20 |
21 var testRunner = new TestRunner(expectations); | 21 var testRunner = new TestRunner(expectations); |
22 testRunner.runTest(); | 22 testRunner.runTest(); |
23 }]); | 23 }]); |
OLD | NEW |