1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 function debug(message)
7 document.getElementById('status').innerHTML += '<br/>' + message;
10 function done(message)
12 if (document.location.hash == '#fail')
15 debug('PASS: ' + message);
18 document.location.hash = '#pass';
21 function fail(message)
23 debug('FAILED: ' + message);
24 document.location.hash = '#fail';
29 return '' + document.getElementById('status').innerHTML;
32 function fileErrorToString(e)
35 case FileError.QUOTA_EXCEEDED_ERR:
36 return 'QUOTA_EXCEEDED_ERR';
37 case FileError.NOT_FOUND_ERR:
38 return 'NOT_FOUND_ERR';
39 case FileError.SECURITY_ERR:
40 return 'SECURITY_ERR';
41 case FileError.INVALID_MODIFICATION_ERR:
42 return 'INVALID_MODIFICATION_ERR';
43 case FileError.INVALID_STATE_ERR:
44 return 'INVALID_STATE_ERR';
46 return 'Unknown Error';
50 function unexpectedErrorCallback(e)
52 fail('unexpectedErrorCallback:' + fileErrorToString(e));