OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../http/tests/inspector/inspector-test.js"></script> |
4 <script> | 4 <script> |
5 function test() | 5 function test() |
6 { | 6 { |
7 InspectorTest.runTestSuite([ | 7 InspectorTest.runTestSuite([ |
8 function testFileSystemClashDirectOrder(next) | 8 function testFileSystemClashDirectOrder(next) |
9 { | 9 { |
10 var fileSystemMapping = new WebInspector.FileSystemMapping(); | 10 var fileSystemMapping = new WebInspector.FileSystemMapping(); |
11 fileSystemMapping.addFileSystem("//Source/devtools"); | 11 fileSystemMapping.addFileSystem("/Source/devtools"); |
12 | 12 |
13 fileSystemMapping.addNonConfigurableFileMapping("//Source/devtools",
"chrome-devtools://devtools/bundled/wrong_url", "/"); | 13 fileSystemMapping.addNonConfigurableFileMapping("/Source/devtools",
"chrome-devtools://devtools/bundled/wrong_url", "/"); |
14 fileSystemMapping.addFileMapping("//Source/devtools", "http://localh
ost:1234/right_url", "/"); | 14 fileSystemMapping.addFileMapping("/Source/devtools", "http://localho
st:1234/right_url", "/"); |
15 | 15 |
16 InspectorTest.addResult(fileSystemMapping.urlForPath("//Source/devto
ols", "/file.txt")); | 16 InspectorTest.addResult(fileSystemMapping.urlForPath("/Source/devtoo
ls", "file:///Source/devtools/file.txt")); |
17 next(); | 17 next(); |
18 }, | 18 }, |
19 | 19 |
20 function testFileSystemClashReversedOrder(next) | 20 function testFileSystemClashReversedOrder(next) |
21 { | 21 { |
22 var fileSystemMapping = new WebInspector.FileSystemMapping(); | 22 var fileSystemMapping = new WebInspector.FileSystemMapping(); |
23 fileSystemMapping.addFileSystem("//Source/devtools"); | 23 fileSystemMapping.addFileSystem("/Source/devtools"); |
24 | 24 |
25 fileSystemMapping.addFileMapping("//Source/devtools", "http://localh
ost:1234/right_url", "/"); | 25 fileSystemMapping.addFileMapping("/Source/devtools", "http://localho
st:1234/right_url", "/"); |
26 fileSystemMapping.addNonConfigurableFileMapping("//Source/devtools",
"chrome-devtools://devtools/wrong_url", "/"); | 26 fileSystemMapping.addNonConfigurableFileMapping("/Source/devtools",
"chrome-devtools://devtools/wrong_url", "/"); |
27 | 27 |
28 InspectorTest.addResult(fileSystemMapping.urlForPath("//Source/devto
ols", "/file.txt")); | 28 InspectorTest.addResult(fileSystemMapping.urlForPath("/Source/devtoo
ls", "file:///Source/devtools/file.txt")); |
29 next(); | 29 next(); |
30 }, | 30 }, |
31 | 31 |
32 function testNetworkClashDirectOrder(next) | 32 function testNetworkClashDirectOrder(next) |
33 { | 33 { |
34 var fileSystemMapping = new WebInspector.FileSystemMapping(); | 34 var fileSystemMapping = new WebInspector.FileSystemMapping(); |
35 fileSystemMapping.addFileSystem("//Source/devtools"); | 35 fileSystemMapping.addFileSystem("/Source/devtools"); |
36 | 36 |
37 fileSystemMapping.addNonConfigurableFileMapping("//Source/devtools",
"http://localhost:1234/front_end", "/wrong"); | 37 fileSystemMapping.addNonConfigurableFileMapping("/Source/devtools",
"http://localhost:1234/front_end", "/wrong"); |
38 fileSystemMapping.addFileMapping("//Source/devtools", "http://localh
ost:1234/front_end", "/right"); | 38 fileSystemMapping.addFileMapping("/Source/devtools", "http://localho
st:1234/front_end", "/right"); |
39 | 39 |
40 InspectorTest.addResult(fileSystemMapping.fileForURL("http://localho
st:1234/front_end/file.txt").filePath); | 40 InspectorTest.addResult(fileSystemMapping.fileForURL("http://localho
st:1234/front_end/file.txt").fileURL); |
41 next(); | 41 next(); |
42 }, | 42 }, |
43 | 43 |
44 function testNetworkClashReversedOrder(next) | 44 function testNetworkClashReversedOrder(next) |
45 { | 45 { |
46 var fileSystemMapping = new WebInspector.FileSystemMapping(); | 46 var fileSystemMapping = new WebInspector.FileSystemMapping(); |
47 fileSystemMapping.addFileSystem("//Source/devtools"); | 47 fileSystemMapping.addFileSystem("/Source/devtools"); |
48 | 48 |
49 fileSystemMapping.addFileMapping("//Source/devtools", "http://localh
ost:1234/front_end", "/right"); | 49 fileSystemMapping.addFileMapping("/Source/devtools", "http://localho
st:1234/front_end", "/right"); |
50 fileSystemMapping.addNonConfigurableFileMapping("//Source/devtools",
"http://localhost:1234/front_end", "/wrong"); | 50 fileSystemMapping.addNonConfigurableFileMapping("/Source/devtools",
"http://localhost:1234/front_end", "/wrong"); |
51 | 51 |
52 InspectorTest.addResult(fileSystemMapping.fileForURL("http://localho
st:1234/front_end/file.txt").filePath); | 52 InspectorTest.addResult(fileSystemMapping.fileForURL("http://localho
st:1234/front_end/file.txt").fileURL); |
53 next(); | 53 next(); |
54 }, | 54 }, |
55 ]); | 55 ]); |
56 } | 56 } |
57 </script> | 57 </script> |
58 </head> | 58 </head> |
59 <body onload="runTest()"> | 59 <body onload="runTest()"> |
60 <p>Tests FileSystemMapping overrides</p> | 60 <p>Tests FileSystemMapping overrides</p> |
61 </body> | 61 </body> |
62 </html> | 62 </html> |
OLD | NEW |