3 <script src=
"../../../http/tests/inspector/inspector-test.js"></script>
8 function createContentProvider(url
)
10 var contentProvider
= new WebInspector
.StaticContentProvider(WebInspector
.resourceTypes
.Script
, "");
11 contentProvider
.requestContent = function(callback
)
13 InspectorTest
.addResult("Source requested for " + url
);
16 return contentProvider
;
19 var workspace
= new WebInspector
.Workspace();
20 workspace
.networkProject
= new WebInspector
.NetworkProject(InspectorTest
.mainTarget
, workspace
, WebInspector
.networkMapping
);
22 function addNetworkFile(url
)
24 return workspace
.networkProject
.addFileForURL(url
, createContentProvider(url
));
27 function dumpUISourceCodeDisplayName(url
)
29 var uiSourceCode
= addNetworkFile(url
);
30 InspectorTest
.addResult("UISourceCode display name for url \"" + url
+ "\" is \"" + WebInspector
.TabbedEditorContainer
.prototype._titleForFile(uiSourceCode
) + "\".");
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?parameter=value&nnn=1");
39 InspectorTest
.completeTest();
43 <body onload=
"runTest()">
44 <p>Tests UISourceCode display name.
</p>