| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | |
| 4 <script> | |
| 5 function test() | |
| 6 { | |
| 7 | |
| 8 function createContentProvider(url) | |
| 9 { | |
| 10 var contentProvider = new WebInspector.StaticContentProvider(WebInspecto
r.resourceTypes.Script, ""); | |
| 11 contentProvider.requestContent = function(callback) | |
| 12 { | |
| 13 InspectorTest.addResult("Source requested for " + url); | |
| 14 callback(""); | |
| 15 }; | |
| 16 return contentProvider; | |
| 17 } | |
| 18 | |
| 19 var workspace = new WebInspector.Workspace(); | |
| 20 workspace.networkProject = new WebInspector.NetworkProject(InspectorTest.mai
nTarget, workspace, WebInspector.networkMapping); | |
| 21 | |
| 22 function addNetworkFile(url) | |
| 23 { | |
| 24 return workspace.networkProject.addFileForURL(url, createContentProvider
(url)); | |
| 25 } | |
| 26 | |
| 27 function dumpUISourceCodeDisplayName(url) | |
| 28 { | |
| 29 var uiSourceCode = addNetworkFile(url); | |
| 30 InspectorTest.addResult("UISourceCode display name for url \"" + url + "
\" is \"" + WebInspector.TabbedEditorContainer.prototype._titleForFile(uiSourceC
ode) + "\"."); | |
| 31 } | |
| 32 | |
| 33 const baseURL = "http://localhost:8080/folder/"; | |
| 34 dumpUISourceCodeDisplayName(baseURL + "filename?parameter=value&nnn=1"); | |
| 35 dumpUISourceCodeDisplayName(baseURL + "very-long-filename-123456?nn=1"); | |
| 36 dumpUISourceCodeDisplayName(baseURL + "too-long-filename-1234567890?nn=1"); | |
| 37 dumpUISourceCodeDisplayName(baseURL + "long-filename?parameter=value&nnn=1")
; | |
| 38 dumpUISourceCodeDisplayName(baseURL + "too-long-filename-1234567890?paramete
r=value&nnn=1"); | |
| 39 InspectorTest.completeTest(); | |
| 40 }; | |
| 41 </script> | |
| 42 </head> | |
| 43 <body onload="runTest()"> | |
| 44 <p>Tests UISourceCode display name.</p> | |
| 45 </body> | |
| 46 </html> | |
| OLD | NEW |