| 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() |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 function onBindingCreated(binding) | 28 function onBindingCreated(binding) |
| 29 { | 29 { |
| 30 InspectorTest.addResult("Binding created: " + binding); | 30 InspectorTest.addResult("Binding created: " + binding); |
| 31 networkCode = binding.network; | 31 networkCode = binding.network; |
| 32 fileSystemCode = binding.fileSystem; | 32 fileSystemCode = binding.fileSystem; |
| 33 next(); | 33 next(); |
| 34 } | 34 } |
| 35 }, | 35 }, |
| 36 | 36 |
| 37 function changeFileSystem(next) | 37 function addFileSystemRevision(next) |
| 38 { | 38 { |
| 39 InspectorTest.addSniffer(Persistence.Persistence.prototype, "_conten
tSyncedForTest", onSynced); | 39 InspectorTest.addSniffer(Persistence.Persistence.prototype, "_conten
tSyncedForTest", dumpWorkingCopiesAndNext.bind(null, next)); |
| 40 fsEntry.setContent("window.foo3 = 3;"); | 40 fsEntry.setContent("window.foo3 = 3;"); |
| 41 | |
| 42 function onSynced() | |
| 43 { | |
| 44 InspectorTest.addResult(`network code: '${networkCode.workingCop
y()}'`); | |
| 45 InspectorTest.addResult(`fileSystem code: '${fileSystemCode.work
ingCopy()}'`); | |
| 46 next(); | |
| 47 } | |
| 48 }, | 41 }, |
| 49 | 42 |
| 50 function changeNetworkUISourceCode(next) | 43 function addFileSystemWorkingCopy(next) |
| 51 { | 44 { |
| 52 InspectorTest.addSniffer(Persistence.Persistence.prototype, "_conten
tSyncedForTest", onSynced); | 45 InspectorTest.addSniffer(Persistence.Persistence.prototype, "_conten
tSyncedForTest", dumpWorkingCopiesAndNext.bind(null, next)); |
| 46 fileSystemCode.setWorkingCopy("window.foo4 = 4;"); |
| 47 }, |
| 48 |
| 49 function setNetworkRevision(next) |
| 50 { |
| 51 InspectorTest.addSniffer(Persistence.Persistence.prototype, "_conten
tSyncedForTest", dumpWorkingCopiesAndNext.bind(null, next)); |
| 53 networkCode.addRevision("window.foo2 = 2;"); | 52 networkCode.addRevision("window.foo2 = 2;"); |
| 53 }, |
| 54 | 54 |
| 55 function onSynced() | 55 function setNetworkWorkingCopy(next) |
| 56 { | 56 { |
| 57 InspectorTest.addResult(`network code: '${networkCode.workingCop
y()}'`); | 57 InspectorTest.addSniffer(Persistence.Persistence.prototype, "_conten
tSyncedForTest", dumpWorkingCopiesAndNext.bind(null, next)); |
| 58 InspectorTest.addResult(`fileSystem code: '${fileSystemCode.work
ingCopy()}'`); | 58 networkCode.setWorkingCopy("window.foo5 = 5;"); |
| 59 next(); | 59 }, |
| 60 } | |
| 61 } | |
| 62 ]); | 60 ]); |
| 61 |
| 62 function dumpWorkingCopiesAndNext(next) { |
| 63 InspectorTest.addResult(`network code: '${networkCode.workingCopy()}'`); |
| 64 InspectorTest.addResult(`fileSystem code: '${fileSystemCode.workingCopy(
)}'`); |
| 65 next(); |
| 66 } |
| 63 }; | 67 }; |
| 64 </script> | 68 </script> |
| 65 </head> | 69 </head> |
| 66 <body onload="runTest()"> | 70 <body onload="runTest()"> |
| 67 <p>Tests that persistence syncs network and filesystem UISourceCodes.</p> | 71 <p>Tests that persistence syncs network and filesystem UISourceCodes.</p> |
| 68 </body> | 72 </body> |
| 69 </html> | 73 </html> |
| OLD | NEW |