OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../inspector-test.js"></script> | 3 <script src="../inspector-test.js"></script> |
4 <script src="../debugger-test.js"></script> | 4 <script src="../debugger-test.js"></script> |
5 <script src="../isolated-filesystem-test.js"></script> | 5 <script src="../isolated-filesystem-test.js"></script> |
6 <script src="./persistence-test.js"></script> | 6 <script src="./persistence-test.js"></script> |
7 <script src="./resources/foo.js"></script> | 7 <script src="./resources/foo.js"></script> |
8 <script> | 8 <script> |
9 | 9 |
10 function test() | 10 function test() |
11 { | 11 { |
| 12 InspectorTest.forceUseDefaultMapping(); |
12 var fs = new InspectorTest.TestFileSystem("file:///var/www"); | 13 var fs = new InspectorTest.TestFileSystem("file:///var/www"); |
13 var fsEntry = InspectorTest.addFooJSFile(fs); | 14 var fsEntry = InspectorTest.addFooJSFile(fs); |
14 fs.addFileMapping("http://127.0.0.1:8000", "/"); | 15 fs.addFileMapping("http://127.0.0.1:8000", "/"); |
15 fs.reportCreated(function () { }); | 16 fs.reportCreated(function () { }); |
16 InspectorTest.waitForBinding("foo.js").then(onBindingCreated); | 17 InspectorTest.waitForBinding("foo.js").then(onBindingCreated); |
17 Persistence.persistence.addEventListener(Persistence.Persistence.Events.Bind
ingRemoved, onBindingRemoved); | 18 Persistence.persistence.addEventListener(Persistence.Persistence.Events.Bind
ingRemoved, onBindingRemoved); |
18 | 19 |
19 function onBindingCreated(binding) | 20 function onBindingCreated(binding) |
20 { | 21 { |
21 InspectorTest.addResult("Binding created: " + binding); | 22 InspectorTest.addResult("Binding created: " + binding); |
22 InspectorTest.addResult("Renaming foo.js -> bar.js"); | 23 InspectorTest.addResult("Renaming foo.js -> bar.js"); |
23 binding.fileSystem.rename("bar.js", function() { }); | 24 binding.fileSystem.rename("bar.js", function() { }); |
24 } | 25 } |
25 | 26 |
26 function onBindingRemoved(event) | 27 function onBindingRemoved(event) |
27 { | 28 { |
28 var binding = event.data; | 29 var binding = event.data; |
29 InspectorTest.addResult("Binding successfully removed: " + binding); | 30 InspectorTest.addResult("Binding successfully removed: " + binding); |
30 InspectorTest.completeTest(); | 31 InspectorTest.completeTest(); |
31 } | 32 } |
32 | 33 |
33 }; | 34 }; |
34 </script> | 35 </script> |
35 </head> | 36 </head> |
36 <body onload="runTest()"> | 37 <body onload="runTest()"> |
37 <p>Verify that binding gets removed as the fileSystem file gets renamed.</p> | 38 <p>Verify that binding gets removed as the fileSystem file gets renamed.</p> |
38 </body> | 39 </body> |
39 </html> | 40 </html> |
OLD | NEW |