Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / sources / debugger-ui / ui-source-code-display-name.html
blobf05c2d7ed6f724ce9766da0f26338b72ece50b4d
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script>
5 function test()
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);
14 callback("");
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();
41 </script>
42 </head>
43 <body onload="runTest()">
44 <p>Tests UISourceCode display name.</p>
45 </body>
46 </html>