| 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 InspectorTest.addFooJSFile(fs); |
| 15 var networkSourceCode; |
| 16 var fileSystemSourceCode; |
| 17 var fileSystemSourceFrame, networkSourceFrame; |
| 18 |
| 19 InspectorTest.runTestSuite([ |
| 20 function waitForUISourceCodes(next) |
| 21 { |
| 22 fs.reportCreated(function() { }); |
| 23 Promise.all([ |
| 24 InspectorTest.waitForUISourceCode("foo.js", Workspace.projectTyp
es.FileSystem) |
| 25 .then(sourceCode => fileSystemSourceCode = sourceCode), |
| 26 InspectorTest.waitForUISourceCode("foo.js", Workspace.projectTyp
es.Network) |
| 27 .then(sourceCode => networkSourceCode = sourceCode), |
| 28 ]).then(next); |
| 29 }, |
| 30 |
| 31 function addMessages(next) |
| 32 { |
| 33 fileSystemSourceCode.addLineMessage(Workspace.UISourceCode.Message.L
evel.Error, 'error in filesystem', 0, 0); |
| 34 networkSourceCode.addLineMessage(Workspace.UISourceCode.Message.Leve
l.Warning, 'warning in network', 1, 0); |
| 35 |
| 36 Promise.all([ |
| 37 InspectorTest.showUISourceCodePromise(fileSystemSourceCode), |
| 38 InspectorTest.showUISourceCodePromise(networkSourceCode) |
| 39 ]).then(onSourceFrames); |
| 40 |
| 41 function onSourceFrames(sourceFrames) |
| 42 { |
| 43 fileSystemSourceFrame = sourceFrames[0]; |
| 44 networkSourceFrame = sourceFrames[1]; |
| 45 InspectorTest.dumpSourceFrameMessages(fileSystemSourceFrame, /*
dumpFullURL */ true); |
| 46 InspectorTest.dumpSourceFrameMessages(networkSourceFrame, /* dum
pFullURL */ true); |
| 47 next(); |
| 48 } |
| 49 }, |
| 50 |
| 51 function addMapping(next) |
| 52 { |
| 53 InspectorTest.waitForBinding("foo.js").then(onBindingCreated); |
| 54 Workspace.fileSystemMapping.addFileMapping(fs.fileSystemPath, "http:
//127.0.0.1:8000", "/"); |
| 55 |
| 56 function onBindingCreated(binding) |
| 57 { |
| 58 InspectorTest.dumpSourceFrameMessages(fileSystemSourceFrame, /*
dumpFullURL */ true); |
| 59 InspectorTest.dumpSourceFrameMessages(networkSourceFrame, /* dum
pFullURL */ true); |
| 60 next(); |
| 61 } |
| 62 }, |
| 63 |
| 64 function removeMapping(next) |
| 65 { |
| 66 Persistence.persistence.addEventListener(Persistence.Persistence.Eve
nts.BindingRemoved, onBindingRemoved); |
| 67 Workspace.fileSystemMapping.removeFileMapping(fs.fileSystemPath, "ht
tp://127.0.0.1:8000", "/"); |
| 68 |
| 69 function onBindingRemoved(event) |
| 70 { |
| 71 var binding = event.data; |
| 72 if (binding.network.name() !== "foo.js") |
| 73 return |
| 74 Persistence.persistence.removeEventListener(Persistence.Persiste
nce.Events.BindingRemoved, onBindingRemoved); |
| 75 InspectorTest.dumpSourceFrameMessages(fileSystemSourceFrame, /*
dumpFullURL */ true); |
| 76 InspectorTest.dumpSourceFrameMessages(networkSourceFrame, /* dum
pFullURL */ true); |
| 77 next(); |
| 78 } |
| 79 }, |
| 80 ]); |
| 81 }; |
| 82 </script> |
| 83 </head> |
| 84 <body onload="runTest()"> |
| 85 <p>Verify that messages are synced in UISourceCodeFrame between UISourceCodes of
persistence binding.</p> |
| 86 </body> |
| 87 </html> |
| OLD | NEW |