Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / inspector / filesystem / request-directory-content.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="UTF-8">
5 <script src="../inspector-test.js"></script>
6 <script src="filesystem-test.js"></script>
7 <script>
8 document.addEventListener("DOMContentLoaded", runTest);
9 function test()
10 {
11     var fileSystemModel = new WebInspector.FileSystemModel(WebInspector.targetManager.mainTarget());
12
13     var testStep = [
14         function()
15         {
16             InspectorTest.createDirectory("/hoge", testStep.shift());
17         },
18
19         function()
20         {
21             InspectorTest.createDirectory("/hoge/fuga", testStep.shift());
22         },
23
24         function()
25         {
26             InspectorTest.createFile("/hoge/piyo.html", testStep.shift());
27         },
28
29         function()
30         {
31             fileSystemModel._requestDirectoryContent("InvalidURL", testStep.shift());
32         },
33
34         function(errorCode, entries)
35         {
36             InspectorTest.dumpDirectoryContentRequestResult(errorCode, entries);
37             fileSystemModel._requestDirectoryContent("filesystem:http://127.0.0.1:8000/InvalidType/", testStep.shift());
38         },
39
40         function(errorCode, entries)
41         {
42             InspectorTest.dumpDirectoryContentRequestResult(errorCode, entries);
43             fileSystemModel._requestDirectoryContent("filesystem:http://127.0.0.1:8000/temporary/hoge", testStep.shift());
44         },
45
46         function(errorCode, entries)
47         {
48             InspectorTest.dumpDirectoryContentRequestResult(errorCode, entries);
49             fileSystemModel._requestDirectoryContent("filesystem:http://127.0.0.1:8000/temporary/foo", testStep.shift());
50         },
51
52         function(errorCode, entries)
53         {
54             InspectorTest.dumpDirectoryContentRequestResult(errorCode, entries);
55             fileSystemModel._requestDirectoryContent("filesystem:http://example.com/temporary/", testStep.shift());
56         },
57
58         function(errorCode, entries) {
59             InspectorTest.dumpDirectoryContentRequestResult(errorCode, entries);
60             InspectorTest.clearFileSystem(testStep.shift());
61         },
62
63         function()
64         {
65             InspectorTest.addResult("All tests have done.");
66             InspectorTest.completeTest();
67         }
68     ];
69
70     InspectorTest.clearFileSystem(testStep.shift());
71 }
72 </script>
73 </head>
74 <body>
75 <p>Tests requestDirectoryContent command.</p>
76 </body>
77 </html>