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