[PTRun][URL]Fix web link with ports support (#19809)

* [PT Run] Fix web link with ports support (#14260)

* URL in the format of `domain:port` now directs to default browser

* Add tests to verify web link with ports scenario

* Fix test case and scenario where mismatching schema and port for IPv6 does not result in correct output

* [PT Run][Tests] Change and add more UriParser Tests

* Specifically of note is line 56, where [IPv6]:80 diverts to https instead of http.

* [PT Run][Tests] Add UriParser tests

* Add more tests targeting port handling

* [PT Run] Fix http handling

* This also fixes oddity with IPv4 and IPv6 handling

* [PT Run] Add second results depending on condition

* Test: update all test to reflect updated functions & add a little more tests

* Update function to show two results when URI is in the format of `domain:port` (situation where it can also be `schema:path`)

* Update regex style to follow previous code

* [PT Run] Change tests and filter localhost from certain results

* Add tests for 127.0.0.1, localhost, and ::1

* Move test around into more logical arrangement

* Filter localhost out from showing double results

* [PT Run] Fix spelling on comments

* [PT Run] Add some words to expect.txt

* [PT Toys] Clarify comment regarding [::]

Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com>

* [PT Run] Remove tests regarding tel protocol

* [PT Run] Clarify UriParser parameter

* [PT Run] Add UriParser tests for tel protocol

* Current code has a regression bug where tel:xxxx, if xxxx is more than 65536 it will break. Will fix in follow up commit.

* [PT Run] Refactor ExtendedUriParser and its tests

* Remove `isWebUri` from ExtendedUriParser, keeping only webUri and systemUri

* Tel protocol regression bug still exists

* [PT Run] Fix wrong icon when webUri result

* [PT Run] Fix regression bug for tel protocol

* Tel protocol will sometimes bug out when tel:xxxx if xxxxx is more than 65535, as UriBuilder will throw error thinking the port number has been exceeded

* [PT Toy] Fix tel test

* [PT Run] Changes to tests

* Add test for application uri to include ports, for all non-protocol, http and https variants

* Rearrange some more test to make more logical sense, and add comments

* [PT Run] Simplify code

* Move webUri and systemUri to be global, as per htcfreek's recommendation

* Add comment to empty catch

* Change null to default

* [PT Toy] Update test name

Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com>

* [PT Toy] Change result prompt when empty string

* [PT Toy] Fix typo in comment

* [PT Toy] Simplify line

* [PT Toy] Change result prompt when empty string
This commit is contained in:
Koh Jun Dong
2022-08-12 00:04:39 +08:00
committed by GitHub
parent c0217a3cc4
commit efa09182d3
5 changed files with 245 additions and 118 deletions

View File

@@ -5,7 +5,6 @@ abgr
abi
ABlocked
ABOUTBOX
ABradley
Abug
accctrl
Acceleratorkeys
@@ -134,7 +133,6 @@ awakeness
awakeversion
AWAYMODE
AYUV
azchohfi
backend
backtracer
BADD
@@ -371,6 +369,7 @@ cxfksword
CXSMICON
CXVIRTUALSCREEN
cxxopts
Cxxx
cyberrex
Cyrl
CYSMICON
@@ -420,7 +419,6 @@ Delimarsky
dend
DENORMAL
Deondre
dependabot
depersist
deprioritized
deps
@@ -520,8 +518,8 @@ editshortcutswindow
EFile
ekus
elif
eltociear
elseif
eltociear
Emoji
emptyrecyclebin
ENABLEDPOPUP
@@ -1093,6 +1091,7 @@ LOADSTRING
LOBYTE
LOCALAPPDATA
LOCALDISPLAY
localhost
LOCALPACKAGE
localport
localtime
@@ -1298,7 +1297,6 @@ NAMECHANGE
nameof
namespace
Navassa
naveensrinivasan
NCACTIVATE
ncc
NCCALCSIZE
@@ -1440,8 +1438,8 @@ openxmlformats
OPTIMIZEFORINVOKE
ORAW
ORPHANEDDIALOGTITLE
oss
osfanbuff
oss
ostr
ostream
ostringstream