| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> | 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 function startWorker() | 6 function startWorker() |
| 7 { | 7 { |
| 8 var workerScript = "postMessage('Done.');"; | 8 var workerScript = "postMessage('Done.');"; |
| 9 var blob = new Blob([workerScript], { type: "text/javascript" }); | 9 var blob = new Blob([workerScript], { type: "text/javascript" }); |
| 10 var worker = new Worker(URL.createObjectURL(blob)); | 10 var worker = new Worker(URL.createObjectURL(blob)); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 renameSnippetAndCheckWorkspace(uiSourceCode2, "bar"); | 129 renameSnippetAndCheckWorkspace(uiSourceCode2, "bar"); |
| 130 renameSnippetAndCheckWorkspace(uiSourceCode2, "foo"); | 130 renameSnippetAndCheckWorkspace(uiSourceCode2, "foo"); |
| 131 uiSourceCode1._requestContentPromise = null; | 131 uiSourceCode1._requestContentPromise = null; |
| 132 uiSourceCode1.contentLoaded = false; | 132 uiSourceCode1.contentLoaded = false; |
| 133 uiSourceCode1.requestContent() | 133 uiSourceCode1.requestContent() |
| 134 .then(contentCallback) | 134 .then(contentCallback) |
| 135 .then(onContentDumped); | 135 .then(onContentDumped); |
| 136 | 136 |
| 137 function onContentDumped() | 137 function onContentDumped() |
| 138 { | 138 { |
| 139 Snippets.scriptSnippetModel.project().deleteFile(uiSourceCod
e1.url()); | 139 Snippets.scriptSnippetModel.project().deleteFile(uiSourceCod
e1); |
| 140 Snippets.scriptSnippetModel.project().deleteFile(uiSourceCod
e2.url()); | 140 Snippets.scriptSnippetModel.project().deleteFile(uiSourceCod
e2); |
| 141 Snippets.scriptSnippetModel.project().createFile("", null, "
", step4.bind(this)); | 141 Snippets.scriptSnippetModel.project().createFile("", null, "
", step4.bind(this)); |
| 142 } | 142 } |
| 143 } | 143 } |
| 144 | 144 |
| 145 function step4(uiSourceCode) | 145 function step4(uiSourceCode) |
| 146 { | 146 { |
| 147 var uiSourceCode3 = uiSourceCode; | 147 var uiSourceCode3 = uiSourceCode; |
| 148 InspectorTest.addResult("Snippet3 created."); | 148 InspectorTest.addResult("Snippet3 created."); |
| 149 Snippets.scriptSnippetModel.project().deleteFile(uiSourceCode3.u
rl()); | 149 Snippets.scriptSnippetModel.project().deleteFile(uiSourceCode3); |
| 150 InspectorTest.addResult("Snippet3 deleted."); | 150 InspectorTest.addResult("Snippet3 deleted."); |
| 151 | 151 |
| 152 InspectorTest.addResult("Number of uiSourceCodes in workspace: "
+ workspace.uiSourceCodes().filter(filterSnippet).length); | 152 InspectorTest.addResult("Number of uiSourceCodes in workspace: "
+ workspace.uiSourceCodes().filter(filterSnippet).length); |
| 153 var storageSnippetsCount = Snippets.scriptSnippetModel._snippetS
torage.snippets().length; | 153 var storageSnippetsCount = Snippets.scriptSnippetModel._snippetS
torage.snippets().length; |
| 154 InspectorTest.addResult("Number of snippets in the storage: " +
storageSnippetsCount); | 154 InspectorTest.addResult("Number of snippets in the storage: " +
storageSnippetsCount); |
| 155 | 155 |
| 156 workspace.removeEventListener(Workspace.Workspace.Events.UISourc
eCodeAdded, uiSourceCodeAdded); | 156 workspace.removeEventListener(Workspace.Workspace.Events.UISourc
eCodeAdded, uiSourceCodeAdded); |
| 157 workspace.removeEventListener(Workspace.Workspace.Events.UISourc
eCodeRemoved, uiSourceCodeRemoved); | 157 workspace.removeEventListener(Workspace.Workspace.Events.UISourc
eCodeRemoved, uiSourceCodeRemoved); |
| 158 | 158 |
| 159 next(); | 159 next(); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 } | 307 } |
| 308 } | 308 } |
| 309 ]); | 309 ]); |
| 310 }; | 310 }; |
| 311 </script> | 311 </script> |
| 312 </head> | 312 </head> |
| 313 <body onload="runTest()"> | 313 <body onload="runTest()"> |
| 314 <p>Tests script snippet model.</p> | 314 <p>Tests script snippet model.</p> |
| 315 </body> | 315 </body> |
| 316 </html> | 316 </html> |
| OLD | NEW |