| 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 addIframe() | 6 function addIframe() |
| 7 { | 7 { |
| 8 var iframe = document.createElement("iframe"); | 8 var iframe = document.createElement("iframe"); |
| 9 iframe.setAttribute("src", "resources/syntax-error.html"); | 9 iframe.setAttribute("src", "resources/syntax-error.html"); |
| 10 document.body.appendChild(iframe); | 10 document.body.appendChild(iframe); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 function dumpUISourceCode(uiSourceCode, callback) | 45 function dumpUISourceCode(uiSourceCode, callback) |
| 46 { | 46 { |
| 47 InspectorTest.addResult("UISourceCode: " + uiSourceCodeURL(uiSourceCode)
); | 47 InspectorTest.addResult("UISourceCode: " + uiSourceCodeURL(uiSourceCode)
); |
| 48 if (uiSourceCode.contentType() === Common.resourceTypes.Script || uiSour
ceCode.contentType() === Common.resourceTypes.Document) | 48 if (uiSourceCode.contentType() === Common.resourceTypes.Script || uiSour
ceCode.contentType() === Common.resourceTypes.Document) |
| 49 InspectorTest.addResult("UISourceCode is content script: " + (uiSour
ceCode.project().type() === Workspace.projectTypes.ContentScripts)); | 49 InspectorTest.addResult("UISourceCode is content script: " + (uiSour
ceCode.project().type() === Workspace.projectTypes.ContentScripts)); |
| 50 uiSourceCode.requestContent().then(didRequestContent); | 50 uiSourceCode.requestContent().then(didRequestContent); |
| 51 | 51 |
| 52 function didRequestContent(content, contentEncoded) | 52 function didRequestContent(content, contentEncoded) |
| 53 { | 53 { |
| 54 InspectorTest.addResult("Highlighter type: " + Bindings.NetworkProje
ct.uiSourceCodeMimeType(uiSourceCode)); | 54 InspectorTest.addResult("Highlighter type: " + uiSourceCode.mimeType
()); |
| 55 InspectorTest.addResult("UISourceCode content: " + content); | 55 InspectorTest.addResult("UISourceCode content: " + content); |
| 56 callback(); | 56 callback(); |
| 57 } | 57 } |
| 58 } | 58 } |
| 59 | 59 |
| 60 InspectorTest.runTestSuite([ | 60 InspectorTest.runTestSuite([ |
| 61 function testDocumentResource(next) | 61 function testDocumentResource(next) |
| 62 { | 62 { |
| 63 InspectorTest.addResult("Creating resource."); | 63 InspectorTest.addResult("Creating resource."); |
| 64 InspectorTest.waitForUISourceCode("resources/syntax-error.html").the
n(uiSourceCodeAdded); | 64 InspectorTest.waitForUISourceCode("resources/syntax-error.html").the
n(uiSourceCodeAdded); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 ]); | 116 ]); |
| 117 }; | 117 }; |
| 118 </script> | 118 </script> |
| 119 </head> | 119 </head> |
| 120 <body onload="runTest()"> | 120 <body onload="runTest()"> |
| 121 <p>Tests NetworkUISourceCodeProvider class.</p> | 121 <p>Tests NetworkUISourceCodeProvider class.</p> |
| 122 </body> | 122 </body> |
| 123 </html> | 123 </html> |
| OLD | NEW |