OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../inspector-test.js"></script> |
| 4 <script src="../debugger-test.js"></script> |
| 5 <script src="../workspace-test.js"></script> |
| 6 <script src="../isolated-filesystem-test.js"></script> |
| 7 <script src="./persistence-test.js"></script> |
| 8 <script src="./resources/foo.js"></script> |
| 9 <script> |
| 10 |
| 11 function test() |
| 12 { |
| 13 var fs = new InspectorTest.TestFileSystem("file:///var/www"); |
| 14 var fsEntry = InspectorTest.addFooJSFile(fs); |
| 15 |
| 16 var networkCode, fileSystemCode; |
| 17 |
| 18 InspectorTest.runTestSuite([ |
| 19 function addFileSystem(next) |
| 20 { |
| 21 fs.reportCreated(next); |
| 22 }, |
| 23 |
| 24 function addFileMapping(next) |
| 25 { |
| 26 InspectorTest.waitForBinding("foo.js").then(onBindingCreated); |
| 27 WebInspector.fileSystemMapping.addFileMapping(fs.fileSystemPath, "ht
tp://127.0.0.1:8000", "/"); |
| 28 |
| 29 function onBindingCreated(binding) |
| 30 { |
| 31 InspectorTest.addResult("Binding created: " + binding); |
| 32 networkCode = binding.network; |
| 33 fileSystemCode = binding.fileSystem; |
| 34 next(); |
| 35 } |
| 36 }, |
| 37 |
| 38 function changeFileSystem(next) |
| 39 { |
| 40 InspectorTest.addSniffer(WebInspector.Persistence.prototype, "_conte
ntSyncedForTest", onSynced); |
| 41 fsEntry.setContent("window.foo3 = 3;"); |
| 42 |
| 43 function onSynced() |
| 44 { |
| 45 InspectorTest.addResult(`network code: '${networkCode.workingCop
y()}'`); |
| 46 InspectorTest.addResult(`fileSystem code: '${fileSystemCode.work
ingCopy()}'`); |
| 47 next(); |
| 48 } |
| 49 }, |
| 50 |
| 51 function changeNetworkUISourceCode(next) |
| 52 { |
| 53 InspectorTest.addSniffer(WebInspector.Persistence.prototype, "_conte
ntSyncedForTest", onSynced); |
| 54 networkCode.addRevision("window.foo2 = 2;"); |
| 55 |
| 56 function onSynced() |
| 57 { |
| 58 InspectorTest.addResult(`network code: '${networkCode.workingCop
y()}'`); |
| 59 InspectorTest.addResult(`fileSystem code: '${fileSystemCode.work
ingCopy()}'`); |
| 60 next(); |
| 61 } |
| 62 } |
| 63 ]); |
| 64 }; |
| 65 </script> |
| 66 </head> |
| 67 <body onload="runTest()"> |
| 68 <p>Tests that persistence syncs network and filesystem UISourceCodes.</p> |
| 69 </body> |
| 70 </html> |
OLD | NEW |