OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <meta charset="UTF-8"> | 2 <meta charset="UTF-8"> |
3 <!-- based on crbug.com/94895#c20 | 3 <!-- based on crbug.com/94895#c20 |
4 http://crbug.com/94895 | 4 http://crbug.com/94895 |
5 http://webkit.org/b/76461 --> | 5 http://webkit.org/b/76461 --> |
6 <script> | 6 <script> |
7 if (location.search != '?reenter') { | 7 if (location.search != '?reenter') { |
8 if (window.testRunner) { | 8 if (window.testRunner) { |
9 testRunner.dumpAsText(); | 9 testRunner.dumpAsText(); |
10 testRunner.waitUntilDone(); | 10 testRunner.waitUntilDone(); |
11 } | 11 } |
12 | 12 |
13 webkitRequestFileSystem(TEMPORARY, 1024*1024, | 13 webkitRequestFileSystem(TEMPORARY, 1024*1024, |
14 gotFS, onError.bind(null, 'requestFileSystem')); | 14 gotFS, onError.bind(null, 'requestFileSystem')); |
15 } else { | 15 } else { |
16 document.write('PASS'); | 16 document.write('PASS'); |
17 | 17 |
18 if (window.testRunner) | 18 if (window.testRunner) |
19 testRunner.notifyDone(); | 19 testRunner.notifyDone(); |
20 } | 20 } |
21 | 21 |
22 function onError(msg, e) { | 22 function onError(msg, e) { |
23 document.body.innerText = 'FAIL: ' + e.code + ' msg = ' + msg; | 23 document.body.innerText = 'FAIL: ' + e.name + ' msg = ' + msg; |
24 if (window.testRunner) | 24 if (window.testRunner) |
25 testRunner.notifyDone(); | 25 testRunner.notifyDone(); |
26 } | 26 } |
27 | 27 |
28 function gotFS(fs) { | 28 function gotFS(fs) { |
29 fs.root.getFile('hoge', {create: true}, | 29 fs.root.getFile('hoge', {create: true}, |
30 gotEntry, onError.bind(null, 'getFile')); | 30 gotEntry, onError.bind(null, 'getFile')); |
31 } | 31 } |
32 | 32 |
33 function gotEntry(entry) { | 33 function gotEntry(entry) { |
34 // It should not cause a crash that calling FileEntry.file() while the page is
unloading. | 34 // It should not cause a crash that calling FileEntry.file() while the page is
unloading. |
35 location.search = '?reenter'; | 35 location.search = '?reenter'; |
36 entry.file(gotFile, onError.bind(null, 'file')); | 36 entry.file(gotFile, onError.bind(null, 'file')); |
37 } | 37 } |
38 | 38 |
39 function gotFile(file) { | 39 function gotFile(file) { |
40 // Ignore the result of FileEntry.file(). | 40 // Ignore the result of FileEntry.file(). |
41 } | 41 } |
42 </script> | 42 </script> |
OLD | NEW |