Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Unified Diff: third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/ui-source-code-display-name.html

Issue 2747863007: DevTools: clean up tests to not depend on NetworkProject.addFile method (Closed)
Patch Set: typo Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/ui-source-code-display-name.html
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/ui-source-code-display-name.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/ui-source-code-display-name.html
index 5fd0cbc4f0518bef8c6f3b626228080a81e2cb89..e7e9935bead91b0ded184b8eedcf102fd79cf3aa 100644
--- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/ui-source-code-display-name.html
+++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/ui-source-code-display-name.html
@@ -2,40 +2,20 @@
<head>
<script src="../../../http/tests/inspector/inspector-test.js"></script>
<script>
-function test()
+async function test()
{
-
- function createContentProvider(url)
- {
- var contentProvider = Common.StaticContentProvider.fromString(url, Common.resourceTypes.Script, "");
- contentProvider.requestContent = function()
- {
- InspectorTest.addResult("Source requested for " + url);
- return Promise.resolve("");
- };
- return contentProvider;
- }
-
- var workspace = new Workspace.Workspace();
- workspace.networkProject = new Bindings.NetworkProject(InspectorTest.mainTarget, workspace);
-
- function addNetworkFile(url)
- {
- return workspace.networkProject.addFile(createContentProvider(url), InspectorTest.mainFrame());
- }
-
- function dumpUISourceCodeDisplayName(url)
+ async function dumpUISourceCodeDisplayName(url)
{
- var uiSourceCode = addNetworkFile(url);
+ var uiSourceCode = await InspectorTest.addScriptUISourceCode(url, '');
InspectorTest.addResult("UISourceCode display name for url \"" + url + "\" is \"" + Sources.TabbedEditorContainer.prototype._titleForFile(uiSourceCode) + "\".");
}
const baseURL = "http://localhost:8080/folder/";
- dumpUISourceCodeDisplayName(baseURL + "filename?parameter=value&nnn=1");
- dumpUISourceCodeDisplayName(baseURL + "very-long-filename-123456?nn=1");
- dumpUISourceCodeDisplayName(baseURL + "too-long-filename-1234567890?nn=1");
- dumpUISourceCodeDisplayName(baseURL + "long-filename?parameter=value&nnn=1");
- dumpUISourceCodeDisplayName(baseURL + "too-long-filename-1234567890?parameter=value&nnn=1");
+ await dumpUISourceCodeDisplayName(baseURL + "filename?parameter=value&nnn=1");
+ await dumpUISourceCodeDisplayName(baseURL + "very-long-filename-123456?nn=1");
+ await dumpUISourceCodeDisplayName(baseURL + "too-long-filename-1234567890?nn=1");
+ await dumpUISourceCodeDisplayName(baseURL + "long-filename?parameter=value&nnn=1");
+ await dumpUISourceCodeDisplayName(baseURL + "too-long-filename-1234567890?parameter=value&nnn=1");
InspectorTest.completeTest();
};
</script>

Powered by Google App Engine
This is Rietveld 408576698