| 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> | 4 <script> |
| 5 function test() | 5 async function test() |
| 6 { | 6 { |
| 7 | 7 async function dumpUISourceCodeDisplayName(url) |
| 8 function createContentProvider(url) | |
| 9 { | 8 { |
| 10 var contentProvider = Common.StaticContentProvider.fromString(url, Commo
n.resourceTypes.Script, ""); | 9 var uiSourceCode = await InspectorTest.addScriptUISourceCode(url, ''); |
| 11 contentProvider.requestContent = function() | |
| 12 { | |
| 13 InspectorTest.addResult("Source requested for " + url); | |
| 14 return Promise.resolve(""); | |
| 15 }; | |
| 16 return contentProvider; | |
| 17 } | |
| 18 | |
| 19 var workspace = new Workspace.Workspace(); | |
| 20 workspace.networkProject = new Bindings.NetworkProject(InspectorTest.mainTar
get, workspace); | |
| 21 | |
| 22 function addNetworkFile(url) | |
| 23 { | |
| 24 return workspace.networkProject.addFile(createContentProvider(url), Insp
ectorTest.mainFrame()); | |
| 25 } | |
| 26 | |
| 27 function dumpUISourceCodeDisplayName(url) | |
| 28 { | |
| 29 var uiSourceCode = addNetworkFile(url); | |
| 30 InspectorTest.addResult("UISourceCode display name for url \"" + url + "
\" is \"" + Sources.TabbedEditorContainer.prototype._titleForFile(uiSourceCode)
+ "\"."); | 10 InspectorTest.addResult("UISourceCode display name for url \"" + url + "
\" is \"" + Sources.TabbedEditorContainer.prototype._titleForFile(uiSourceCode)
+ "\"."); |
| 31 } | 11 } |
| 32 | 12 |
| 33 const baseURL = "http://localhost:8080/folder/"; | 13 const baseURL = "http://localhost:8080/folder/"; |
| 34 dumpUISourceCodeDisplayName(baseURL + "filename?parameter=value&nnn=1"); | 14 await dumpUISourceCodeDisplayName(baseURL + "filename?parameter=value&nnn=1"
); |
| 35 dumpUISourceCodeDisplayName(baseURL + "very-long-filename-123456?nn=1"); | 15 await dumpUISourceCodeDisplayName(baseURL + "very-long-filename-123456?nn=1"
); |
| 36 dumpUISourceCodeDisplayName(baseURL + "too-long-filename-1234567890?nn=1"); | 16 await dumpUISourceCodeDisplayName(baseURL + "too-long-filename-1234567890?nn
=1"); |
| 37 dumpUISourceCodeDisplayName(baseURL + "long-filename?parameter=value&nnn=1")
; | 17 await dumpUISourceCodeDisplayName(baseURL + "long-filename?parameter=value&n
nn=1"); |
| 38 dumpUISourceCodeDisplayName(baseURL + "too-long-filename-1234567890?paramete
r=value&nnn=1"); | 18 await dumpUISourceCodeDisplayName(baseURL + "too-long-filename-1234567890?pa
rameter=value&nnn=1"); |
| 39 InspectorTest.completeTest(); | 19 InspectorTest.completeTest(); |
| 40 }; | 20 }; |
| 41 </script> | 21 </script> |
| 42 </head> | 22 </head> |
| 43 <body onload="runTest()"> | 23 <body onload="runTest()"> |
| 44 <p>Tests UISourceCode display name.</p> | 24 <p>Tests UISourceCode display name.</p> |
| 45 </body> | 25 </body> |
| 46 </html> | 26 </html> |
| OLD | NEW |