From 6905046d6f6540e2b7810bc5495f16ca76204aed Mon Sep 17 00:00:00 2001 From: Kateryna Prokopenko Date: Wed, 24 Nov 2021 11:34:24 +0000 Subject: [PATCH] Cast path variables to DevToolsPath types rather than function argument Bug: 1253323 Change-Id: I8f044f1f37e99ac4a42fab5db99782e549df72ae Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3298818 Reviewed-by: Victor Porof Commit-Queue: Kateryna Prokopenko --- .../front_end/core/common/ParsedURL_test.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/unittests/front_end/core/common/ParsedURL_test.ts b/test/unittests/front_end/core/common/ParsedURL_test.ts index b84fb67c0d..a6f68caedd 100644 --- a/test/unittests/front_end/core/common/ParsedURL_test.ts +++ b/test/unittests/front_end/core/common/ParsedURL_test.ts @@ -70,32 +70,32 @@ describe('Parsed URL', () => { }); it('converts platform path to a URL that does not start with "file://"', () => { - const platformPathTest = 'usr/lib'; - const convertedUrl = ParsedURL.rawPathToUrlString(platformPathTest as Platform.DevToolsPath.RawPathString); + const platformPathTest = 'usr/lib' as Platform.DevToolsPath.RawPathString; + const convertedUrl = ParsedURL.rawPathToUrlString(platformPathTest); assert.strictEqual(convertedUrl, 'file:///usr/lib', 'URL was not converted correctly'); }); it('converts platform path to a URL that does not start with "file://" but starts with a slash ("/")', () => { - const platformPathTest = '/usr/lib'; - const convertedUrl = ParsedURL.rawPathToUrlString(platformPathTest as Platform.DevToolsPath.RawPathString); + const platformPathTest = '/usr/lib' as Platform.DevToolsPath.RawPathString; + const convertedUrl = ParsedURL.rawPathToUrlString(platformPathTest); assert.strictEqual(convertedUrl, 'file:///usr/lib', 'URL was not converted correctly'); }); it('converts platform path to a URL that starts with "file://"', () => { - const platformPathTest = 'file://usr/lib'; - const convertedUrl = ParsedURL.rawPathToUrlString(platformPathTest as Platform.DevToolsPath.RawPathString); + const platformPathTest = 'file://usr/lib' as Platform.DevToolsPath.RawPathString; + const convertedUrl = ParsedURL.rawPathToUrlString(platformPathTest); assert.strictEqual(convertedUrl, 'file://usr/lib', 'URL was not converted correctly'); }); it('converts path that starts with "file://" to a platform path', () => { - const pathTest = 'file://usr/lib'; - const convertedPath = ParsedURL.capFilePrefix(pathTest as Platform.DevToolsPath.UrlString); + const pathTest = 'file://usr/lib' as Platform.DevToolsPath.UrlString; + const convertedPath = ParsedURL.capFilePrefix(pathTest); assert.strictEqual(convertedPath, 'usr/lib', 'URL was not converted successfully'); }); it('converts path that starts with "file:///" to a platform path on Windows', () => { - const pathTest = 'file:///usr/lib'; - const convertedPath = ParsedURL.capFilePrefix(pathTest as Platform.DevToolsPath.UrlString, true); + const pathTest = 'file:///usr/lib' as Platform.DevToolsPath.UrlString; + const convertedPath = ParsedURL.capFilePrefix(pathTest, true); assert.strictEqual(convertedPath, 'usr\\lib', 'URL was not converted successfully'); });