未验证 提交 8df2cff7 编写于 作者: O openharmony_ci 提交者: Gitee

!5868 Add URI and URL Exception Throwing Case

Merge pull request !5868 from zhangyouyou/master
...@@ -21,150 +21,161 @@ describe('UriTest', function () { ...@@ -21,150 +21,161 @@ describe('UriTest', function () {
/** /**
* @tc.name: testUriConstruction001 * @tc.name: testUriConstruction001
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction001', 0, function () { it('testUriConstruction001', 0, function () {
try { try {
let that = new uri.URI('#http://username:password@host:8080/directory/file?foo=1&bar=2'); let that = new uri.URI('#http://username:password@host:8080/directory/file?foo=1&bar=2');
} catch (err) { } catch (err) {
expect(err.toString()).assertEqual("Error: #It can't be the first"); expect(err.toString()).assertEqual("BusinessError: Syntax Error. Invalid Uri string");
expect(err.code).assertEqual(10200002)
expect(err.message).assertEqual("Syntax Error. Invalid Uri string");
} }
}) })
/** /**
* @tc.name: testUriConstruction002 * @tc.name: testUriConstruction002
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction002', 0, function () { it('testUriConstruction002', 0, function () {
try { try {
let that = new uri.URI({name: 'gaogao'}); var a = {name: 'gaogao'}
let that = new uri.URI(a);
} catch (err) { } catch (err) {
expect(err.toString()).assertEqual("Error: input type err"); expect(err.toString()).assertEqual(`BusinessError: Parameter error.The type of ${a} must be string`);
expect(err.code).assertEqual(401)
expect(err.message).assertEqual(`Parameter error.The type of ${a} must be string`);
} }
}) })
/** /**
* @tc.name: testUriConstruction003 * @tc.name: testUriConstruction003
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction003', 0, function () { it('testUriConstruction003', 0, function () {
try { try {
let that = new uri.URI('ht/tp://username:pas sword@host:8080/directory/file?foo=1&bar=2'); let that = new uri.URI('ht/tp://username:pas sword@host:8080/directory/file?foo=1&bar=2');
} catch (err) { } catch (err) {
expect(err.toString()).assertEqual("Error: SpecialPath does not conform to the rule"); expect(err.toString()).assertEqual("BusinessError: Syntax Error. Invalid Uri string");
expect(err.code).assertEqual(10200002)
expect(err.message).assertEqual("Syntax Error. Invalid Uri string");
} }
}) })
/** /**
* @tc.name: testUriConstruction004 * @tc.name: testUriConstruction004
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction004', 0, function () { it('testUriConstruction004', 0, function () {
try { try {
let that = new uri.URI('http://username:password@[::]:8080/directory/file?Query#gaogao faofao'); let that = new uri.URI('http://username:password@[::]:8080/directory/file?Query#gaogao faofao');
} catch (err) { } catch (err) {
expect(err.toString()).assertEqual("Error: Fragment does not conform to the rule"); expect(err.toString()).assertEqual("BusinessError: Syntax Error. Invalid Uri string");
expect(err.code).assertEqual(10200002)
expect(err.message).assertEqual("Syntax Error. Invalid Uri string");
} }
}) })
/** /**
* @tc.name: testUriConstruction005 * @tc.name: testUriConstruction005
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction005', 0, function () { it('testUriConstruction005', 0, function () {
try { try {
let that = new uri.URI('http://username:password@host:8080/directory/file?foo^=1&bar=2#gaogaofaofao'); let that = new uri.URI('http://username:password@host:8080/directory/file?foo^=1&bar=2#gaogaofaofao');
} catch (err) { } catch (err) {
expect(err.toString()).assertEqual("Error: Query does not conform to the rule"); expect(err.toString()).assertEqual("BusinessError: Syntax Error. Invalid Uri string");
expect(err.code).assertEqual(10200002)
expect(err.message).assertEqual("Syntax Error. Invalid Uri string");
} }
}) })
/** /**
* @tc.name: testUriConstruction006 * @tc.name: testUriConstruction006
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction006', 0, function () { it('testUriConstruction006', 0, function () {
try { try {
let that = new uri.URI('1http://username:password@host:8080/directory/file?foo=1&bar=2#gaogaofaofao'); let that = new uri.URI('1http://username:password@host:8080/directory/file?foo=1&bar=2#gaogaofaofao');
} catch (err) { } catch (err) {
expect(err.toString()).assertEqual("Error: Scheme the first character must be a letter"); expect(err.toString()).assertEqual("BusinessError: Syntax Error. Invalid Uri string");
expect(err.code).assertEqual(10200002)
expect(err.message).assertEqual("Syntax Error. Invalid Uri string");
} }
}) })
/** /**
* @tc.name: testUriConstruction007 * @tc.name: testUriConstruction007
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction007', 0, function () { it('testUriConstruction007', 0, function () {
try { try {
let that = new uri.URI('ht@tp://username:password@host:8080/directory/file?foo=1&bar=2#gaogaofaofao'); let that = new uri.URI('ht@tp://username:password@host:8080/directory/file?foo=1&bar=2#gaogaofaofao');
} catch (err) { } catch (err) {
expect(err.toString()).assertEqual("Error: scheme does not conform to the rule"); expect(err.toString()).assertEqual("BusinessError: Syntax Error. Invalid Uri string");
expect(err.code).assertEqual(10200002)
expect(err.message).assertEqual("Syntax Error. Invalid Uri string");
} }
}) })
/** /**
* @tc.name: testUriConstruction008 * @tc.name: testUriConstruction008
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction008', 0, function () { it('testUriConstruction008', 0, function () {
try { try {
let that = new uri.URI('http://username:password@[::]:80r80/directory/file?foo=1&bar=2#gaogaofaofao'); let that = new uri.URI('http://username:password@[::]:80r80/directory/file?foo=1&bar=2#gaogaofaofao');
} catch (err) { } catch (err) {
expect(err.toString()).assertEqual("Error: Prot does not conform to the rule"); expect(err.toString()).assertEqual("BusinessError: Syntax Error. Invalid Uri string");
expect(err.code).assertEqual(10200002)
expect(err.message).assertEqual("Syntax Error. Invalid Uri string");
} }
}) })
/** /**
* @tc.name: testUriConstruction009 * @tc.name: testUriConstruction009
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction009', 0, function () { it('testUriConstruction009', 0, function () {
try { try {
let that = new uri.URI('http://username:password@[::12:55:8080/directory/file?foo=1&bar=2#gaogaofaofao'); let that = new uri.URI('http://username:password@[::12:55:8080/directory/file?foo=1&bar=2#gaogaofaofao');
} catch (err) { } catch (err) {
expect(err.toString()).assertEqual("Error: IPv6 is missing a closing bracket"); expect(err.toString()).assertEqual("BusinessError: Syntax Error. Invalid Uri string");
expect(err.code).assertEqual(10200002)
expect(err.message).assertEqual("Syntax Error. Invalid Uri string");
} }
}) })
/** /**
* @tc.name: testUriConstruction010 * @tc.name: testUriConstruction010
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction010', 0, function () { it('testUriConstruction010', 0, function () {
try { try {
let that = new uri.URI('http://username:pa^ssword@[::12:55]:8080/directory/file?foo=1&bar=2#gaogaofaofao'); let that = new uri.URI('http://username:pa^ssword@[::12:55]:8080/directory/file?foo=1&bar=2#gaogaofaofao');
} catch (err) { } catch (err) {
expect(err.toString()).assertEqual("Error: userInfo does not conform to the rule"); expect(err.toString()).assertEqual("BusinessError: Syntax Error. Invalid Uri string");
expect(err.code).assertEqual(10200002)
expect(err.message).assertEqual("Syntax Error. Invalid Uri string");
} }
}) })
/** /**
* @tc.name: testUriConstruction011 * @tc.name: testUriConstruction011
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction011', 0, function () { it('testUriConstruction011', 0, function () {
try { try {
let that = new uri.URI('http://username:password@[::1你2:55]:8080/directory/file?foo=1&bar=2#gaogaofaofao'); let that = new uri.URI('http://username:password@[::1你2:55]:8080/directory/file?foo=1&bar=2#gaogaofaofao');
} catch (err) { } catch (err) {
expect(err.toString()).assertEqual("Error: ipv6 does not conform to the rule"); expect(err.toString()).assertEqual("BusinessError: Syntax Error. Invalid Uri string");
expect(err.code).assertEqual(10200002)
expect(err.message).assertEqual("Syntax Error. Invalid Uri string");
} }
}) })
/** /**
* @tc.name: testUriConstruction012 * @tc.name: testUriConstruction012
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction012', 0, function () { it('testUriConstruction012', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@www.baidu.com:99/path/path?query#fagment'); let gaogao = new uri.URI('http://gg:gaogao@www.baidu.com:99/path/path?query#fagment');
...@@ -182,7 +193,6 @@ describe('UriTest', function () { ...@@ -182,7 +193,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testUriConstruction013 * @tc.name: testUriConstruction013
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction013', 0, function () { it('testUriConstruction013', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[1080::8:800:200C:417A]:99/path/66path1?query#fagment'); let gaogao = new uri.URI('http://gg:gaogao@[1080::8:800:200C:417A]:99/path/66path1?query#fagment');
...@@ -200,7 +210,6 @@ describe('UriTest', function () { ...@@ -200,7 +210,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testUriConstruction014 * @tc.name: testUriConstruction014
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction014', 0, function () { it('testUriConstruction014', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[::]:88/path/path66?foooo#gaogao'); let gaogao = new uri.URI('http://gg:gaogao@[::]:88/path/path66?foooo#gaogao');
...@@ -218,7 +227,6 @@ describe('UriTest', function () { ...@@ -218,7 +227,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testUriConstruction015 * @tc.name: testUriConstruction015
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction015', 0, function () { it('testUriConstruction015', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path/66path1?query#fagment'); let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path/66path1?query#fagment');
...@@ -236,7 +244,6 @@ describe('UriTest', function () { ...@@ -236,7 +244,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testUriConstruction016 * @tc.name: testUriConstruction016
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction016', 0, function () { it('testUriConstruction016', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[::FFFF:129.144.52.38]:99/path/path?query#fagment'); let gaogao = new uri.URI('http://gg:gaogao@[::FFFF:129.144.52.38]:99/path/path?query#fagment');
...@@ -254,7 +261,6 @@ describe('UriTest', function () { ...@@ -254,7 +261,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testUriConstruction017 * @tc.name: testUriConstruction017
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction017', 0, function () { it('testUriConstruction017', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[::192.9.5.5]:99/path/path?query#fagment'); let gaogao = new uri.URI('http://gg:gaogao@[::192.9.5.5]:99/path/path?query#fagment');
...@@ -272,7 +278,6 @@ describe('UriTest', function () { ...@@ -272,7 +278,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testUriConstruction018 * @tc.name: testUriConstruction018
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction018', 0, function () { it('testUriConstruction018', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[22::22:2:2%ss]:99/path/path?query#fagment'); let gaogao = new uri.URI('http://gg:gaogao@[22::22:2:2%ss]:99/path/path?query#fagment');
...@@ -290,7 +295,6 @@ describe('UriTest', function () { ...@@ -290,7 +295,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testUriConstruction019 * @tc.name: testUriConstruction019
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction019', 0, function () { it('testUriConstruction019', 0, function () {
let gaogao = let gaogao =
...@@ -309,7 +313,6 @@ describe('UriTest', function () { ...@@ -309,7 +313,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testUriConstruction020 * @tc.name: testUriConstruction020
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction020', 0, function () { it('testUriConstruction020', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[fe80::0001:0000]:99/path/path?query#fagment'); let gaogao = new uri.URI('http://gg:gaogao@[fe80::0001:0000]:99/path/path?query#fagment');
...@@ -327,7 +330,6 @@ describe('UriTest', function () { ...@@ -327,7 +330,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testUriConstruction021 * @tc.name: testUriConstruction021
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction021', 0, function () { it('testUriConstruction021', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@199.98.55.44:99/path/path?query#fagment'); let gaogao = new uri.URI('http://gg:gaogao@199.98.55.44:99/path/path?query#fagment');
...@@ -345,7 +347,6 @@ describe('UriTest', function () { ...@@ -345,7 +347,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testUriConstruction022 * @tc.name: testUriConstruction022
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction022', 0, function () { it('testUriConstruction022', 0, function () {
let gaogao = new uri.URI('http://16.9.5.4:99/path/path?query#fagment'); let gaogao = new uri.URI('http://16.9.5.4:99/path/path?query#fagment');
...@@ -363,7 +364,6 @@ describe('UriTest', function () { ...@@ -363,7 +364,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testUriConstruction023 * @tc.name: testUriConstruction023
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction023', 0, function () { it('testUriConstruction023', 0, function () {
let gaogao = new uri.URI('http://49.99.54.12:50/path/path23?query#fagment'); let gaogao = new uri.URI('http://49.99.54.12:50/path/path23?query#fagment');
...@@ -381,7 +381,6 @@ describe('UriTest', function () { ...@@ -381,7 +381,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testUriConstruction024 * @tc.name: testUriConstruction024
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction024', 0, function () { it('testUriConstruction024', 0, function () {
let gaogao = new uri.URI('http://user@49.10pe8.54.12:80/path/path23?query#qwer'); let gaogao = new uri.URI('http://user@49.10pe8.54.12:80/path/path23?query#qwer');
...@@ -399,7 +398,6 @@ describe('UriTest', function () { ...@@ -399,7 +398,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testUriConstruction025 * @tc.name: testUriConstruction025
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction025', 0, function () { it('testUriConstruction025', 0, function () {
let gaogao = new uri.URI('http://user@www.baidu.com/path/path23?query#qwer'); let gaogao = new uri.URI('http://user@www.baidu.com/path/path23?query#qwer');
...@@ -417,7 +415,6 @@ describe('UriTest', function () { ...@@ -417,7 +415,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testUriConstruction026 * @tc.name: testUriConstruction026
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction026', 0, function () { it('testUriConstruction026', 0, function () {
let gaogao = new uri.URI('http://user@www.hw.com:77/path/path23?query#qwer'); let gaogao = new uri.URI('http://user@www.hw.com:77/path/path23?query#qwer');
...@@ -435,7 +432,6 @@ describe('UriTest', function () { ...@@ -435,7 +432,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testUriConstruction027 * @tc.name: testUriConstruction027
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction027', 0, function () { it('testUriConstruction027', 0, function () {
let gaogao = new uri.URI('ht2tp://user@www.h12343w.com:77/path/path23?query#qwer'); let gaogao = new uri.URI('ht2tp://user@www.h12343w.com:77/path/path23?query#qwer');
...@@ -453,7 +449,6 @@ describe('UriTest', function () { ...@@ -453,7 +449,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testUriConstruction028 * @tc.name: testUriConstruction028
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction028', 0, function () { it('testUriConstruction028', 0, function () {
let gaogao = new uri.URI('ht2tp://user@www.1hw.1com:77/path/path23?query#qwer'); let gaogao = new uri.URI('ht2tp://user@www.1hw.1com:77/path/path23?query#qwer');
...@@ -471,7 +466,6 @@ describe('UriTest', function () { ...@@ -471,7 +466,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testUriConstruction029 * @tc.name: testUriConstruction029
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction029', 0, function () { it('testUriConstruction029', 0, function () {
let gaogao = new uri.URI('http://user@hosthost/path/path23?query#qwer'); let gaogao = new uri.URI('http://user@hosthost/path/path23?query#qwer');
...@@ -489,7 +483,6 @@ describe('UriTest', function () { ...@@ -489,7 +483,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testUriConstruction030 * @tc.name: testUriConstruction030
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction030', 0, function () { it('testUriConstruction030', 0, function () {
let gaogao = new uri.URI('http://user@[::]/path/path23?query#qwer'); let gaogao = new uri.URI('http://user@[::]/path/path23?query#qwer');
...@@ -507,7 +500,6 @@ describe('UriTest', function () { ...@@ -507,7 +500,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testUriConstruction031 * @tc.name: testUriConstruction031
* @tc.desc: Constructs a URI by parsing the given string. * @tc.desc: Constructs a URI by parsing the given string.
* @tc.author: zhaoduwei
*/ */
it('testUriConstruction031', 0, function () { it('testUriConstruction031', 0, function () {
let gaogao = new uri.URI('http://[::192:0:5]/path/path23?query#qwer'); let gaogao = new uri.URI('http://[::192:0:5]/path/path23?query#qwer');
...@@ -525,7 +517,6 @@ describe('UriTest', function () { ...@@ -525,7 +517,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testEquals001 * @tc.name: testEquals001
* @tc.desc: Tests this URI for equality with another object. * @tc.desc: Tests this URI for equality with another object.
* @tc.author: zhaoduwei
*/ */
it('testEquals001', 0, function () { it('testEquals001', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment'); let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment');
...@@ -537,7 +528,6 @@ describe('UriTest', function () { ...@@ -537,7 +528,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testEquals002 * @tc.name: testEquals002
* @tc.desc: Tests this URI for equality with another object. * @tc.desc: Tests this URI for equality with another object.
* @tc.author: zhaoduwei
*/ */
it('testEquals002', 0, function () { it('testEquals002', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment'); let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment');
...@@ -549,7 +539,6 @@ describe('UriTest', function () { ...@@ -549,7 +539,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testEquals003 * @tc.name: testEquals003
* @tc.desc: Tests this URI for equality with another object. * @tc.desc: Tests this URI for equality with another object.
* @tc.author: zhaoduwei
*/ */
it('testEquals003', 0, function () { it('testEquals003', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment'); let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment');
...@@ -561,7 +550,6 @@ describe('UriTest', function () { ...@@ -561,7 +550,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testEquals004 * @tc.name: testEquals004
* @tc.desc: Tests this URI for equality with another object. * @tc.desc: Tests this URI for equality with another object.
* @tc.author: zhaoduwei
*/ */
it('testEquals004', 0, function () { it('testEquals004', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@wwwaaa:99/path1?query#fagment'); let gaogao = new uri.URI('http://gg:gaogao@wwwaaa:99/path1?query#fagment');
...@@ -573,7 +561,6 @@ describe('UriTest', function () { ...@@ -573,7 +561,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testEquals005 * @tc.name: testEquals005
* @tc.desc: Tests this URI for equality with another object. * @tc.desc: Tests this URI for equality with another object.
* @tc.author: zhaoduwei
*/ */
it('testEquals005', 0, function () { it('testEquals005', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment'); let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment');
...@@ -582,10 +569,97 @@ describe('UriTest', function () { ...@@ -582,10 +569,97 @@ describe('UriTest', function () {
expect(res).assertEqual(false); expect(res).assertEqual(false);
}) })
/**
* @tc.name: testEqualsTo001
* @tc.desc: Tests this URI for equality with another object.
*/
it('testEqualsTo001', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment');
let gaogao1 = gaogao;
let res = gaogao.equalsTo(gaogao1);
expect(res).assertEqual(true);
})
/**
* @tc.name: testEqualsTo002
* @tc.desc: Tests this URI for equality with another object.
*/
it('testEqualsTo002', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment');
let gaogao1 = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment');
let res = gaogao.equalsTo(gaogao1);
expect(res).assertEqual(true);
})
/**
* @tc.name: testEqualsTo003
* @tc.desc: Tests this URI for equality with another object.
*/
it('testEqualsTo003', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment');
let gaogao1 = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment123');
let res = gaogao.equalsTo(gaogao1);
expect(res).assertEqual(false);
})
/**
* @tc.name: testEqualsTo004
* @tc.desc: Tests this URI for equality with another object.
*/
it('testEqualsTo004', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@wwwaaa:99/path1?query#fagment');
let gaogao1 = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment123');
let res = gaogao.equalsTo(gaogao1);
expect(res).assertEqual(false);
})
/**
* @tc.name: testEqualsTo005
* @tc.desc: Tests this URI for equality with another object.
*/
it('testEqualsTo005', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment');
let gaogao1 = new uri.URI('http://[1:0:0:1:2:1:2:1]/path1?query#fagment123');
let res = gaogao.equalsTo(gaogao1);
expect(res).assertEqual(false);
})
/**
* @tc.name: testEqualsTo006
* @tc.desc: Tests for wrong input parameter type.
*/
it('testEqualsTo006', 0, function () {
try {
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment');
var gaogao1 = 666;
let err = gaogao.equalsTo(gaogao1);
} catch (err) {
expect(err.toString()).assertEqual(`BusinessError: Parameter error.The type of ${gaogao1} must be URI`);
expect(err.code).assertEqual(401)
expect(err.message).assertEqual(`Parameter error.The type of ${gaogao1} must be URI`);
}
})
/**
* @tc.name: testEqualsTo007
* @tc.desc: Tests for wrong input parameter type.
*/
it('testEqualsTo007', 0, function () {
try {
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment');
var gaogao1 = {"0" : "1"};
let err = gaogao.equalsTo(gaogao1);
} catch (err) {
expect(err.toString()).assertEqual(`BusinessError: Parameter error.The type of ${gaogao1} must be URI`);
expect(err.code).assertEqual(401)
expect(err.message).assertEqual(`Parameter error.The type of ${gaogao1} must be URI`);
}
})
/** /**
* @tc.name: testNormalize001 * @tc.name: testNormalize001
* @tc.desc: Normalizes this URI's path. * @tc.desc: Normalizes this URI's path.
* @tc.author: zhaoduwei
*/ */
it('testNormalize001', 0, function () { it('testNormalize001', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path/66./../././mm/.././path1?query#fagment'); let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path/66./../././mm/.././path1?query#fagment');
...@@ -597,7 +671,6 @@ describe('UriTest', function () { ...@@ -597,7 +671,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testNormalize002 * @tc.name: testNormalize002
* @tc.desc: Normalizes this URI's path. * @tc.desc: Normalizes this URI's path.
* @tc.author: zhaoduwei
*/ */
it('testNormalize002', 0, function () { it('testNormalize002', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path?query#fagment'); let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path?query#fagment');
...@@ -609,7 +682,6 @@ describe('UriTest', function () { ...@@ -609,7 +682,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testNormalize003 * @tc.name: testNormalize003
* @tc.desc: Normalizes this URI's path. * @tc.desc: Normalizes this URI's path.
* @tc.author: zhaoduwei
*/ */
it('testNormalize003', 0, function () { it('testNormalize003', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path/.././../aa/bb/cc?query#fagment'); let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path/.././../aa/bb/cc?query#fagment');
...@@ -621,7 +693,6 @@ describe('UriTest', function () { ...@@ -621,7 +693,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testNormalize004 * @tc.name: testNormalize004
* @tc.desc: Normalizes this URI's path. * @tc.desc: Normalizes this URI's path.
* @tc.author: zhaoduwei
*/ */
it('testNormalize004', 0, function () { it('testNormalize004', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../path/.././../aa/bb/cc?query'); let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../path/.././../aa/bb/cc?query');
...@@ -633,7 +704,6 @@ describe('UriTest', function () { ...@@ -633,7 +704,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testNormalize005 * @tc.name: testNormalize005
* @tc.desc: Normalizes this URI's path. * @tc.desc: Normalizes this URI's path.
* @tc.author: zhaoduwei
*/ */
it('testNormalize005', 0, function () { it('testNormalize005', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/./path/./aa/bb/cc?query#fagment'); let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/./path/./aa/bb/cc?query#fagment');
...@@ -645,7 +715,6 @@ describe('UriTest', function () { ...@@ -645,7 +715,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testToString001 * @tc.name: testToString001
* @tc.desc: Returns the content of this URI as a US-ASCII string. * @tc.desc: Returns the content of this URI as a US-ASCII string.
* @tc.author: zhaoduwei
*/ */
it('testToString001', 0, function () { it('testToString001', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path/.././../aa/bb/cc?query#fagment'); let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path/.././../aa/bb/cc?query#fagment');
...@@ -656,7 +725,6 @@ describe('UriTest', function () { ...@@ -656,7 +725,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testToString002 * @tc.name: testToString002
* @tc.desc: Returns the content of this URI as a US-ASCII string. * @tc.desc: Returns the content of this URI as a US-ASCII string.
* @tc.author: zhaoduwei
*/ */
it('testToString002', 0, function () { it('testToString002', 0, function () {
let gaogao = new uri.URI('htt1p://gg:gaogao@[::192.9.5.5]:99/path/66path1?query#fagment'); let gaogao = new uri.URI('htt1p://gg:gaogao@[::192.9.5.5]:99/path/66path1?query#fagment');
...@@ -667,7 +735,6 @@ describe('UriTest', function () { ...@@ -667,7 +735,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testToString003 * @tc.name: testToString003
* @tc.desc: Returns the content of this URI as a US-ASCII string. * @tc.desc: Returns the content of this URI as a US-ASCII string.
* @tc.author: zhaoduwei
*/ */
it('testToString003', 0, function () { it('testToString003', 0, function () {
let gaogao = new uri.URI('ftp://username:password@www.baidu.com:88/path?query#fagment'); let gaogao = new uri.URI('ftp://username:password@www.baidu.com:88/path?query#fagment');
...@@ -678,7 +745,6 @@ describe('UriTest', function () { ...@@ -678,7 +745,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testToString004 * @tc.name: testToString004
* @tc.desc: Returns the content of this URI as a US-ASCII string. * @tc.desc: Returns the content of this URI as a US-ASCII string.
* @tc.author: zhaoduwei
*/ */
it('testToString004', 0, function () { it('testToString004', 0, function () {
let gaogao = new uri.URI('http://gg:gao你好gao@199.98.55.44:99/path/p你好ath?qu你好ery#fag你好ment'); let gaogao = new uri.URI('http://gg:gao你好gao@199.98.55.44:99/path/p你好ath?qu你好ery#fag你好ment');
...@@ -690,7 +756,6 @@ describe('UriTest', function () { ...@@ -690,7 +756,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testToString005 * @tc.name: testToString005
* @tc.desc: Returns the content of this URI as a US-ASCII string. * @tc.desc: Returns the content of this URI as a US-ASCII string.
* @tc.author: zhaoduwei
*/ */
it('testToString005', 0, function () { it('testToString005', 0, function () {
let gaogao = new uri.URI('http://gg:gaogao@199.98.55.44:99/path/path?query#fagment'); let gaogao = new uri.URI('http://gg:gaogao@199.98.55.44:99/path/path?query#fagment');
...@@ -701,7 +766,6 @@ describe('UriTest', function () { ...@@ -701,7 +766,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testCheckIsAbsolute001 * @tc.name: testCheckIsAbsolute001
* @tc.desc: Tells whether or not this URI is absolute. * @tc.desc: Tells whether or not this URI is absolute.
* @tc.author: zhaoduwei
*/ */
it('testCheckIsAbsolute001', 0, function () { it('testCheckIsAbsolute001', 0, function () {
let gaogao = new uri.URI('f/tp://username:password@www.baidu.com:88/path?query#fagment'); let gaogao = new uri.URI('f/tp://username:password@www.baidu.com:88/path?query#fagment');
...@@ -712,7 +776,6 @@ describe('UriTest', function () { ...@@ -712,7 +776,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testCheckIsAbsolute002 * @tc.name: testCheckIsAbsolute002
* @tc.desc: Tells whether or not this URI is absolute. * @tc.desc: Tells whether or not this URI is absolute.
* @tc.author: zhaoduwei
*/ */
it('testCheckIsAbsolute002', 0, function () { it('testCheckIsAbsolute002', 0, function () {
let gaogao = new uri.URI('ftp://username:password@www.baidu.com:88/path?query#fagment'); let gaogao = new uri.URI('ftp://username:password@www.baidu.com:88/path?query#fagment');
...@@ -723,7 +786,6 @@ describe('UriTest', function () { ...@@ -723,7 +786,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testCheckIsAbsolute003 * @tc.name: testCheckIsAbsolute003
* @tc.desc: Tells whether or not this URI is absolute. * @tc.desc: Tells whether or not this URI is absolute.
* @tc.author: zhaoduwei
*/ */
it('testCheckIsAbsolute003', 0, function () { it('testCheckIsAbsolute003', 0, function () {
let gaogao = new uri.URI('htt/p://username:password@www.baidu.com:88/path?query#fagment'); let gaogao = new uri.URI('htt/p://username:password@www.baidu.com:88/path?query#fagment');
...@@ -734,7 +796,6 @@ describe('UriTest', function () { ...@@ -734,7 +796,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testCheckIsAbsolute004 * @tc.name: testCheckIsAbsolute004
* @tc.desc: Tells whether or not this URI is absolute. * @tc.desc: Tells whether or not this URI is absolute.
* @tc.author: zhaoduwei
*/ */
it('testCheckIsAbsolute004', 0, function () { it('testCheckIsAbsolute004', 0, function () {
let gaogao = new uri.URI('https://username:password@www.baidu.com:88/path?query#fagment'); let gaogao = new uri.URI('https://username:password@www.baidu.com:88/path?query#fagment');
...@@ -745,7 +806,6 @@ describe('UriTest', function () { ...@@ -745,7 +806,6 @@ describe('UriTest', function () {
/** /**
* @tc.name: testCheckIsAbsolute005 * @tc.name: testCheckIsAbsolute005
* @tc.desc: Tells whether or not this URI is absolute. * @tc.desc: Tells whether or not this URI is absolute.
* @tc.author: zhaoduwei
*/ */
it('testCheckIsAbsolute005', 0, function () { it('testCheckIsAbsolute005', 0, function () {
let gaogao = new uri.URI('http1://username:password@www.baidu.com:88/path?query#fagment'); let gaogao = new uri.URI('http1://username:password@www.baidu.com:88/path?query#fagment');
......
...@@ -17,10 +17,1162 @@ import Url from '@ohos.url' ...@@ -17,10 +17,1162 @@ import Url from '@ohos.url'
export default function UrlFunTest() { export default function UrlFunTest() {
describe('UrlFunTest', function () { describe('UrlFunTest', function () {
/**
* @tc.name: testParamsAppend001
* @tc.desc: Appends a specified key/value pair as a new search parameter.
*/
it('testParamsAppend001', 0, function () {
var that = new Url.URL('http://username:password@host:8080/directory/file?foo=1&bar=2');
var params = new Url.URLParams(that.search);
params.append('ma','jk')
var result = params.toString()
expect(result).assertEqual('foo=1&bar=2&ma=jk')
})
/**
* @tc.name: testParamsAppend002
* @tc.desc: Appends a specified key/value pair as a new search parameter.
*/
it('testParamsAppend002', 0, function () {
var that = new Url.URL('http://username:password@host:8080/directory/file?foo=1&bar=2');
var params = new Url.URLParams(that.search);
params.append("ma 大","jk¥")
var result = params.toString()
expect(result).assertEqual("foo=1&bar=2&ma+%E5%A4%A7=jk%EF%BF%A5")
})
/**
* @tc.name: testParamsAppend003
* @tc.desc: Appends a specified key/value pair as a new search parameter.
*/
it('testParamsAppend003', 0, function () {
var that = new Url.URL('http://username:password@host:8080/directory/file?foo=1&bar=2');
var params = new Url.URLParams(that.search);
params.append("foo~!@#$%^&*()_+-=","jk")
var result = params.toString()
expect(result).assertEqual("foo=1&bar=2&foo%7E%21%40%23%24%25%5E%26*%28%29_%2B-%3D=jk")
})
/**
* @tc.name: testParamsAppend004
* @tc.desc: Appends a specified key/value pair as a new search parameter.
*/
it('testParamsAppend004', 0, function () {
let that = new Url.URL('https://example.com?foo=1&bar=2')
let params = new Url.URLParams(that.search)
params.append("app","par")
var result = params.toString()
expect(result).assertEqual("foo=1&bar=2&app=par")
})
/**
* @tc.name: testParamsAppend005
* @tc.desc: Appends a specified key/value pair as a new search parameter.
*/
it('testParamsAppend005', 0, function () {
let that = new Url.URL('https://example.com?foo=1&bar=2')
let params = new Url.URLParams(that.search)
params.append("123","456")
var result = params.toString()
expect(result).assertEqual("foo=1&bar=2&123=456")
})
/**
* @tc.name: testParamsAppend006
* @tc.desc: Appends throw BusinessError: Parameter error.
*/
it('testParamsAppend006', 0, function () {
try {
let that = new Url.URL('https://example.com?foo=1&bar=2')
let params = new Url.URLParams(that.search)
params.append(123,"456")
expect(0).assertEqual(1)
} catch (err) {
expect(err.toString()).assertEqual(`BusinessError: Parameter error.The type of 123 must be string`)
expect(err.code).assertEqual(401)
expect(err.message).assertEqual("Parameter error.The type of 123 must be string");
}
})
/**
* @tc.name: testParamsAppend007
* @tc.desc: Appends throw BusinessError: Parameter error.
*/
it('testParamsAppend007', 0, function () {
try {
let that = new Url.URL('https://example.com?foo=1&bar=2')
let params = new Url.URLParams(that.search)
var a = '123'
var b = undefined;
params.append(a, b)
expect(0).assertEqual(1)
} catch (err) {
expect(err.toString()).assertEqual(`BusinessError: Parameter error.The type of ${b} must be string`)
expect(err.code).assertEqual(401)
expect(err.message).assertEqual(`Parameter error.The type of ${b} must be string`);
}
})
/**
* @tc.name: testParamsDelete001
* @tc.desc: Deletes the given search parameter and its associated value,from the list of all search parameters.
*/
it('testParamsDelete001', 0, function () {
let that = new Url.URL('https://example.com?foo=1&bar=2')
let params = new Url.URLParams(that.search)
params.delete("foo")
var result = params.toString()
expect(result).assertEqual("bar=2")
})
/**
* @tc.name: testParamsDelete002
* @tc.desc: Deletes the given search parameter and its associated value,from the list of all search parameters.
*/
it('testParamsDelete002', 0, function () {
let that = new Url.URL('https://example.com?foo大=1&bar=2');
let params = new Url.URLParams(that.search);
params.delete('foo');
var result = params.toString();
expect(result).assertEqual("foo%E5%A4%A7=1&bar=2");
})
/**
* @tc.name: testParamsDelete003
* @tc.desc: Deletes the given search parameter and its associated value,from the list of all search parameters.
*/
it('testParamsDelete003', 0, function () {
let that = new Url.URL('https://example.com?foo大=1&bar=2');
let params = new Url.URLParams(that.search);
params.delete("foo大");
var result = params.toString();
expect(result).assertEqual("bar=2")
})
/**
* @tc.name: testParamsDelete004
* @tc.desc: Deletes the given search parameter and its associated value,from the list of all search parameters.
*/
it('testParamsDelete004', 0, function () {
let that = new Url.URL('https://example.com?foo=1&bar=2');
let params = new Url.URLParams(that.search);
params.delete('bar');
var result = params.toString();
expect(result).assertEqual("foo=1");
})
/**
* @tc.name: testParamsDelete005
* @tc.desc: Deletes the given search parameter and its associated value,from the list of all search parameters.
*/
it('testParamsDelete005', 0, function () {
let that = new Url.URL('https://example.com?foo=1&bar=2');
let params = new Url.URLParams(that.search);
params.delete("faa");
var result = params.toString();
expect(result).assertEqual("foo=1&bar=2")
})
/**
* @tc.name: testParamsDelete006
* @tc.desc: Deletes throw BusinessError: Parameter error.
*/
it('testParamsDelete006', 0, function () {
try {
let that = new Url.URL('https://example.com?foo=1&bar=2');
let params = new Url.URLParams(that.search);
params.delete();
expect(0).assertEqual(1)
} catch (err) {
expect(err.toString()).assertEqual(`BusinessError: Parameter error.The type of ${arguments[0]} must be string`)
expect(err.code).assertEqual(401)
expect(err.message).assertEqual(`Parameter error.The type of ${arguments[0]} must be string`);
}
})
/**
* @tc.name: testParamsDelete007
* @tc.desc: Deletes throw BusinessError: Parameter error.
*/
it('testParamsDelete007', 0, function () {
try {
let that = new Url.URL('https://example.com?foo=1&bar=2');
let params = new Url.URLParams(that.search);
params.delete(4);
expect(0).assertEqual(1)
} catch (err) {
expect(err.toString()).assertEqual(`BusinessError: Parameter error.The type of 4 must be string`)
expect(err.code).assertEqual(401)
expect(err.message).assertEqual(`Parameter error.The type of 4 must be string`);
}
})
/**
* @tc.name: testParamsEntries001
* @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array.
*/
it('testParamsEntries001', 0, function () {
let params = new Url.URLParams("key1=value1&key2=value2");
var i=0;
var arr={};
for(var pair of params.entries()) {
arr[i]=pair[0];
i++;
arr[i]=pair[1];
i++;
}
expect(arr[1]).assertEqual("value1");
})
/**
* @tc.name: testParamsEntries002
* @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array.
*/
it('testParamsEntries002', 0, function () {
let params = new Url.URLParams("key1=value1&key2=value2")
var i=0;
var arr={};
for(var pair of params.entries()) {
arr[i]=pair[0];
i++;
arr[i]=pair[1];
i++;
}
expect(arr[2]).assertEqual("key2")
})
/**
* @tc.name: testParamsEntries003
* @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array.
*/
it('testParamsEntries003', 0, function () {
let params = new Url.URLParams("key1=value1&key2=value2")
params.append("foo","jk")
var i=0;
var arr={};
for(var pair of params.entries()) {
arr[i]=pair[0];
i++;
arr[i]=pair[1];
i++;
}
expect(arr[5]).assertEqual("jk")
})
/**
* @tc.name: testParamsEntries004
* @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array.
*/
it('testParamsEntries004', 0, function () {
let params = new Url.URLParams("key1=value1&key2=value2")
var i=0;
var arr={};
for(var pair of params.entries()) {
arr[i]=pair[0];
i++;
arr[i]=pair[1];
i++;
}
expect(arr[3]).assertEqual("value2")
})
/**
* @tc.name: testParamsEntries005
* @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array.
*/
it('testParamsEntries005', 0, function () {
let params = new Url.URLParams("key1=value1&key2=value2")
params.append("jss","txt")
var i=0;
var arr={};
for(var pair of params.entries()) {
arr[i]=pair[0];
i++;
arr[i]=pair[1];
i++;
}
expect(arr[4]).assertEqual("jss")
})
/**
* @tc.name: testParams[Symbol.iterator]001
* @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array.
*/
it('testParams[Symbol.iterator]001', 0, function () {
let params = new Url.URLParams("key1=value1&key2=value2");
var i=0;
var arr={};
for(var pair of params[Symbol.iterator]()) {
arr[i]=pair[0];
i++;
arr[i]=pair[1];
i++;
}
expect(arr[1]).assertEqual("value1");
})
/**
* @tc.name: testParams[Symbol.iterator]002
* @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array.
*/
it('testParams[Symbol.iterator]002', 0, function () {
let params = new Url.URLParams("key1=value1&key2=value2")
var i=0;
var arr={};
for(var pair of params[Symbol.iterator]()) {
arr[i]=pair[0];
i++;
arr[i]=pair[1];
i++;
}
expect(arr[2]).assertEqual("key2")
})
/**
* @tc.name: testParams[Symbol.iterator]003
* @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array.
*/
it('testParams[Symbol.iterator]003', 0, function () {
let params = new Url.URLParams("key1=value1&key2=value2")
params.append("foo","jk")
var i=0;
var arr={};
for(var pair of params[Symbol.iterator]()) {
arr[i]=pair[0];
i++;
arr[i]=pair[1];
i++;
}
expect(arr[5]).assertEqual("jk")
})
/**
* @tc.name: testParams[Symbol.iterator]004
* @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array.
*/
it('testParams[Symbol.iterator]004', 0, function () {
let params = new Url.URLParams("key1=value1&key2=value2")
var i=0;
var arr={};
for(var pair of params[Symbol.iterator]()) {
arr[i]=pair[0];
i++;
arr[i]=pair[1];
i++;
}
expect(arr[3]).assertEqual("value2")
})
/**
* @tc.name: testParams[Symbol.iterator]005
* @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array.
*/
it('testParams[Symbol.iterator]005', 0, function () {
let params = new Url.URLParams("key1=value1&key2=value2")
params.append("jss","txt")
var i=0;
var arr={};
for(var pair of params[Symbol.iterator]()) {
arr[i]=pair[0];
i++;
arr[i]=pair[1];
i++;
}
expect(arr[4]).assertEqual("jss")
})
/**
* @tc.name: testParamsForEach001
* @tc.desc: Callback functions are used to traverse key-value pairs on the URLSearchParams instance object.
*/
it('testParamsForEach001', 0, function () {
let params = new Url.URLParams("key1=value1&key2=value2")
var arr={};
var i = 0;
function func(value, key, SearchParams)
{
arr[i] = value + " " + key + " " + (params === SearchParams)
i++
}
params.forEach(func);
expect(arr[0]).assertEqual("value1 key1 true");
})
/**
* @tc.name: testParamsForEach002
* @tc.desc: Callback functions are used to traverse key-value pairs on the URLSearchParams instance object.
*/
it('testParamsForEach002', 0, function () {
let params = new Url.URLParams("key1=value1&key2=value2");
var arr={};
var i = 0;
function func(value, key, SearchParams)
{
arr[i] = value + " " + key + " " + (params === SearchParams)
i++
}
params.forEach(func);
expect(arr[1]).assertEqual("value2 key2 true");
})
/**
* @tc.name: testParamsForEach003
* @tc.desc: Callback functions are used to traverse key-value pairs on the URLSearchParams instance object.
*/
it('testParamsForEach003', 0, function () {
let params = new Url.URLParams("key1=value1&key2=value2");
params.append("foo","jk");
var arr={};
var i = 0;
function func(value, key, SearchParams)
{
arr[i] = value + " " + key + " " + (params === SearchParams)
i++
}
params.forEach(func);
expect(arr[2]).assertEqual("jk foo true");
})
/**
* @tc.name: testParamsForEach004
* @tc.desc: Callback functions are used to traverse key-value pairs on the URLSearchParams instance object.
*/
it('testParamsForEach004', 0, function () {
let params = new Url.URLParams("foo=bar&jss=txt");
var arr={};
var i = 0;
function func(value, key, SearchParams)
{
arr[i] = value + " " + key + " " + (params === SearchParams)
i++
}
params.forEach(func);
expect(arr[1]).assertEqual("txt jss true");
})
/**
* @tc.name: testParamsForEach005
* @tc.desc: Callback functions are used to traverse key-value pairs on the URLSearchParams instance object.
*/
it('testParamsForEach005', 0, function () {
let params = new Url.URLParams("foo=bar&jss=txt");
params.append("foo","jk");
var arr={};
var i = 0;
function func(value, key, SearchParams)
{
arr[i] = value + " " + key + " " + (params === SearchParams)
i++
}
params.forEach(func);
expect(arr[0]).assertEqual("bar foo true");
})
/**
* @tc.name: testParamsForEach006
* @tc.desc: forEach throw BusinessError: Parameter error.
*/
it('testParamsForEach006', 0, function () {
try {
let params = new Url.URLParams("foo=bar&jss=txt");
var arr={};
var i = 0;
var func = [0, 2, 4, 6, 8];
params.forEach(func);
expect(0).assertEqual(1)
} catch(err) {
expect(err.toString()).assertEqual(`BusinessError: Parameter error.The type of ${func} must be function`)
expect(err.code).assertEqual(401)
expect(err.message).assertEqual(`Parameter error.The type of ${func} must be function`);
}
})
/**
* @tc.name: testParamsGet001
* @tc.desc: Returns the first value associated to the given search parameter.
*/
it('testParamsGet001', 0, function () {
let params = new Url.URLParams("key1=value1&key2=value2")
var result = params.get("1")
expect(result).assertEqual(undefined)
})
/**
* @tc.name: testParamsGet002
* @tc.desc: Returns the first value associated to the given search parameter.
*/
it('testParamsGet002', 0, function () {
let params = new Url.URLParams("key1=value1&key2=value2")
var result = params.get("key2")
expect(result).assertEqual("value2")
})
/**
* @tc.name: testParamsGet003
* @tc.desc: Returns the first value associated to the given search parameter.
*/
it('testParamsGet003', 0, function () {
let params = new Url.URLParams("key1=value1&key2=value2")
params.append("5","JKL")
var result = params.get("5")
expect(result).assertEqual("JKL")
})
/**
* @tc.name: testParamsGet004
* @tc.desc: Returns the first value associated to the given search parameter.
*/
it('testParamsGet004', 0, function () {
let params = new Url.URLParams("key1=value1&key2=value2")
var result = params.get("key1")
expect(result).assertEqual("value1")
})
/**
* @tc.name: testParamsGet005
* @tc.desc: Returns the first value associated to the given search parameter.
*/
it('testParamsGet005', 0, function () {
let params = new Url.URLParams("key1=value1&key2=value2")
params.append("jss","JL")
var result = params.get("jss")
expect(result).assertEqual("JL")
})
/**
* @tc.name: testParamsGet006
* @tc.desc: get throw BusinessError: Parameter error.
*/
it('testParamsGet005', 0, function () {
try{
let params = new Url.URLParams("key1=value1&key2=value2")
params.append("jss","JL")
var a = 666;
var result = params.get(a)
expect(0).assertEqual(1)
}catch(err){
expect(err.toString()).assertEqual(`BusinessError: Parameter error.The type of ${a} must be string`)
expect(err.code).assertEqual(401)
expect(err.message).assertEqual(`Parameter error.The type of ${a} must be string`);
}
})
/**
* @tc.name: testParamsGetAll001
* @tc.desc: Returns all key-value pairs associated with a given search parameter as an array.
*/
it('testParamsGetAll001', 0, function () {
let params = new Url.URLParams("key1=value1&key2=value2")
params.append("key1","AAA")
var result = params.getAll("key1")
expect(result.toString()).assertEqual("value1,AAA")
})
/**
* @tc.name: testParamsGetAll002
* @tc.desc: Returns all key-value pairs associated with a given search parameter as an array.
*/
it('testParamsGetAll002', 0, function () {
let params = new Url.URLParams("key1=value1&8=DEF")
params.append("8","A8A")
var result = params.getAll("8")
expect(result.toString()).assertEqual("DEF,A8A")
})
/**
* @tc.name: testParamsGetAll003
* @tc.desc: Returns all key-value pairs associated with a given search parameter as an array.
*/
it('testParamsGetAll003', 0, function () {
let params = new Url.URLParams("key1=value1&key2=value2&key3=da")
params.append("key3","A3A")
var result = params.getAll("key3")
expect(result.toString()).assertEqual("da,A3A")
})
/**
* @tc.name: testParamsGetAll004
* @tc.desc: Returns all key-value pairs associated with a given search parameter as an array.
*/
it('testParamsGetAll004', 0, function () {
let params = new Url.URLParams("key1=value1&key2=value2&key3=大")
params.append("key3","A3A")
var result = params.getAll("key4")
expect(result.toString()).assertEqual('')
})
/**
* @tc.name: testParamsGetAll005
* @tc.desc: Returns all key-value pairs associated with a given search parameter as an array.
*/
it('testParamsGetAll005', 0, function () {
let params = new Url.URLParams("key1=value1&key2=value2&key3=大")
params.append("key3","A3A")
var result = params.getAll("key2")
expect(result.toString()).assertEqual("value2")
})
/**
* @tc.name: testParamsGetAll006
* @tc.desc: getAll throw BusinessError: Parameter error.
*/
it('testParamsGetAll006', 0, function () {
try {
let params = new Url.URLParams("key1=value1&key2=value2&key3=大")
params.append("key3","A3A")
var b = 666;
var result = params.getAll(b)
expect(0).assertEqual(1)
} catch(err) {
expect(err.toString()).assertEqual(`BusinessError: Parameter error.The type of ${b} must be string`)
expect(err.code).assertEqual(401)
expect(err.message).assertEqual(`Parameter error.The type of ${b} must be string`);
}
})
/**
* @tc.name: testParamsHas001
* @tc.desc: Returns a Boolean that indicates whether a parameter with the specified name exists.
*/
it('testParamsHas001', 0, function () {
let params = new Url.URLParams("key1=value1&key2=value2&key3=大")
var result = params.has("2")
expect(result).assertEqual(false)
})
/**
* @tc.name: testParamsHas002
* @tc.desc: Returns a Boolean that indicates whether a parameter with the specified name exists.
*/
it('testParamsHas002', 0, function () {
let params = new Url.URLParams("小=value1&key2=value2&key3=大")
var result = params.has("")
expect(result).assertEqual(true)
})
/**
* @tc.name: testParamsHas003
* @tc.desc: Returns a Boolean that indicates whether a parameter with the specified name exists.
*/
it('testParamsHas003', 0, function () {
let params = new Url.URLParams("小=value1&¥=value2&key3=大")
params.append("","ACA")
var result = params.has("")
expect(result).assertEqual(true)
})
/**
* @tc.name: testParamsHas004
* @tc.desc: Returns a Boolean that indicates whether a parameter with the specified name exists.
*/
it('testParamsHas004', 0, function () {
let params = new Url.URLParams("小=value1&key2=value2&key3=大")
var result = params.has("")
expect(result).assertEqual(false)
})
/**
* @tc.name: testParamsHas005
* @tc.desc: Returns a Boolean that indicates whether a parameter with the specified name exists.
*/
it('testParamsHas005', 0, function () {
let params = new Url.URLParams("小=value1&¥=value2&key3=大")
params.append("","ACA")
var result = params.has("¥11")
expect(result).assertEqual(false)
})
/**
* @tc.name: testParamsKeys001
* @tc.desc: Returns an iterator allowing to go through all keys contained in this object.
*/
it('testParamsKeys001', 0, function () {
let params = new Url.URLParams("小=value1&¥=value2&key3=大");
var arr={};
var i = 0;
for(var key of params.keys()) {
arr[i] = key
i++
}
expect(arr[0]).assertEqual("");
})
/**
* @tc.name: testParamsKeys002
* @tc.desc: Returns an iterator allowing to go through all keys contained in this object.
*/
it('testParamsKeys002', 0, function () {
let params = new Url.URLParams("小=value1&¥=value2&key3=大");
var arr={};
var i = 0;
for(var key of params.keys()) {
arr[i] = key
i++
}
expect(arr[1]).assertEqual("");
})
/**
* @tc.name: testParamsKeys003
* @tc.desc: Returns an iterator allowing to go through all keys contained in this object.
*/
it('testParamsKeys003', 0, function () {
let params = new Url.URLParams("小=value1&¥=value2&key3=大");
var arr={};
var i = 0;
for(var key of params.keys()) {
arr[i] = key
i++
}
expect(arr[2]).assertEqual("key3");
})
/**
* @tc.name: testParamsKeys001
* @tc.desc: Returns an iterator allowing to go through all keys contained in this object.
*/
it('testParamsKeys004', 0, function () {
let params = new Url.URLParams("小=value1&¥=value2&key3=大&key4=六");
var arr={};
var i = 0;
for(var key of params.keys()) {
arr[i] = key
i++
}
expect(arr[3]).assertEqual("key4");
})
/**
* @tc.name: testParamsKeys005
* @tc.desc: Returns an iterator allowing to go through all keys contained in this object.
*/
it('testParamsKeys005', 0, function () {
let params = new Url.URLParams("小=value1&¥=value2&key3=大&key4=六&key5=发");
var arr={};
var i = 0;
for(var key of params.keys()) {
arr[i] = key
i++
}
expect(arr[4]).assertEqual("key5");
})
/**
* @tc.name: testParamsSet001
* @tc.desc: Sets the value associated with a given search parameter to the given value.
* If there were several matching values, this method deletes the others.
* If the search parameter doesn't exist, this method creates it.
*/
it('testParamsSet001', 0, function () {
let params = new Url.URLParams("1=value1&2=value2&key3=3");
// params.append("11","ACA");
params.set("11","CCC");
var res = params.toString();
expect(res).assertEqual("1=value1&2=value2&key3=3&11=CCC");
})
/**
* @tc.name: testParamsSet002
* @tc.desc: Sets the value associated with a given search parameter to the given value.
* If there were several matching values, this method deletes the others.
* If the search parameter doesn't exist, this method creates it.
*/
it('testParamsSet002', 0, function () {
let params = new Url.URLParams("1=value1&2=value2&key3=3");
params.set('10','BBB');
var res = params.toString();
expect(res).assertEqual("1=value1&2=value2&key3=3&10=BBB");
})
/**
* @tc.name: testParamsSet003
* @tc.desc: Sets the value associated with a given search parameter to the given value.
* If there were several matching values, this method deletes the others.
* If the search parameter doesn't exist, this method creates it.
*/
it('testParamsSet003', 0, function () {
let params = new Url.URLParams("1=value1&2=value2&key3=3");
params.set("ma 大" ,"10¥");
var res = params.toString();
expect(res).assertEqual("1=value1&2=value2&key3=3&ma+%E5%A4%A7=10%EF%BF%A5");
})
/**
* @tc.name: testParamsSet004
* @tc.desc: Sets the value associated with a given search parameter to the given value.
* If there were several matching values, this method deletes the others.
* If the search parameter doesn't exist, this method creates it.
*/
it('testParamsSet004', 0, function () {
let params = new Url.URLParams("1=value1&2=value2&key3=3");
// params.append("1","ACA");
params.set("1","CCC");
var res = params.toString();
expect(res).assertEqual("1=CCC&2=value2&key3=3");
})
/**
* @tc.name: testParamsSet005
* @tc.desc: Sets the value associated with a given search parameter to the given value.
* If there were several matching values, this method deletes the others.
* If the search parameter doesn't exist, this method creates it.
*/
it('testParamsSet005', 0, function () {
let params = new Url.URLParams("1=value1&2=value2&key3=3");
params.set('12','BBB');
var res = params.toString();
expect(res).assertEqual("1=value1&2=value2&key3=3&12=BBB");
})
/**
* @tc.name: testParamsSet006
* @tc.desc: Sets the value associated with a given search parameter to the given value.
* If there were several matching values, this method deletes the others.
* If the search parameter throw BusinessError: Parameter error.
*/
it('testParamsSet006', 0, function () {
try {
let params = new Url.URLParams("1=value1&2=value2&key3=3");
var a = 12;
params.set(a,'BBB');
var res = params.toString();
expect(0).assertEqual(1);
} catch(err) {
expect(err.toString()).assertEqual(`BusinessError: Parameter error.The type of ${a} must be string`)
expect(err.code).assertEqual(401)
expect(err.message).assertEqual(`Parameter error.The type of ${a} must be string`);
}
})
/**
* @tc.name: testParamsSet007
* @tc.desc: Sets the value associated with a given search parameter to the given value.
* If there were several matching values, this method deletes the others.
* If the search parameter throw BusinessError: Parameter error.
*/
it('testParamsSet007', 0, function () {
try {
let params = new Url.URLParams("1=value1&2=value2&key3=3");
var b = undefined;
params.set('12', b);
var res = params.toString();
expect(0).assertEqual(1);
} catch(err) {
expect(err.toString()).assertEqual(`BusinessError: Parameter error.The type of ${b} must be string`)
expect(err.code).assertEqual(401)
expect(err.message).assertEqual(`Parameter error.The type of ${b} must be string`);
}
})
/**
* @tc.name: testParamsSort001
* @tc.desc: Sort all key/value pairs contained in this object in place and return undefined.
*/
it('testParamsSort001', 0, function () {
let params = new Url.URLParams("1=value1&3=value3&2=key2");
params.sort();
var res = params.toString();
expect(res).assertEqual("1=value1&2=key2&3=value3");
})
/**
* @tc.name: testParamsSort002
* @tc.desc: Sort all key/value pairs contained in this object in place and return undefined.
*/
it('testParamsSort002', 0, function () {
let params = new Url.URLParams("a=value1&c=value2&b=key2");
params.sort();
var res = params.toString();
expect(res).assertEqual("a=value1&b=key2&c=value2");
})
/**
* @tc.name: testParamsSort003
* @tc.desc: Sort all key/value pairs contained in this object in place and return undefined.
*/
it('testParamsSort003', 0, function () {
let params = new Url.URLParams("d=value1&c=value2&b=33");
params.append("a","ACA");
params.sort();
var res = params.toString();
expect(res).assertEqual("a=ACA&b=33&c=value2&d=value1");
})
/**
* @tc.name: testParamsSort004
* @tc.desc: Sort all key/value pairs contained in this object in place and return undefined.
*/
it('testParamsSort004', 0, function () {
let params = new Url.URLParams("1=value1&3=value3&2=key2&4=key4");
params.sort();
var res = params.toString();
expect(res).assertEqual("1=value1&2=key2&3=value3&4=key4");
})
/**
* @tc.name: testParamsSort005
* @tc.desc: Sort all key/value pairs contained in this object in place and return undefined.
*/
it('testParamsSort005', 0, function () {
let params = new Url.URLParams("a=value1&c=value2&4=key4&b=key2");
params.sort();
var res = params.toString();
expect(res).assertEqual("4=key4&a=value1&b=key2&c=value2");
})
/**
* @tc.name: testParamsValues001
* @tc.desc: Returns an iterator allowing to go through all values contained in this object.
*/
it('testParamsValues001', 0, function () {
let params = new Url.URLParams("d=value1&c=value2&b=大")
var arr={}
var i = 0
for(var value of params.values()) {
arr[i] = value
i++
}
expect(arr[0]).assertEqual("value1")
})
/**
* @tc.name: testParamsValues002
* @tc.desc: Returns an iterator allowing to go through all values contained in this object.
*/
it('testParamsValues002', 0, function () {
let params = new Url.URLParams("d=value1&c=value2&b=大")
var arr={}
var i = 0
for(var value of params.values()) {
arr[i] = value
i++
}
expect(arr[1]).assertEqual("value2")
})
/**
* @tc.name: testParamsValues003
* @tc.desc: Returns an iterator allowing to go through all values contained in this object.
*/
it('testParamsValues003', 0, function () {
let params = new Url.URLParams("d=value1&c=value2&b=大")
params.append("a","ACA")
var arr={}
var i = 0
for(var value of params.values()) {
arr[i] = value
i++
}
expect(arr[3]).assertEqual("ACA")
})
/**
* @tc.name: testParamsValues004
* @tc.desc: Returns an iterator allowing to go through all values contained in this object.
*/
it('testParamsValues004', 0, function () {
let params = new Url.URLParams("d=value1&c=value2&b=大&4=key4")
var arr={}
var i = 0
for(var value of params.values()) {
arr[i] = value
i++
}
expect(arr[3]).assertEqual("key4")
})
/**
* @tc.name: testParamsValues005
* @tc.desc: Returns an iterator allowing to go through all values contained in this object.
*/
it('testParamsValues005', 0, function () {
let params = new Url.URLParams("d=value1&c=value2&b=大&4=key4&5=key5")
var arr={}
var i = 0
for(var value of params.values()) {
arr[i] = value
i++
}
expect(arr[4]).assertEqual("key5")
})
/**
* @tc.name: testParamsToString001
* @tc.desc: Returns a query string suitable for use in a URL.
*/
it('testParamsToString001', 0, function () {
let params = new Url.URLParams("d=value1&c=value2&b=大")
var result= params.toString()
expect(result).assertEqual("d=value1&c=value2&b=%E5%A4%A7")
})
/**
* @tc.name: testParamsToString002
* @tc.desc: Returns a query string suitable for use in a URL.
*/
it('testParamsToString002', 0, function () {
let params = new Url.URLParams("d=value1&c=value2&b= 大")
params.append("1 12","QQQ")
var result= params.toString()
expect(result).assertEqual("d=value1&c=value2&b=+%E5%A4%A7&1+12=QQQ")
})
/**
* @tc.name: testParamsToString003
* @tc.desc: Returns a query string suitable for use in a URL.
*/
it('testParamsToString003', 0, function () {
let params = new Url.URLParams("¥=)")
params.delete("5")
var result= params.toString()
expect(result).assertEqual("%EF%BF%A5=%29")
})
/**
* @tc.name: testParamsToString004
* @tc.desc: Returns a query string suitable for use in a URL.
*/
it('testParamsToString004', 0, function () {
let params = new Url.URLParams("d=value1&c=value2&b=大&4=key4")
var result= params.toString()
expect(result).assertEqual("d=value1&c=value2&b=%E5%A4%A7&4=key4")
})
/**
* @tc.name: testParamsToString005
* @tc.desc: Returns a query string suitable for use in a URL.
*/
it('testParamsToString005', 0, function () {
let params = new Url.URLParams("d=value1&c=value2&b= 大&4=key4&5=key5")
params.append("1 12","QQQ")
var result= params.toString()
expect(result).assertEqual("d=value1&c=value2&b=+%E5%A4%A7&4=key4&5=key5&1+12=QQQ")
})
/**
* @tc.name: testParamsConstruction001
* @tc.desc: A parameterized constructor used to create an URLSearchParams instance.
*/
it('testParamsConstruction001', 0, function () {
let params = new Url.URLParams('?user=abc&query=xyz')
var result= params.toString()
expect(result).assertEqual("user=abc&query=xyz")
})
/**
* @tc.name: testParamsConstruction002
* @tc.desc: A parameterized constructor used to create an URLSearchParams instance.
*/
it('testParamsConstruction002', 0, function () {
let params = new Url.URLParams({
user: 'abc',
query: ['first', 'second']
});
var result= params.toString()
expect(result).assertEqual("user=abc&query=first%2Csecond")
})
/**
* @tc.name: testParamsConstruction003
* @tc.desc: A parameterized constructor used to create an URLSearchParams instance.
*/
it('testParamsConstruction003', 0, function () {
let params = new Url.URLParams([
['user', 'abc'],
['query', 'first'],
['query', 'second'],
]);
var result= params.toString()
expect(result).assertEqual("user=abc&query=first&query=second")
})
/**
* @tc.name: testParamsConstruction004
* @tc.desc: A parameterized constructor used to create an URLSearchParams instance.
*/
it('testParamsConstruction004', 0, function () {
const map = new Map();
map.set('user', 'abc');
map.set('query', 'xyz');
let params = new Url.URLParams(map)
var result= params.toString()
expect(result).assertEqual("user=abc&query=xyz")
})
/**
* @tc.name: testParamsConstruction005
* @tc.desc: A parameterized constructor used to create an URLSearchParams instance.
*/
it('testParamsConstruction005', 0, function () {
function* getQueryPairs() {
yield ['user', 'abc'];
yield ['query', 'first'];
yield ['query', 'second'];
}
let params = new Url.URLParams(getQueryPairs());
var result= params.toString()
expect(result).assertEqual("user=abc&query=first&query=second")
})
/**
* @tc.name: testParamsConstruction006
* @tc.desc: A parameterized constructor used to create an URLSearchParams instance.
*/
it('testParamsConstruction006', 0, function () {
let params = new Url.URLParams()
params.append('abcde','fghki')
var paramsResult = params.toString()
expect(paramsResult).assertEqual('abcde=fghki')
})
/**
* @tc.name: testParamsConstruction007
* @tc.desc: A parameterized constructor used to create an URLSearchParams instance.
*/
it('testParamsConstruction007', 0, function () {
let param
let params = new Url.URLParams(param)
params.append('abcde','fghki')
var paramsResult = params.toString()
expect(paramsResult).assertEqual('abcde=fghki')
})
/**
* @tc.name: testParamsConstruction008
* @tc.desc: The type of init must be string two-dimensional array or object list throw error.
*/
it('testParamsConstruction008', 0, function () {
try {
var param = 123456789;
let params = new Url.URLParams(param)
} catch(err) {
expect(err.toString()).assertEqual(`BusinessError: Parameter error.The type of ${param} must be string`)
expect(err.code).assertEqual(401)
expect(err.message).assertEqual(`Parameter error.The type of ${param} must be string`);
}
})
/**
* @tc.name: testParamsConstruction009
* @tc.desc: The type of init must be string two-dimensional array or object list throw error.
*/
it('testParamsConstruction009', 0, function () {
try {
var param = [
['user', 'abc', 'error'],
];
let params = new Url.URLParams(param);
} catch(err) {
expect(err.toString()).assertEqual(`BusinessError: Parameter error.The type of ${param} must be string[][]`)
expect(err.code).assertEqual(401)
expect(err.message).assertEqual(`Parameter error.The type of ${param} must be string[][]`);
}
})
/** /**
* @tc.name: testUrlAppend001 * @tc.name: testUrlAppend001
* @tc.desc: Appends a specified key/value pair as a new search parameter. * @tc.desc: Appends a specified key/value pair as a new search parameter.
* @tc.author: jiangkai
*/ */
it('testUrlAppend001', 0, function () { it('testUrlAppend001', 0, function () {
var that = new Url.URL('http://username:password@host:8080/directory/file?foo=1&bar=2'); var that = new Url.URL('http://username:password@host:8080/directory/file?foo=1&bar=2');
...@@ -33,7 +1185,6 @@ describe('UrlFunTest', function () { ...@@ -33,7 +1185,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlAppend002 * @tc.name: testUrlAppend002
* @tc.desc: Appends a specified key/value pair as a new search parameter. * @tc.desc: Appends a specified key/value pair as a new search parameter.
* @tc.author: jiangkai
*/ */
it('testUrlAppend002', 0, function () { it('testUrlAppend002', 0, function () {
let that = new Url.URL('https://example.com?foo=1&bar=2') let that = new Url.URL('https://example.com?foo=1&bar=2')
...@@ -46,7 +1197,6 @@ describe('UrlFunTest', function () { ...@@ -46,7 +1197,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlAppend003 * @tc.name: testUrlAppend003
* @tc.desc: Appends a specified key/value pair as a new search parameter. * @tc.desc: Appends a specified key/value pair as a new search parameter.
* @tc.author: jiangkai
*/ */
it('testUrlAppend003', 0, function () { it('testUrlAppend003', 0, function () {
let that = new Url.URL('https://example.com?foo=1&bar=2') let that = new Url.URL('https://example.com?foo=1&bar=2')
...@@ -59,7 +1209,6 @@ describe('UrlFunTest', function () { ...@@ -59,7 +1209,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlAppend004 * @tc.name: testUrlAppend004
* @tc.desc: Appends a specified key/value pair as a new search parameter. * @tc.desc: Appends a specified key/value pair as a new search parameter.
* @tc.author: jiangkai
*/ */
it('testUrlAppend004', 0, function () { it('testUrlAppend004', 0, function () {
let that = new Url.URL('https://example.com?foo=1&bar=2') let that = new Url.URL('https://example.com?foo=1&bar=2')
...@@ -72,7 +1221,6 @@ describe('UrlFunTest', function () { ...@@ -72,7 +1221,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlAppend005 * @tc.name: testUrlAppend005
* @tc.desc: Appends a specified key/value pair as a new search parameter. * @tc.desc: Appends a specified key/value pair as a new search parameter.
* @tc.author: jiangkai
*/ */
it('testUrlAppend005', 0, function () { it('testUrlAppend005', 0, function () {
let that = new Url.URL('https://example.com?foo=1&bar=2') let that = new Url.URL('https://example.com?foo=1&bar=2')
...@@ -85,7 +1233,6 @@ describe('UrlFunTest', function () { ...@@ -85,7 +1233,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlDelete001 * @tc.name: testUrlDelete001
* @tc.desc: Deletes the given search parameter and its associated value,from the list of all search parameters. * @tc.desc: Deletes the given search parameter and its associated value,from the list of all search parameters.
* @tc.author: jiangkai
*/ */
it('testUrlDelete001', 0, function () { it('testUrlDelete001', 0, function () {
let that = new Url.URL('https://example.com?foo=1&bar=2') let that = new Url.URL('https://example.com?foo=1&bar=2')
...@@ -98,7 +1245,6 @@ describe('UrlFunTest', function () { ...@@ -98,7 +1245,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlDelete002 * @tc.name: testUrlDelete002
* @tc.desc: Deletes the given search parameter and its associated value,from the list of all search parameters. * @tc.desc: Deletes the given search parameter and its associated value,from the list of all search parameters.
* @tc.author: jiangkai
*/ */
it('testUrlDelete002', 0, function () { it('testUrlDelete002', 0, function () {
let that = new Url.URL('https://example.com?foo大=1&bar=2'); let that = new Url.URL('https://example.com?foo大=1&bar=2');
...@@ -111,7 +1257,6 @@ describe('UrlFunTest', function () { ...@@ -111,7 +1257,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlDelete003 * @tc.name: testUrlDelete003
* @tc.desc: Deletes the given search parameter and its associated value,from the list of all search parameters. * @tc.desc: Deletes the given search parameter and its associated value,from the list of all search parameters.
* @tc.author: jiangkai
*/ */
it('testUrlDelete003', 0, function () { it('testUrlDelete003', 0, function () {
let that = new Url.URL('https://example.com?foo大=1&bar=2'); let that = new Url.URL('https://example.com?foo大=1&bar=2');
...@@ -124,7 +1269,6 @@ describe('UrlFunTest', function () { ...@@ -124,7 +1269,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlDelete004 * @tc.name: testUrlDelete004
* @tc.desc: Deletes the given search parameter and its associated value,from the list of all search parameters. * @tc.desc: Deletes the given search parameter and its associated value,from the list of all search parameters.
* @tc.author: jiangkai
*/ */
it('testUrlDelete004', 0, function () { it('testUrlDelete004', 0, function () {
let that = new Url.URL('https://example.com?foo=1&bar=2'); let that = new Url.URL('https://example.com?foo=1&bar=2');
...@@ -137,7 +1281,6 @@ describe('UrlFunTest', function () { ...@@ -137,7 +1281,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlDelete005 * @tc.name: testUrlDelete005
* @tc.desc: Deletes the given search parameter and its associated value,from the list of all search parameters. * @tc.desc: Deletes the given search parameter and its associated value,from the list of all search parameters.
* @tc.author: jiangkai
*/ */
it('testUrlDelete005', 0, function () { it('testUrlDelete005', 0, function () {
let that = new Url.URL('https://example.com?foo=1&bar=2'); let that = new Url.URL('https://example.com?foo=1&bar=2');
...@@ -150,7 +1293,6 @@ describe('UrlFunTest', function () { ...@@ -150,7 +1293,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlEntries001 * @tc.name: testUrlEntries001
* @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array. * @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array.
* @tc.author: jiangkai
*/ */
it('testUrlEntries001', 0, function () { it('testUrlEntries001', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2"); let params = new Url.URLSearchParams("key1=value1&key2=value2");
...@@ -169,7 +1311,6 @@ describe('UrlFunTest', function () { ...@@ -169,7 +1311,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlEntries002 * @tc.name: testUrlEntries002
* @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array. * @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array.
* @tc.author: jiangkai
*/ */
it('testUrlEntries002', 0, function () { it('testUrlEntries002', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2") let params = new Url.URLSearchParams("key1=value1&key2=value2")
...@@ -187,7 +1328,6 @@ describe('UrlFunTest', function () { ...@@ -187,7 +1328,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlEntries003 * @tc.name: testUrlEntries003
* @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array. * @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array.
* @tc.author: jiangkai
*/ */
it('testUrlEntries003', 0, function () { it('testUrlEntries003', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2") let params = new Url.URLSearchParams("key1=value1&key2=value2")
...@@ -206,7 +1346,6 @@ describe('UrlFunTest', function () { ...@@ -206,7 +1346,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlEntries004 * @tc.name: testUrlEntries004
* @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array. * @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array.
* @tc.author: jiangkai
*/ */
it('testUrlEntries004', 0, function () { it('testUrlEntries004', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2") let params = new Url.URLSearchParams("key1=value1&key2=value2")
...@@ -224,7 +1363,6 @@ describe('UrlFunTest', function () { ...@@ -224,7 +1363,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlEntries005 * @tc.name: testUrlEntries005
* @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array. * @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array.
* @tc.author: jiangkai
*/ */
it('testUrlEntries005', 0, function () { it('testUrlEntries005', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2") let params = new Url.URLSearchParams("key1=value1&key2=value2")
...@@ -243,7 +1381,6 @@ describe('UrlFunTest', function () { ...@@ -243,7 +1381,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrl[Symbol.iterator]()001 * @tc.name: testUrl[Symbol.iterator]()001
* @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array. * @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array.
* @tc.author: zhangyouyou
*/ */
it('testUrl[Symbol.iterator]001', 0, function () { it('testUrl[Symbol.iterator]001', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2"); let params = new Url.URLSearchParams("key1=value1&key2=value2");
...@@ -261,7 +1398,6 @@ describe('UrlFunTest', function () { ...@@ -261,7 +1398,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrl[Symbol.iterator]()002 * @tc.name: testUrl[Symbol.iterator]()002
* @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array. * @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array.
* @tc.author: zhangyouyou
*/ */
it('testUrl[Symbol.iterator]()002', 0, function () { it('testUrl[Symbol.iterator]()002', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2") let params = new Url.URLSearchParams("key1=value1&key2=value2")
...@@ -279,7 +1415,6 @@ describe('UrlFunTest', function () { ...@@ -279,7 +1415,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrl[Symbol.iterator]()003 * @tc.name: testUrl[Symbol.iterator]()003
* @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array. * @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array.
* @tc.author: zhangyouyou
*/ */
it('testUrl[Symbol.iterator]()003', 0, function () { it('testUrl[Symbol.iterator]()003', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2") let params = new Url.URLSearchParams("key1=value1&key2=value2")
...@@ -298,7 +1433,6 @@ describe('UrlFunTest', function () { ...@@ -298,7 +1433,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrl[Symbol.iterator]()004 * @tc.name: testUrl[Symbol.iterator]()004
* @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array. * @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array.
* @tc.author: zhangyouyou
*/ */
it('testUrl[Symbol.iterator]()004', 0, function () { it('testUrl[Symbol.iterator]()004', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2") let params = new Url.URLSearchParams("key1=value1&key2=value2")
...@@ -316,7 +1450,6 @@ describe('UrlFunTest', function () { ...@@ -316,7 +1450,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrl[Symbol.iterator]()005 * @tc.name: testUrl[Symbol.iterator]()005
* @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array. * @tc.desc: Returns an ES6 iterator. Each item of the iterator is a JavaScript Array.
* @tc.author: zhangyouyou
*/ */
it('testUrl[Symbol.iterator]()005', 0, function () { it('testUrl[Symbol.iterator]()005', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2") let params = new Url.URLSearchParams("key1=value1&key2=value2")
...@@ -335,7 +1468,6 @@ describe('UrlFunTest', function () { ...@@ -335,7 +1468,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlForEach001 * @tc.name: testUrlForEach001
* @tc.desc: Callback functions are used to traverse key-value pairs on the URLSearchParams instance object. * @tc.desc: Callback functions are used to traverse key-value pairs on the URLSearchParams instance object.
* @tc.author: jiangkai
*/ */
it('testUrlForEach001', 0, function () { it('testUrlForEach001', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2") let params = new Url.URLSearchParams("key1=value1&key2=value2")
...@@ -353,7 +1485,6 @@ describe('UrlFunTest', function () { ...@@ -353,7 +1485,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlForEach002 * @tc.name: testUrlForEach002
* @tc.desc: Callback functions are used to traverse key-value pairs on the URLSearchParams instance object. * @tc.desc: Callback functions are used to traverse key-value pairs on the URLSearchParams instance object.
* @tc.author: jiangkai
*/ */
it('testUrlForEach002', 0, function () { it('testUrlForEach002', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2"); let params = new Url.URLSearchParams("key1=value1&key2=value2");
...@@ -371,7 +1502,6 @@ describe('UrlFunTest', function () { ...@@ -371,7 +1502,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlForEach003 * @tc.name: testUrlForEach003
* @tc.desc: Callback functions are used to traverse key-value pairs on the URLSearchParams instance object. * @tc.desc: Callback functions are used to traverse key-value pairs on the URLSearchParams instance object.
* @tc.author: jiangkai
*/ */
it('testUrlForEach003', 0, function () { it('testUrlForEach003', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2"); let params = new Url.URLSearchParams("key1=value1&key2=value2");
...@@ -390,7 +1520,6 @@ describe('UrlFunTest', function () { ...@@ -390,7 +1520,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlForEach004 * @tc.name: testUrlForEach004
* @tc.desc: Callback functions are used to traverse key-value pairs on the URLSearchParams instance object. * @tc.desc: Callback functions are used to traverse key-value pairs on the URLSearchParams instance object.
* @tc.author: jiangkai
*/ */
it('testUrlForEach004', 0, function () { it('testUrlForEach004', 0, function () {
let params = new Url.URLSearchParams("foo=bar&jss=txt"); let params = new Url.URLSearchParams("foo=bar&jss=txt");
...@@ -408,7 +1537,6 @@ describe('UrlFunTest', function () { ...@@ -408,7 +1537,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlForEach005 * @tc.name: testUrlForEach005
* @tc.desc: Callback functions are used to traverse key-value pairs on the URLSearchParams instance object. * @tc.desc: Callback functions are used to traverse key-value pairs on the URLSearchParams instance object.
* @tc.author: jiangkai
*/ */
it('testUrlForEach005', 0, function () { it('testUrlForEach005', 0, function () {
let params = new Url.URLSearchParams("foo=bar&jss=txt"); let params = new Url.URLSearchParams("foo=bar&jss=txt");
...@@ -427,7 +1555,6 @@ describe('UrlFunTest', function () { ...@@ -427,7 +1555,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlGet001 * @tc.name: testUrlGet001
* @tc.desc: Returns the first value associated to the given search parameter. * @tc.desc: Returns the first value associated to the given search parameter.
* @tc.author: maxiaodong
*/ */
it('testUrlGet001', 0, function () { it('testUrlGet001', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2") let params = new Url.URLSearchParams("key1=value1&key2=value2")
...@@ -438,7 +1565,6 @@ describe('UrlFunTest', function () { ...@@ -438,7 +1565,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlGet002 * @tc.name: testUrlGet002
* @tc.desc: Returns the first value associated to the given search parameter. * @tc.desc: Returns the first value associated to the given search parameter.
* @tc.author: maxiaodong
*/ */
it('testUrlGet002', 0, function () { it('testUrlGet002', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2") let params = new Url.URLSearchParams("key1=value1&key2=value2")
...@@ -449,7 +1575,6 @@ describe('UrlFunTest', function () { ...@@ -449,7 +1575,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlGet003 * @tc.name: testUrlGet003
* @tc.desc: Returns the first value associated to the given search parameter. * @tc.desc: Returns the first value associated to the given search parameter.
* @tc.author: maxiaodong
*/ */
it('testUrlGet003', 0, function () { it('testUrlGet003', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2") let params = new Url.URLSearchParams("key1=value1&key2=value2")
...@@ -461,7 +1586,6 @@ describe('UrlFunTest', function () { ...@@ -461,7 +1586,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlGet004 * @tc.name: testUrlGet004
* @tc.desc: Returns the first value associated to the given search parameter. * @tc.desc: Returns the first value associated to the given search parameter.
* @tc.author: maxiaodong
*/ */
it('testUrlGet004', 0, function () { it('testUrlGet004', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2") let params = new Url.URLSearchParams("key1=value1&key2=value2")
...@@ -472,7 +1596,6 @@ describe('UrlFunTest', function () { ...@@ -472,7 +1596,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlGet005 * @tc.name: testUrlGet005
* @tc.desc: Returns the first value associated to the given search parameter. * @tc.desc: Returns the first value associated to the given search parameter.
* @tc.author: maxiaodong
*/ */
it('testUrlGet005', 0, function () { it('testUrlGet005', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2") let params = new Url.URLSearchParams("key1=value1&key2=value2")
...@@ -484,7 +1607,6 @@ describe('UrlFunTest', function () { ...@@ -484,7 +1607,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlGetAll001 * @tc.name: testUrlGetAll001
* @tc.desc: Returns all key-value pairs associated with a given search parameter as an array. * @tc.desc: Returns all key-value pairs associated with a given search parameter as an array.
* @tc.author: maxiaodong
*/ */
it('testUrlGetAll001', 0, function () { it('testUrlGetAll001', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2") let params = new Url.URLSearchParams("key1=value1&key2=value2")
...@@ -496,7 +1618,6 @@ describe('UrlFunTest', function () { ...@@ -496,7 +1618,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlGetAll002 * @tc.name: testUrlGetAll002
* @tc.desc: Returns all key-value pairs associated with a given search parameter as an array. * @tc.desc: Returns all key-value pairs associated with a given search parameter as an array.
* @tc.author: maxiaodong
*/ */
it('testUrlGetAll002', 0, function () { it('testUrlGetAll002', 0, function () {
let params = new Url.URLSearchParams("key1=value1&8=DEF") let params = new Url.URLSearchParams("key1=value1&8=DEF")
...@@ -508,7 +1629,6 @@ describe('UrlFunTest', function () { ...@@ -508,7 +1629,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlGetAll003 * @tc.name: testUrlGetAll003
* @tc.desc: Returns all key-value pairs associated with a given search parameter as an array. * @tc.desc: Returns all key-value pairs associated with a given search parameter as an array.
* @tc.author: maxiaodong
*/ */
it('testUrlGetAll003', 0, function () { it('testUrlGetAll003', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2&key3=da") let params = new Url.URLSearchParams("key1=value1&key2=value2&key3=da")
...@@ -520,7 +1640,6 @@ describe('UrlFunTest', function () { ...@@ -520,7 +1640,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlGetAll004 * @tc.name: testUrlGetAll004
* @tc.desc: Returns all key-value pairs associated with a given search parameter as an array. * @tc.desc: Returns all key-value pairs associated with a given search parameter as an array.
* @tc.author: maxiaodong
*/ */
it('testUrlGetAll004', 0, function () { it('testUrlGetAll004', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2&key3=大") let params = new Url.URLSearchParams("key1=value1&key2=value2&key3=大")
...@@ -532,7 +1651,6 @@ describe('UrlFunTest', function () { ...@@ -532,7 +1651,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlGetAll005 * @tc.name: testUrlGetAll005
* @tc.desc: Returns all key-value pairs associated with a given search parameter as an array. * @tc.desc: Returns all key-value pairs associated with a given search parameter as an array.
* @tc.author: maxiaodong
*/ */
it('testUrlGetAll005', 0, function () { it('testUrlGetAll005', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2&key3=大") let params = new Url.URLSearchParams("key1=value1&key2=value2&key3=大")
...@@ -544,7 +1662,6 @@ describe('UrlFunTest', function () { ...@@ -544,7 +1662,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlHas001 * @tc.name: testUrlHas001
* @tc.desc: Returns a Boolean that indicates whether a parameter with the specified name exists. * @tc.desc: Returns a Boolean that indicates whether a parameter with the specified name exists.
* @tc.author: maxiaodong
*/ */
it('testUrlHas001', 0, function () { it('testUrlHas001', 0, function () {
let params = new Url.URLSearchParams("key1=value1&key2=value2&key3=大") let params = new Url.URLSearchParams("key1=value1&key2=value2&key3=大")
...@@ -555,7 +1672,6 @@ describe('UrlFunTest', function () { ...@@ -555,7 +1672,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlHas002 * @tc.name: testUrlHas002
* @tc.desc: Returns a Boolean that indicates whether a parameter with the specified name exists. * @tc.desc: Returns a Boolean that indicates whether a parameter with the specified name exists.
* @tc.author: maxiaodong
*/ */
it('testUrlHas002', 0, function () { it('testUrlHas002', 0, function () {
let params = new Url.URLSearchParams("小=value1&key2=value2&key3=大") let params = new Url.URLSearchParams("小=value1&key2=value2&key3=大")
...@@ -566,7 +1682,6 @@ describe('UrlFunTest', function () { ...@@ -566,7 +1682,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlHas003 * @tc.name: testUrlHas003
* @tc.desc: Returns a Boolean that indicates whether a parameter with the specified name exists. * @tc.desc: Returns a Boolean that indicates whether a parameter with the specified name exists.
* @tc.author: maxiaodong
*/ */
it('testUrlHas003', 0, function () { it('testUrlHas003', 0, function () {
let params = new Url.URLSearchParams("小=value1&¥=value2&key3=大") let params = new Url.URLSearchParams("小=value1&¥=value2&key3=大")
...@@ -578,7 +1693,6 @@ describe('UrlFunTest', function () { ...@@ -578,7 +1693,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlHas004 * @tc.name: testUrlHas004
* @tc.desc: Returns a Boolean that indicates whether a parameter with the specified name exists. * @tc.desc: Returns a Boolean that indicates whether a parameter with the specified name exists.
* @tc.author: maxiaodong
*/ */
it('testUrlHas004', 0, function () { it('testUrlHas004', 0, function () {
let params = new Url.URLSearchParams("小=value1&key2=value2&key3=大") let params = new Url.URLSearchParams("小=value1&key2=value2&key3=大")
...@@ -589,7 +1703,6 @@ describe('UrlFunTest', function () { ...@@ -589,7 +1703,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlHas005 * @tc.name: testUrlHas005
* @tc.desc: Returns a Boolean that indicates whether a parameter with the specified name exists. * @tc.desc: Returns a Boolean that indicates whether a parameter with the specified name exists.
* @tc.author: maxiaodong
*/ */
it('testUrlHas005', 0, function () { it('testUrlHas005', 0, function () {
let params = new Url.URLSearchParams("小=value1&¥=value2&key3=大") let params = new Url.URLSearchParams("小=value1&¥=value2&key3=大")
...@@ -601,7 +1714,6 @@ describe('UrlFunTest', function () { ...@@ -601,7 +1714,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlKeys001 * @tc.name: testUrlKeys001
* @tc.desc: Returns an iterator allowing to go through all keys contained in this object. * @tc.desc: Returns an iterator allowing to go through all keys contained in this object.
* @tc.author: maxiaodong
*/ */
it('testUrlKeys001', 0, function () { it('testUrlKeys001', 0, function () {
let params = new Url.URLSearchParams("小=value1&¥=value2&key3=大"); let params = new Url.URLSearchParams("小=value1&¥=value2&key3=大");
...@@ -617,7 +1729,6 @@ describe('UrlFunTest', function () { ...@@ -617,7 +1729,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlKeys002 * @tc.name: testUrlKeys002
* @tc.desc: Returns an iterator allowing to go through all keys contained in this object. * @tc.desc: Returns an iterator allowing to go through all keys contained in this object.
* @tc.author: maxiaodong
*/ */
it('testUrlKeys002', 0, function () { it('testUrlKeys002', 0, function () {
let params = new Url.URLSearchParams("小=value1&¥=value2&key3=大"); let params = new Url.URLSearchParams("小=value1&¥=value2&key3=大");
...@@ -633,7 +1744,6 @@ describe('UrlFunTest', function () { ...@@ -633,7 +1744,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlKeys003 * @tc.name: testUrlKeys003
* @tc.desc: Returns an iterator allowing to go through all keys contained in this object. * @tc.desc: Returns an iterator allowing to go through all keys contained in this object.
* @tc.author: maxiaodong
*/ */
it('testUrlKeys003', 0, function () { it('testUrlKeys003', 0, function () {
let params = new Url.URLSearchParams("小=value1&¥=value2&key3=大"); let params = new Url.URLSearchParams("小=value1&¥=value2&key3=大");
...@@ -649,7 +1759,6 @@ describe('UrlFunTest', function () { ...@@ -649,7 +1759,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlKeys004 * @tc.name: testUrlKeys004
* @tc.desc: Returns an iterator allowing to go through all keys contained in this object. * @tc.desc: Returns an iterator allowing to go through all keys contained in this object.
* @tc.author: maxiaodong
*/ */
it('testUrlKeys004', 0, function () { it('testUrlKeys004', 0, function () {
let params = new Url.URLSearchParams("小=value1&¥=value2&key3=大&key4=六"); let params = new Url.URLSearchParams("小=value1&¥=value2&key3=大&key4=六");
...@@ -665,7 +1774,6 @@ describe('UrlFunTest', function () { ...@@ -665,7 +1774,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlKeys005 * @tc.name: testUrlKeys005
* @tc.desc: Returns an iterator allowing to go through all keys contained in this object. * @tc.desc: Returns an iterator allowing to go through all keys contained in this object.
* @tc.author: maxiaodong
*/ */
it('testUrlKeys005', 0, function () { it('testUrlKeys005', 0, function () {
let params = new Url.URLSearchParams("小=value1&¥=value2&key3=大&key4=六&key5=发"); let params = new Url.URLSearchParams("小=value1&¥=value2&key3=大&key4=六&key5=发");
...@@ -683,7 +1791,6 @@ describe('UrlFunTest', function () { ...@@ -683,7 +1791,6 @@ describe('UrlFunTest', function () {
* @tc.desc: Sets the value associated with a given search parameter to the given value. * @tc.desc: Sets the value associated with a given search parameter to the given value.
* If there were several matching values, this method deletes the others. * If there were several matching values, this method deletes the others.
* If the search parameter doesn't exist, this method creates it. * If the search parameter doesn't exist, this method creates it.
* @tc.author: maxiaodong
*/ */
it('testUrlSet001', 0, function () { it('testUrlSet001', 0, function () {
let params = new Url.URLSearchParams("1=value1&2=value2&key3=3"); let params = new Url.URLSearchParams("1=value1&2=value2&key3=3");
...@@ -698,7 +1805,6 @@ describe('UrlFunTest', function () { ...@@ -698,7 +1805,6 @@ describe('UrlFunTest', function () {
* @tc.desc: Sets the value associated with a given search parameter to the given value. * @tc.desc: Sets the value associated with a given search parameter to the given value.
* If there were several matching values, this method deletes the others. * If there were several matching values, this method deletes the others.
* If the search parameter doesn't exist, this method creates it. * If the search parameter doesn't exist, this method creates it.
* @tc.author: maxiaodong
*/ */
it('testUrlSet002', 0, function () { it('testUrlSet002', 0, function () {
let params = new Url.URLSearchParams("1=value1&2=value2&key3=3"); let params = new Url.URLSearchParams("1=value1&2=value2&key3=3");
...@@ -712,7 +1818,6 @@ describe('UrlFunTest', function () { ...@@ -712,7 +1818,6 @@ describe('UrlFunTest', function () {
* @tc.desc: Sets the value associated with a given search parameter to the given value. * @tc.desc: Sets the value associated with a given search parameter to the given value.
* If there were several matching values, this method deletes the others. * If there were several matching values, this method deletes the others.
* If the search parameter doesn't exist, this method creates it. * If the search parameter doesn't exist, this method creates it.
* @tc.author: maxiaodong
*/ */
it('testUrlSet003', 0, function () { it('testUrlSet003', 0, function () {
let params = new Url.URLSearchParams("1=value1&2=value2&key3=3"); let params = new Url.URLSearchParams("1=value1&2=value2&key3=3");
...@@ -726,7 +1831,6 @@ describe('UrlFunTest', function () { ...@@ -726,7 +1831,6 @@ describe('UrlFunTest', function () {
* @tc.desc: Sets the value associated with a given search parameter to the given value. * @tc.desc: Sets the value associated with a given search parameter to the given value.
* If there were several matching values, this method deletes the others. * If there were several matching values, this method deletes the others.
* If the search parameter doesn't exist, this method creates it. * If the search parameter doesn't exist, this method creates it.
* @tc.author: maxiaodong
*/ */
it('testUrlSet004', 0, function () { it('testUrlSet004', 0, function () {
let params = new Url.URLSearchParams("1=value1&2=value2&key3=3"); let params = new Url.URLSearchParams("1=value1&2=value2&key3=3");
...@@ -741,7 +1845,6 @@ describe('UrlFunTest', function () { ...@@ -741,7 +1845,6 @@ describe('UrlFunTest', function () {
* @tc.desc: Sets the value associated with a given search parameter to the given value. * @tc.desc: Sets the value associated with a given search parameter to the given value.
* If there were several matching values, this method deletes the others. * If there were several matching values, this method deletes the others.
* If the search parameter doesn't exist, this method creates it. * If the search parameter doesn't exist, this method creates it.
* @tc.author: maxiaodong
*/ */
it('testUrlSet005', 0, function () { it('testUrlSet005', 0, function () {
let params = new Url.URLSearchParams("1=value1&2=value2&key3=3"); let params = new Url.URLSearchParams("1=value1&2=value2&key3=3");
...@@ -753,7 +1856,6 @@ describe('UrlFunTest', function () { ...@@ -753,7 +1856,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSort001 * @tc.name: testUrlSort001
* @tc.desc: Sort all key/value pairs contained in this object in place and return undefined. * @tc.desc: Sort all key/value pairs contained in this object in place and return undefined.
* @tc.author: maxiaodong
*/ */
it('testUrlSort001', 0, function () { it('testUrlSort001', 0, function () {
let params = new Url.URLSearchParams("1=value1&3=value3&2=key2"); let params = new Url.URLSearchParams("1=value1&3=value3&2=key2");
...@@ -765,7 +1867,6 @@ describe('UrlFunTest', function () { ...@@ -765,7 +1867,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSort002 * @tc.name: testUrlSort002
* @tc.desc: Sort all key/value pairs contained in this object in place and return undefined. * @tc.desc: Sort all key/value pairs contained in this object in place and return undefined.
* @tc.author: maxiaodong
*/ */
it('testUrlSort002', 0, function () { it('testUrlSort002', 0, function () {
let params = new Url.URLSearchParams("a=value1&c=value2&b=key2"); let params = new Url.URLSearchParams("a=value1&c=value2&b=key2");
...@@ -777,7 +1878,6 @@ describe('UrlFunTest', function () { ...@@ -777,7 +1878,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSort003 * @tc.name: testUrlSort003
* @tc.desc: Sort all key/value pairs contained in this object in place and return undefined. * @tc.desc: Sort all key/value pairs contained in this object in place and return undefined.
* @tc.author: maxiaodong
*/ */
it('testUrlSort003', 0, function () { it('testUrlSort003', 0, function () {
let params = new Url.URLSearchParams("d=value1&c=value2&b=33"); let params = new Url.URLSearchParams("d=value1&c=value2&b=33");
...@@ -790,7 +1890,6 @@ describe('UrlFunTest', function () { ...@@ -790,7 +1890,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSort004 * @tc.name: testUrlSort004
* @tc.desc: Sort all key/value pairs contained in this object in place and return undefined. * @tc.desc: Sort all key/value pairs contained in this object in place and return undefined.
* @tc.author: maxiaodong
*/ */
it('testUrlSort004', 0, function () { it('testUrlSort004', 0, function () {
let params = new Url.URLSearchParams("1=value1&3=value3&2=key2&4=key4"); let params = new Url.URLSearchParams("1=value1&3=value3&2=key2&4=key4");
...@@ -802,7 +1901,6 @@ describe('UrlFunTest', function () { ...@@ -802,7 +1901,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSort005 * @tc.name: testUrlSort005
* @tc.desc: Sort all key/value pairs contained in this object in place and return undefined. * @tc.desc: Sort all key/value pairs contained in this object in place and return undefined.
* @tc.author: maxiaodong
*/ */
it('testUrlSort005', 0, function () { it('testUrlSort005', 0, function () {
let params = new Url.URLSearchParams("a=value1&c=value2&4=key4&b=key2"); let params = new Url.URLSearchParams("a=value1&c=value2&4=key4&b=key2");
...@@ -814,7 +1912,6 @@ describe('UrlFunTest', function () { ...@@ -814,7 +1912,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlValues001 * @tc.name: testUrlValues001
* @tc.desc: Returns an iterator allowing to go through all values contained in this object. * @tc.desc: Returns an iterator allowing to go through all values contained in this object.
* @tc.author: maxiaodong
*/ */
it('testUrlValues001', 0, function () { it('testUrlValues001', 0, function () {
let params = new Url.URLSearchParams("d=value1&c=value2&b=大") let params = new Url.URLSearchParams("d=value1&c=value2&b=大")
...@@ -830,7 +1927,6 @@ describe('UrlFunTest', function () { ...@@ -830,7 +1927,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlValues002 * @tc.name: testUrlValues002
* @tc.desc: Returns an iterator allowing to go through all values contained in this object. * @tc.desc: Returns an iterator allowing to go through all values contained in this object.
* @tc.author: maxiaodong
*/ */
it('testUrlValues002', 0, function () { it('testUrlValues002', 0, function () {
let params = new Url.URLSearchParams("d=value1&c=value2&b=大") let params = new Url.URLSearchParams("d=value1&c=value2&b=大")
...@@ -846,7 +1942,6 @@ describe('UrlFunTest', function () { ...@@ -846,7 +1942,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlValues003 * @tc.name: testUrlValues003
* @tc.desc: Returns an iterator allowing to go through all values contained in this object. * @tc.desc: Returns an iterator allowing to go through all values contained in this object.
* @tc.author: maxiaodong
*/ */
it('testUrlValues003', 0, function () { it('testUrlValues003', 0, function () {
let params = new Url.URLSearchParams("d=value1&c=value2&b=大") let params = new Url.URLSearchParams("d=value1&c=value2&b=大")
...@@ -863,7 +1958,6 @@ describe('UrlFunTest', function () { ...@@ -863,7 +1958,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlValues004 * @tc.name: testUrlValues004
* @tc.desc: Returns an iterator allowing to go through all values contained in this object. * @tc.desc: Returns an iterator allowing to go through all values contained in this object.
* @tc.author: maxiaodong
*/ */
it('testUrlValues004', 0, function () { it('testUrlValues004', 0, function () {
let params = new Url.URLSearchParams("d=value1&c=value2&b=大&4=key4") let params = new Url.URLSearchParams("d=value1&c=value2&b=大&4=key4")
...@@ -879,7 +1973,6 @@ describe('UrlFunTest', function () { ...@@ -879,7 +1973,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlValues005 * @tc.name: testUrlValues005
* @tc.desc: Returns an iterator allowing to go through all values contained in this object. * @tc.desc: Returns an iterator allowing to go through all values contained in this object.
* @tc.author: maxiaodong
*/ */
it('testUrlValues005', 0, function () { it('testUrlValues005', 0, function () {
let params = new Url.URLSearchParams("d=value1&c=value2&b=大&4=key4&5=key5") let params = new Url.URLSearchParams("d=value1&c=value2&b=大&4=key4&5=key5")
...@@ -895,7 +1988,6 @@ describe('UrlFunTest', function () { ...@@ -895,7 +1988,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSearchParamsToString001 * @tc.name: testUrlSearchParamsToString001
* @tc.desc: Returns a query string suitable for use in a URL. * @tc.desc: Returns a query string suitable for use in a URL.
* @tc.author: maxiaodong
*/ */
it('testUrlSearchParamsToString001', 0, function () { it('testUrlSearchParamsToString001', 0, function () {
let params = new Url.URLSearchParams("d=value1&c=value2&b=大") let params = new Url.URLSearchParams("d=value1&c=value2&b=大")
...@@ -906,7 +1998,6 @@ describe('UrlFunTest', function () { ...@@ -906,7 +1998,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSearchParamsToString002 * @tc.name: testUrlSearchParamsToString002
* @tc.desc: Returns a query string suitable for use in a URL. * @tc.desc: Returns a query string suitable for use in a URL.
* @tc.author: maxiaodong
*/ */
it('testUrlSearchParamsToString002', 0, function () { it('testUrlSearchParamsToString002', 0, function () {
let params = new Url.URLSearchParams("d=value1&c=value2&b= 大") let params = new Url.URLSearchParams("d=value1&c=value2&b= 大")
...@@ -918,7 +2009,6 @@ describe('UrlFunTest', function () { ...@@ -918,7 +2009,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSearchParamsToString003 * @tc.name: testUrlSearchParamsToString003
* @tc.desc: Returns a query string suitable for use in a URL. * @tc.desc: Returns a query string suitable for use in a URL.
* @tc.author: maxiaodong
*/ */
it('testUrlSearchParamsToString003', 0, function () { it('testUrlSearchParamsToString003', 0, function () {
let params = new Url.URLSearchParams("¥=)") let params = new Url.URLSearchParams("¥=)")
...@@ -930,7 +2020,6 @@ describe('UrlFunTest', function () { ...@@ -930,7 +2020,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSearchParamsToString004 * @tc.name: testUrlSearchParamsToString004
* @tc.desc: Returns a query string suitable for use in a URL. * @tc.desc: Returns a query string suitable for use in a URL.
* @tc.author: maxiaodong
*/ */
it('testUrlSearchParamsToString004', 0, function () { it('testUrlSearchParamsToString004', 0, function () {
let params = new Url.URLSearchParams("d=value1&c=value2&b=大&4=key4") let params = new Url.URLSearchParams("d=value1&c=value2&b=大&4=key4")
...@@ -941,7 +2030,6 @@ describe('UrlFunTest', function () { ...@@ -941,7 +2030,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSearchParamsToString005 * @tc.name: testUrlSearchParamsToString005
* @tc.desc: Returns a query string suitable for use in a URL. * @tc.desc: Returns a query string suitable for use in a URL.
* @tc.author: maxiaodong
*/ */
it('testUrlSearchParamsToString005', 0, function () { it('testUrlSearchParamsToString005', 0, function () {
let params = new Url.URLSearchParams("d=value1&c=value2&b= 大&4=key4&5=key5") let params = new Url.URLSearchParams("d=value1&c=value2&b= 大&4=key4&5=key5")
...@@ -953,7 +2041,6 @@ describe('UrlFunTest', function () { ...@@ -953,7 +2041,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSearchParamsConstruction001 * @tc.name: testUrlSearchParamsConstruction001
* @tc.desc: A parameterized constructor used to create an URLSearchParams instance. * @tc.desc: A parameterized constructor used to create an URLSearchParams instance.
* @tc.author: zhangyouyou
*/ */
it('testUrlSearchParamsConstruction001', 0, function () { it('testUrlSearchParamsConstruction001', 0, function () {
let params = new Url.URLSearchParams('?user=abc&query=xyz') let params = new Url.URLSearchParams('?user=abc&query=xyz')
...@@ -964,7 +2051,6 @@ describe('UrlFunTest', function () { ...@@ -964,7 +2051,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSearchParamsConstruction002 * @tc.name: testUrlSearchParamsConstruction002
* @tc.desc: A parameterized constructor used to create an URLSearchParams instance. * @tc.desc: A parameterized constructor used to create an URLSearchParams instance.
* @tc.author: zhangyouyou
*/ */
it('testUrlSearchParamsConstruction002', 0, function () { it('testUrlSearchParamsConstruction002', 0, function () {
let params = new Url.URLSearchParams({ let params = new Url.URLSearchParams({
...@@ -978,7 +2064,6 @@ describe('UrlFunTest', function () { ...@@ -978,7 +2064,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSearchParamsConstruction003 * @tc.name: testUrlSearchParamsConstruction003
* @tc.desc: A parameterized constructor used to create an URLSearchParams instance. * @tc.desc: A parameterized constructor used to create an URLSearchParams instance.
* @tc.author: zhangyouyou
*/ */
it('testUrlSearchParamsConstruction003', 0, function () { it('testUrlSearchParamsConstruction003', 0, function () {
let params = new Url.URLSearchParams([ let params = new Url.URLSearchParams([
...@@ -993,7 +2078,6 @@ describe('UrlFunTest', function () { ...@@ -993,7 +2078,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSearchParamsConstruction004 * @tc.name: testUrlSearchParamsConstruction004
* @tc.desc: A parameterized constructor used to create an URLSearchParams instance. * @tc.desc: A parameterized constructor used to create an URLSearchParams instance.
* @tc.author: zhangyouyou
*/ */
it('testUrlSearchParamsConstruction004', 0, function () { it('testUrlSearchParamsConstruction004', 0, function () {
const map = new Map(); const map = new Map();
...@@ -1007,7 +2091,6 @@ describe('UrlFunTest', function () { ...@@ -1007,7 +2091,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSearchParamsConstruction005 * @tc.name: testUrlSearchParamsConstruction005
* @tc.desc: A parameterized constructor used to create an URLSearchParams instance. * @tc.desc: A parameterized constructor used to create an URLSearchParams instance.
* @tc.author: zhangyouyou
*/ */
it('testUrlSearchParamsConstruction005', 0, function () { it('testUrlSearchParamsConstruction005', 0, function () {
function* getQueryPairs() { function* getQueryPairs() {
...@@ -1023,7 +2106,6 @@ describe('UrlFunTest', function () { ...@@ -1023,7 +2106,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSearchParamsConstruction006 * @tc.name: testUrlSearchParamsConstruction006
* @tc.desc: A parameterized constructor used to create an URLSearchParams instance. * @tc.desc: A parameterized constructor used to create an URLSearchParams instance.
* @tc.author: zhangyouyou
*/ */
it('testUrlSearchParamsConstruction006', 0, function () { it('testUrlSearchParamsConstruction006', 0, function () {
let params = new Url.URLSearchParams() let params = new Url.URLSearchParams()
...@@ -1035,7 +2117,6 @@ describe('UrlFunTest', function () { ...@@ -1035,7 +2117,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSearchParamsConstruction007 * @tc.name: testUrlSearchParamsConstruction007
* @tc.desc: A parameterized constructor used to create an URLSearchParams instance. * @tc.desc: A parameterized constructor used to create an URLSearchParams instance.
* @tc.author: zhangyouyou
*/ */
it('testUrlSearchParamsConstruction007', 0, function () { it('testUrlSearchParamsConstruction007', 0, function () {
let param let param
...@@ -1048,7 +2129,6 @@ describe('UrlFunTest', function () { ...@@ -1048,7 +2129,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlToString001 * @tc.name: testUrlToString001
* @tc.desc: Returns the serialized URL as a string. * @tc.desc: Returns the serialized URL as a string.
* @tc.author: zhaoduwei
*/ */
it('testUrlToString001', 0, function () { it('testUrlToString001', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment')
...@@ -1059,7 +2139,6 @@ describe('UrlFunTest', function () { ...@@ -1059,7 +2139,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlToString002 * @tc.name: testUrlToString002
* @tc.desc: Returns the serialized URL as a string. * @tc.desc: Returns the serialized URL as a string.
* @tc.author: zhaoduwei
*/ */
it('testUrlToString002', 0, function () { it('testUrlToString002', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file') let params = new Url.URL('http://username:password@host:8080/directory/file')
...@@ -1070,7 +2149,6 @@ describe('UrlFunTest', function () { ...@@ -1070,7 +2149,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlToString003 * @tc.name: testUrlToString003
* @tc.desc: Returns the serialized URL as a string. * @tc.desc: Returns the serialized URL as a string.
* @tc.author: zhaoduwei
*/ */
it('testUrlToString003', 0, function () { it('testUrlToString003', 0, function () {
let params = new Url.URL('http://username:password@host:8080#fragment') let params = new Url.URL('http://username:password@host:8080#fragment')
...@@ -1081,7 +2159,6 @@ describe('UrlFunTest', function () { ...@@ -1081,7 +2159,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlToString004 * @tc.name: testUrlToString004
* @tc.desc: Returns the serialized URL as a string. * @tc.desc: Returns the serialized URL as a string.
* @tc.author: zhaoduwei
*/ */
it('testUrlToString004', 0, function () { it('testUrlToString004', 0, function () {
let params = new Url.URL('http1://host/directory/file?query#fragment') let params = new Url.URL('http1://host/directory/file?query#fragment')
...@@ -1092,7 +2169,6 @@ describe('UrlFunTest', function () { ...@@ -1092,7 +2169,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlToString005 * @tc.name: testUrlToString005
* @tc.desc: Returns the serialized URL as a string. * @tc.desc: Returns the serialized URL as a string.
* @tc.author: zhaoduwei
*/ */
it('testUrlToString005', 0, function () { it('testUrlToString005', 0, function () {
let params = new Url.URL('http:host:8080/directory/file?query#fragment') let params = new Url.URL('http:host:8080/directory/file?query#fragment')
...@@ -1103,7 +2179,6 @@ describe('UrlFunTest', function () { ...@@ -1103,7 +2179,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlHref001 * @tc.name: testUrlHref001
* @tc.desc: Gets and sets the serialized URL. * @tc.desc: Gets and sets the serialized URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlHref001', 0, function () { it('testUrlHref001', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment')
...@@ -1114,7 +2189,6 @@ describe('UrlFunTest', function () { ...@@ -1114,7 +2189,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlHref002 * @tc.name: testUrlHref002
* @tc.desc: Gets and sets the serialized URL. * @tc.desc: Gets and sets the serialized URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlHref002', 0, function () { it('testUrlHref002', 0, function () {
let params = new Url.URL('http://host:8080/directory/file?query#fragment') let params = new Url.URL('http://host:8080/directory/file?query#fragment')
...@@ -1125,7 +2199,6 @@ describe('UrlFunTest', function () { ...@@ -1125,7 +2199,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlHref003 * @tc.name: testUrlHref003
* @tc.desc: Gets and sets the serialized URL. * @tc.desc: Gets and sets the serialized URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlHref003', 0, function () { it('testUrlHref003', 0, function () {
let params = new Url.URL('http://username:password@host:8080') let params = new Url.URL('http://username:password@host:8080')
...@@ -1136,7 +2209,6 @@ describe('UrlFunTest', function () { ...@@ -1136,7 +2209,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlHref004 * @tc.name: testUrlHref004
* @tc.desc: Gets and sets the serialized URL. * @tc.desc: Gets and sets the serialized URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlHref004', 0, function () { it('testUrlHref004', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment')
...@@ -1148,7 +2220,6 @@ describe('UrlFunTest', function () { ...@@ -1148,7 +2220,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlHref005 * @tc.name: testUrlHref005
* @tc.desc: Gets and sets the serialized URL. * @tc.desc: Gets and sets the serialized URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlHref005', 0, function () { it('testUrlHref005', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment')
...@@ -1160,7 +2231,6 @@ describe('UrlFunTest', function () { ...@@ -1160,7 +2231,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlOrigin001 * @tc.name: testUrlOrigin001
* @tc.desc: Gets the read-only serialization of the URL's origin. * @tc.desc: Gets the read-only serialization of the URL's origin.
* @tc.author: zhaoduwei
*/ */
it('testUrlOrigin001', 0, function () { it('testUrlOrigin001', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment')
...@@ -1171,7 +2241,6 @@ describe('UrlFunTest', function () { ...@@ -1171,7 +2241,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlOrigin002 * @tc.name: testUrlOrigin002
* @tc.desc: Gets the read-only serialization of the URL's origin. * @tc.desc: Gets the read-only serialization of the URL's origin.
* @tc.author: zhaoduwei
*/ */
it('testUrlOrigin002', 0, function () { it('testUrlOrigin002', 0, function () {
let params = new Url.URL('http://username:password@host:11/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:11/directory/file?query#fragment')
...@@ -1182,7 +2251,6 @@ describe('UrlFunTest', function () { ...@@ -1182,7 +2251,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlOrigin003 * @tc.name: testUrlOrigin003
* @tc.desc: Gets the read-only serialization of the URL's origin. * @tc.desc: Gets the read-only serialization of the URL's origin.
* @tc.author: zhaoduwei
*/ */
it('testUrlOrigin003', 0, function () { it('testUrlOrigin003', 0, function () {
let params = new Url.URL('http://username:password@host/directory/file?query#fragment') let params = new Url.URL('http://username:password@host/directory/file?query#fragment')
...@@ -1193,7 +2261,6 @@ describe('UrlFunTest', function () { ...@@ -1193,7 +2261,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlOrigin004 * @tc.name: testUrlOrigin004
* @tc.desc: Gets the read-only serialization of the URL's origin. * @tc.desc: Gets the read-only serialization of the URL's origin.
* @tc.author: zhaoduwei
*/ */
it('testUrlOrigin004', 0, function () { it('testUrlOrigin004', 0, function () {
let params = new Url.URL('http://username:password@aaaasshost:212/directory/file?query#fragment') let params = new Url.URL('http://username:password@aaaasshost:212/directory/file?query#fragment')
...@@ -1204,7 +2271,6 @@ describe('UrlFunTest', function () { ...@@ -1204,7 +2271,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlOrigin005 * @tc.name: testUrlOrigin005
* @tc.desc: Gets the read-only serialization of the URL's origin. * @tc.desc: Gets the read-only serialization of the URL's origin.
* @tc.author: zhaoduwei
*/ */
it('testUrlOrigin005', 0, function () { it('testUrlOrigin005', 0, function () {
let params = new Url.URL('http://username:password@host22:100#fragment') let params = new Url.URL('http://username:password@host22:100#fragment')
...@@ -1215,7 +2281,6 @@ describe('UrlFunTest', function () { ...@@ -1215,7 +2281,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlProtocol001 * @tc.name: testUrlProtocol001
* @tc.desc: Gets and sets the protocol portion of the URL. * @tc.desc: Gets and sets the protocol portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlProtocol001', 0, function () { it('testUrlProtocol001', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment')
...@@ -1226,7 +2291,6 @@ describe('UrlFunTest', function () { ...@@ -1226,7 +2291,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlProtocol002 * @tc.name: testUrlProtocol002
* @tc.desc: Gets and sets the protocol portion of the URL. * @tc.desc: Gets and sets the protocol portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlProtocol002', 0, function () { it('testUrlProtocol002', 0, function () {
let params = new Url.URL('http1://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http1://username:password@host:8080/directory/file?query#fragment')
...@@ -1237,7 +2301,6 @@ describe('UrlFunTest', function () { ...@@ -1237,7 +2301,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlProtocol003 * @tc.name: testUrlProtocol003
* @tc.desc: Gets and sets the protocol portion of the URL. * @tc.desc: Gets and sets the protocol portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlProtocol003', 0, function () { it('testUrlProtocol003', 0, function () {
let params = new Url.URL('https://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('https://username:password@host:8080/directory/file?query#fragment')
...@@ -1248,7 +2311,6 @@ describe('UrlFunTest', function () { ...@@ -1248,7 +2311,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlProtocol004 * @tc.name: testUrlProtocol004
* @tc.desc: Gets and sets the protocol portion of the URL. * @tc.desc: Gets and sets the protocol portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlProtocol004', 0, function () { it('testUrlProtocol004', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment')
...@@ -1260,7 +2322,6 @@ describe('UrlFunTest', function () { ...@@ -1260,7 +2322,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlProtocol005 * @tc.name: testUrlProtocol005
* @tc.desc: Gets and sets the protocol portion of the URL. * @tc.desc: Gets and sets the protocol portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlProtocol005', 0, function () { it('testUrlProtocol005', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment')
...@@ -1272,7 +2333,6 @@ describe('UrlFunTest', function () { ...@@ -1272,7 +2333,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlUsername001 * @tc.name: testUrlUsername001
* @tc.desc: Gets and sets the username portion of the URL. * @tc.desc: Gets and sets the username portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlUsername001', 0, function () { it('testUrlUsername001', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment')
...@@ -1283,7 +2343,6 @@ describe('UrlFunTest', function () { ...@@ -1283,7 +2343,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlUsername002 * @tc.name: testUrlUsername002
* @tc.desc: Gets and sets the username portion of the URL. * @tc.desc: Gets and sets the username portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlUsername002', 0, function () { it('testUrlUsername002', 0, function () {
let params = new Url.URL('http://zhao:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://zhao:password@host:8080/directory/file?query#fragment')
...@@ -1294,7 +2353,6 @@ describe('UrlFunTest', function () { ...@@ -1294,7 +2353,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlUsername003 * @tc.name: testUrlUsername003
* @tc.desc: Gets and sets the username portion of the URL. * @tc.desc: Gets and sets the username portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlUsername003', 0, function () { it('testUrlUsername003', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment')
...@@ -1306,7 +2364,6 @@ describe('UrlFunTest', function () { ...@@ -1306,7 +2364,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlUsername004 * @tc.name: testUrlUsername004
* @tc.desc: Gets and sets the username portion of the URL. * @tc.desc: Gets and sets the username portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlUsername004', 0, function () { it('testUrlUsername004', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment')
...@@ -1318,7 +2375,6 @@ describe('UrlFunTest', function () { ...@@ -1318,7 +2375,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlUsername005 * @tc.name: testUrlUsername005
* @tc.desc: Gets and sets the username portion of the URL. * @tc.desc: Gets and sets the username portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlUsername005', 0, function () { it('testUrlUsername005', 0, function () {
let params = new Url.URL('http://usme@host:8080/directory/file?query#fragment') let params = new Url.URL('http://usme@host:8080/directory/file?query#fragment')
...@@ -1329,7 +2385,6 @@ describe('UrlFunTest', function () { ...@@ -1329,7 +2385,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlPassword001 * @tc.name: testUrlPassword001
* @tc.desc: Gets and sets the password portion of the URL. * @tc.desc: Gets and sets the password portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlPassword001', 0, function () { it('testUrlPassword001', 0, function () {
let params = new Url.URL('http://username:11@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:11@host:8080/directory/file?query#fragment')
...@@ -1340,7 +2395,6 @@ describe('UrlFunTest', function () { ...@@ -1340,7 +2395,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlPassword002 * @tc.name: testUrlPassword002
* @tc.desc: Gets and sets the password portion of the URL. * @tc.desc: Gets and sets the password portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlPassword002', 0, function () { it('testUrlPassword002', 0, function () {
let params = new Url.URL('http://username:23aa@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:23aa@host:8080/directory/file?query#fragment')
...@@ -1351,7 +2405,6 @@ describe('UrlFunTest', function () { ...@@ -1351,7 +2405,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlPassword003 * @tc.name: testUrlPassword003
* @tc.desc: Gets and sets the password portion of the URL. * @tc.desc: Gets and sets the password portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlPassword003', 0, function () { it('testUrlPassword003', 0, function () {
let params = new Url.URL('http://username@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username@host:8080/directory/file?query#fragment')
...@@ -1362,7 +2415,6 @@ describe('UrlFunTest', function () { ...@@ -1362,7 +2415,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlPassword004 * @tc.name: testUrlPassword004
* @tc.desc: Gets and sets the password portion of the URL. * @tc.desc: Gets and sets the password portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlPassword004', 0, function () { it('testUrlPassword004', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment')
...@@ -1374,7 +2426,6 @@ describe('UrlFunTest', function () { ...@@ -1374,7 +2426,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlPassword005 * @tc.name: testUrlPassword005
* @tc.desc: Gets and sets the password portion of the URL. * @tc.desc: Gets and sets the password portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlPassword005', 0, function () { it('testUrlPassword005', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment')
...@@ -1386,7 +2437,6 @@ describe('UrlFunTest', function () { ...@@ -1386,7 +2437,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlHost001 * @tc.name: testUrlHost001
* @tc.desc: Gets and sets the host portion of the URL. * @tc.desc: Gets and sets the host portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlHost001', 0, function () { it('testUrlHost001', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment')
...@@ -1397,7 +2447,6 @@ describe('UrlFunTest', function () { ...@@ -1397,7 +2447,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlHost002 * @tc.name: testUrlHost002
* @tc.desc: Gets and sets the host portion of the URL. * @tc.desc: Gets and sets the host portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlHost002', 0, function () { it('testUrlHost002', 0, function () {
let params = new Url.URL('http://username:password@hosthost/directory/file?query#fragment') let params = new Url.URL('http://username:password@hosthost/directory/file?query#fragment')
...@@ -1408,7 +2457,6 @@ describe('UrlFunTest', function () { ...@@ -1408,7 +2457,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlHost003 * @tc.name: testUrlHost003
* @tc.desc: Gets and sets the host portion of the URL. * @tc.desc: Gets and sets the host portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlHost003', 0, function () { it('testUrlHost003', 0, function () {
let params = new Url.URL('http://username:password@host:199/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:199/directory/file?query#fragment')
...@@ -1419,7 +2467,6 @@ describe('UrlFunTest', function () { ...@@ -1419,7 +2467,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlHost004 * @tc.name: testUrlHost004
* @tc.desc: Gets and sets the host portion of the URL. * @tc.desc: Gets and sets the host portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlHost004', 0, function () { it('testUrlHost004', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment')
...@@ -1431,7 +2478,6 @@ describe('UrlFunTest', function () { ...@@ -1431,7 +2478,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlHost005 * @tc.name: testUrlHost005
* @tc.desc: Gets and sets the host portion of the URL. * @tc.desc: Gets and sets the host portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlHost005', 0, function () { it('testUrlHost005', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment')
...@@ -1443,7 +2489,6 @@ describe('UrlFunTest', function () { ...@@ -1443,7 +2489,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlHostname001 * @tc.name: testUrlHostname001
* @tc.desc: Gets and sets the host name portion of the URL,not include the port. * @tc.desc: Gets and sets the host name portion of the URL,not include the port.
* @tc.author: zhaoduwei
*/ */
it('testUrlHostname001', 0, function () { it('testUrlHostname001', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment')
...@@ -1454,7 +2499,6 @@ describe('UrlFunTest', function () { ...@@ -1454,7 +2499,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlHostname002 * @tc.name: testUrlHostname002
* @tc.desc: Gets and sets the host name portion of the URL,not include the port. * @tc.desc: Gets and sets the host name portion of the URL,not include the port.
* @tc.author: zhaoduwei
*/ */
it('testUrlHostname002', 0, function () { it('testUrlHostname002', 0, function () {
let params = new Url.URL('http://username:password@host123:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host123:8080/directory/file?query#fragment')
...@@ -1465,7 +2509,6 @@ describe('UrlFunTest', function () { ...@@ -1465,7 +2509,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlHostname003 * @tc.name: testUrlHostname003
* @tc.desc: Gets and sets the host name portion of the URL,not include the port. * @tc.desc: Gets and sets the host name portion of the URL,not include the port.
* @tc.author: zhaoduwei
*/ */
it('testUrlHostname003', 0, function () { it('testUrlHostname003', 0, function () {
let params = new Url.URL('http://username:password@885ssa:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@885ssa:8080/directory/file?query#fragment')
...@@ -1476,7 +2519,6 @@ describe('UrlFunTest', function () { ...@@ -1476,7 +2519,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlHostname004 * @tc.name: testUrlHostname004
* @tc.desc: Gets and sets the host name portion of the URL,not include the port. * @tc.desc: Gets and sets the host name portion of the URL,not include the port.
* @tc.author: zhaoduwei
*/ */
it('testUrlHostname004', 0, function () { it('testUrlHostname004', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment')
...@@ -1488,7 +2530,6 @@ describe('UrlFunTest', function () { ...@@ -1488,7 +2530,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlHostname005 * @tc.name: testUrlHostname005
* @tc.desc: Gets and sets the host name portion of the URL,not include the port. * @tc.desc: Gets and sets the host name portion of the URL,not include the port.
* @tc.author: zhaoduwei
*/ */
it('testUrlHostname005', 0, function () { it('testUrlHostname005', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment')
...@@ -1500,7 +2541,6 @@ describe('UrlFunTest', function () { ...@@ -1500,7 +2541,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlPort001 * @tc.name: testUrlPort001
* @tc.desc: Gets and sets the port portion of the URL. * @tc.desc: Gets and sets the port portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlPort001', 0, function () { it('testUrlPort001', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment')
...@@ -1511,7 +2551,6 @@ describe('UrlFunTest', function () { ...@@ -1511,7 +2551,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlPort002 * @tc.name: testUrlPort002
* @tc.desc: Gets and sets the port portion of the URL. * @tc.desc: Gets and sets the port portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlPort002', 0, function () { it('testUrlPort002', 0, function () {
let params = new Url.URL('http://username:password@host:100/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:100/directory/file?query#fragment')
...@@ -1522,7 +2561,6 @@ describe('UrlFunTest', function () { ...@@ -1522,7 +2561,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlPort003 * @tc.name: testUrlPort003
* @tc.desc: Gets and sets the port portion of the URL. * @tc.desc: Gets and sets the port portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlPort003', 0, function () { it('testUrlPort003', 0, function () {
let params = new Url.URL('http://username:password@host/directory/file?query#fragment') let params = new Url.URL('http://username:password@host/directory/file?query#fragment')
...@@ -1533,7 +2571,6 @@ describe('UrlFunTest', function () { ...@@ -1533,7 +2571,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlPort004 * @tc.name: testUrlPort004
* @tc.desc: Gets and sets the port portion of the URL. * @tc.desc: Gets and sets the port portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlPort004', 0, function () { it('testUrlPort004', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment')
...@@ -1545,7 +2582,6 @@ describe('UrlFunTest', function () { ...@@ -1545,7 +2582,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlPort005 * @tc.name: testUrlPort005
* @tc.desc: Gets and sets the port portion of the URL. * @tc.desc: Gets and sets the port portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlPort005', 0, function () { it('testUrlPort005', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment')
...@@ -1557,7 +2593,6 @@ describe('UrlFunTest', function () { ...@@ -1557,7 +2593,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlPathname001 * @tc.name: testUrlPathname001
* @tc.desc: Gets and sets the path portion of the URL. * @tc.desc: Gets and sets the path portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlPathname001', 0, function () { it('testUrlPathname001', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment')
...@@ -1568,7 +2603,6 @@ describe('UrlFunTest', function () { ...@@ -1568,7 +2603,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlPathname002 * @tc.name: testUrlPathname002
* @tc.desc: Gets and sets the path portion of the URL. * @tc.desc: Gets and sets the path portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlPathname002', 0, function () { it('testUrlPathname002', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory?query#fragment')
...@@ -1579,7 +2613,6 @@ describe('UrlFunTest', function () { ...@@ -1579,7 +2613,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlPathname003 * @tc.name: testUrlPathname003
* @tc.desc: Gets and sets the path portion of the URL. * @tc.desc: Gets and sets the path portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlPathname003', 0, function () { it('testUrlPathname003', 0, function () {
let params = new Url.URL('http://username:password@host:8080?query#fragment') let params = new Url.URL('http://username:password@host:8080?query#fragment')
...@@ -1590,7 +2623,6 @@ describe('UrlFunTest', function () { ...@@ -1590,7 +2623,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlPathname004 * @tc.name: testUrlPathname004
* @tc.desc: Gets and sets the path portion of the URL. * @tc.desc: Gets and sets the path portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlPathname004', 0, function () { it('testUrlPathname004', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment')
...@@ -1602,7 +2634,6 @@ describe('UrlFunTest', function () { ...@@ -1602,7 +2634,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlPathname005 * @tc.name: testUrlPathname005
* @tc.desc: Gets and sets the path portion of the URL. * @tc.desc: Gets and sets the path portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlPathname005', 0, function () { it('testUrlPathname005', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query#fragment')
...@@ -1614,7 +2645,6 @@ describe('UrlFunTest', function () { ...@@ -1614,7 +2645,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSearch001 * @tc.name: testUrlSearch001
* @tc.desc: Gets and sets the serialized query portion of the URL. * @tc.desc: Gets and sets the serialized query portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlSearch001', 0, function () { it('testUrlSearch001', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query=qqqq#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query=qqqq#fragment')
...@@ -1625,7 +2655,6 @@ describe('UrlFunTest', function () { ...@@ -1625,7 +2655,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSearch002 * @tc.name: testUrlSearch002
* @tc.desc: Gets and sets the serialized query portion of the URL. * @tc.desc: Gets and sets the serialized query portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlSearch002', 0, function () { it('testUrlSearch002', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query=qqqq&ll=pp#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query=qqqq&ll=pp#fragment')
...@@ -1636,7 +2665,6 @@ describe('UrlFunTest', function () { ...@@ -1636,7 +2665,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSearch003 * @tc.name: testUrlSearch003
* @tc.desc: Gets and sets the serialized query portion of the URL. * @tc.desc: Gets and sets the serialized query portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlSearch003', 0, function () { it('testUrlSearch003', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?ppp9875=77#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?ppp9875=77#fragment')
...@@ -1647,7 +2675,6 @@ describe('UrlFunTest', function () { ...@@ -1647,7 +2675,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSearch004 * @tc.name: testUrlSearch004
* @tc.desc: Gets and sets the serialized query portion of the URL. * @tc.desc: Gets and sets the serialized query portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlSearch004', 0, function () { it('testUrlSearch004', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query=qqqq#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query=qqqq#fragment')
...@@ -1659,7 +2686,6 @@ describe('UrlFunTest', function () { ...@@ -1659,7 +2686,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSearch005 * @tc.name: testUrlSearch005
* @tc.desc: Gets and sets the serialized query portion of the URL. * @tc.desc: Gets and sets the serialized query portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlSearch005', 0, function () { it('testUrlSearch005', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query=qqqq#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query=qqqq#fragment')
...@@ -1671,7 +2697,6 @@ describe('UrlFunTest', function () { ...@@ -1671,7 +2697,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlHash001 * @tc.name: testUrlHash001
* @tc.desc: Gets and sets the fragment portion of the URL. * @tc.desc: Gets and sets the fragment portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlHash001', 0, function () { it('testUrlHash001', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query=pppppp#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query=pppppp#fragment')
...@@ -1682,7 +2707,6 @@ describe('UrlFunTest', function () { ...@@ -1682,7 +2707,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlHash002 * @tc.name: testUrlHash002
* @tc.desc: Gets and sets the fragment portion of the URL. * @tc.desc: Gets and sets the fragment portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlHash002', 0, function () { it('testUrlHash002', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query=pppppp#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query=pppppp#fragment')
...@@ -1694,7 +2718,6 @@ describe('UrlFunTest', function () { ...@@ -1694,7 +2718,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlHash003 * @tc.name: testUrlHash003
* @tc.desc: Gets and sets the fragment portion of the URL. * @tc.desc: Gets and sets the fragment portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlHash003', 0, function () { it('testUrlHash003', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query=pppppp#poiu') let params = new Url.URL('http://username:password@host:8080/directory/file?query=pppppp#poiu')
...@@ -1705,7 +2728,6 @@ describe('UrlFunTest', function () { ...@@ -1705,7 +2728,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlHash004 * @tc.name: testUrlHash004
* @tc.desc: Gets and sets the fragment portion of the URL. * @tc.desc: Gets and sets the fragment portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlHash004', 0, function () { it('testUrlHash004', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query=pppppp') let params = new Url.URL('http://username:password@host:8080/directory/file?query=pppppp')
...@@ -1716,7 +2738,6 @@ describe('UrlFunTest', function () { ...@@ -1716,7 +2738,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlHash005 * @tc.name: testUrlHash005
* @tc.desc: Gets and sets the fragment portion of the URL. * @tc.desc: Gets and sets the fragment portion of the URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlHash005', 0, function () { it('testUrlHash005', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query=pppppp#fragment') let params = new Url.URL('http://username:password@host:8080/directory/file?query=pppppp#fragment')
...@@ -1728,7 +2749,6 @@ describe('UrlFunTest', function () { ...@@ -1728,7 +2749,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSearchParams001 * @tc.name: testUrlSearchParams001
* @tc.desc: Gets the SearchParams portion of the URL * @tc.desc: Gets the SearchParams portion of the URL
* @tc.author: zhaoduwei
*/ */
it('testUrlSearchParams001', 0, function () { it('testUrlSearchParams001', 0, function () {
var that = new Url.URL('http://username:password@host:8080/directory/file?foo=1&bar=2'); var that = new Url.URL('http://username:password@host:8080/directory/file?foo=1&bar=2');
...@@ -1740,7 +2760,6 @@ describe('UrlFunTest', function () { ...@@ -1740,7 +2760,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSearchParams002 * @tc.name: testUrlSearchParams002
* @tc.desc: Gets the SearchParams portion of the URL * @tc.desc: Gets the SearchParams portion of the URL
* @tc.author: zhaoduwei
*/ */
it('testUrlSearchParams002', 0, function () { it('testUrlSearchParams002', 0, function () {
let that = new Url.URL('https://example.com?foo=1&bar=2') let that = new Url.URL('https://example.com?foo=1&bar=2')
...@@ -1753,7 +2772,6 @@ describe('UrlFunTest', function () { ...@@ -1753,7 +2772,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSearchParams003 * @tc.name: testUrlSearchParams003
* @tc.desc: Gets the SearchParams portion of the URL * @tc.desc: Gets the SearchParams portion of the URL
* @tc.author: zhaoduwei
*/ */
it('testUrlSearchParams003', 0, function () { it('testUrlSearchParams003', 0, function () {
let that = new Url.URL('https://example.com?d=value1&c=value2&b=大&4=key4') let that = new Url.URL('https://example.com?d=value1&c=value2&b=大&4=key4')
...@@ -1765,7 +2783,6 @@ describe('UrlFunTest', function () { ...@@ -1765,7 +2783,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSearchParams004 * @tc.name: testUrlSearchParams004
* @tc.desc: Gets the SearchParams portion of the URL * @tc.desc: Gets the SearchParams portion of the URL
* @tc.author: zhaoduwei
*/ */
it('testUrlSearchParams004', 0, function () { it('testUrlSearchParams004', 0, function () {
let that = new Url.URL('https://example.com?foo=1&bar=2') let that = new Url.URL('https://example.com?foo=1&bar=2')
...@@ -1778,7 +2795,6 @@ describe('UrlFunTest', function () { ...@@ -1778,7 +2795,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlSearchParams005 * @tc.name: testUrlSearchParams005
* @tc.desc: Gets the SearchParams portion of the URL * @tc.desc: Gets the SearchParams portion of the URL
* @tc.author: zhaoduwei
*/ */
it('testUrlSearchParams005', 0, function () { it('testUrlSearchParams005', 0, function () {
let that = new Url.URL('http://username:password@host:8080/directory/file?你好=china#qwer=da') let that = new Url.URL('http://username:password@host:8080/directory/file?你好=china#qwer=da')
...@@ -1790,7 +2806,6 @@ describe('UrlFunTest', function () { ...@@ -1790,7 +2806,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlToJson001 * @tc.name: testUrlToJson001
* @tc.desc: Returns the serialized URL as a string. * @tc.desc: Returns the serialized URL as a string.
* @tc.author: zhaoduwei
*/ */
it('testUrlToJson001', 0, function () { it('testUrlToJson001', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory/file?query=pppppp#qwer=da') let params = new Url.URL('http://username:password@host:8080/directory/file?query=pppppp#qwer=da')
...@@ -1801,7 +2816,6 @@ describe('UrlFunTest', function () { ...@@ -1801,7 +2816,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlToJson002 * @tc.name: testUrlToJson002
* @tc.desc: Returns the serialized URL as a string. * @tc.desc: Returns the serialized URL as a string.
* @tc.author: zhaoduwei
*/ */
it('testUrlToJson002', 0, function () { it('testUrlToJson002', 0, function () {
let params = new Url.URL('http://host:8080/directory/file?query=pppppp#qwer=da') let params = new Url.URL('http://host:8080/directory/file?query=pppppp#qwer=da')
...@@ -1812,7 +2826,6 @@ describe('UrlFunTest', function () { ...@@ -1812,7 +2826,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlToJson003 * @tc.name: testUrlToJson003
* @tc.desc: Returns the serialized URL as a string. * @tc.desc: Returns the serialized URL as a string.
* @tc.author: zhaoduwei
*/ */
it('testUrlToJson003', 0, function () { it('testUrlToJson003', 0, function () {
let params = new Url.URL('http://username:password@host:8080') let params = new Url.URL('http://username:password@host:8080')
...@@ -1823,7 +2836,6 @@ describe('UrlFunTest', function () { ...@@ -1823,7 +2836,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlToJson004 * @tc.name: testUrlToJson004
* @tc.desc: Returns the serialized URL as a string. * @tc.desc: Returns the serialized URL as a string.
* @tc.author: zhaoduwei
*/ */
it('testUrlToJson004', 0, function () { it('testUrlToJson004', 0, function () {
let params = new Url.URL('http11://username:password@host:8080?query=pppppp#qwer=da') let params = new Url.URL('http11://username:password@host:8080?query=pppppp#qwer=da')
...@@ -1834,7 +2846,6 @@ describe('UrlFunTest', function () { ...@@ -1834,7 +2846,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlToJson005 * @tc.name: testUrlToJson005
* @tc.desc: Returns the serialized URL as a string. * @tc.desc: Returns the serialized URL as a string.
* @tc.author: zhaoduwei
*/ */
it('testUrlToJson005', 0, function () { it('testUrlToJson005', 0, function () {
let params = new Url.URL('http://username:password@host:8080/directory') let params = new Url.URL('http://username:password@host:8080/directory')
...@@ -1845,7 +2856,6 @@ describe('UrlFunTest', function () { ...@@ -1845,7 +2856,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlIPv6001 * @tc.name: testUrlIPv6001
* @tc.desc: Gets and sets the serialized URL. * @tc.desc: Gets and sets the serialized URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlIPv6001', 0, function () { it('testUrlIPv6001', 0, function () {
let params = new Url.URL('http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html') let params = new Url.URL('http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html')
...@@ -1856,7 +2866,6 @@ describe('UrlFunTest', function () { ...@@ -1856,7 +2866,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlIPv6002 * @tc.name: testUrlIPv6002
* @tc.desc: Gets and sets the serialized URL. * @tc.desc: Gets and sets the serialized URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlIPv6002', 0, function () { it('testUrlIPv6002', 0, function () {
let params = new Url.URL('http://[1080:0:0:0:8:800:200C:417A]/index.html') let params = new Url.URL('http://[1080:0:0:0:8:800:200C:417A]/index.html')
...@@ -1867,7 +2876,6 @@ describe('UrlFunTest', function () { ...@@ -1867,7 +2876,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlIPv6003 * @tc.name: testUrlIPv6003
* @tc.desc: Gets and sets the serialized URL. * @tc.desc: Gets and sets the serialized URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlIPv6003', 0, function () { it('testUrlIPv6003', 0, function () {
let params = new Url.URL('http://[::FFFF:129.144.52.38]:80/index.html') let params = new Url.URL('http://[::FFFF:129.144.52.38]:80/index.html')
...@@ -1878,7 +2886,6 @@ describe('UrlFunTest', function () { ...@@ -1878,7 +2886,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlIPv4001 * @tc.name: testUrlIPv4001
* @tc.desc: Gets and sets the serialized URL. * @tc.desc: Gets and sets the serialized URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlIPv4001', 0, function () { it('testUrlIPv4001', 0, function () {
let params = new Url.URL('http://0377.0xff.255.1:80/index.html') let params = new Url.URL('http://0377.0xff.255.1:80/index.html')
...@@ -1889,7 +2896,6 @@ describe('UrlFunTest', function () { ...@@ -1889,7 +2896,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlIPv4002 * @tc.name: testUrlIPv4002
* @tc.desc: Gets and sets the serialized URL. * @tc.desc: Gets and sets the serialized URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlIPv4002', 0, function () { it('testUrlIPv4002', 0, function () {
let params = new Url.URL('http://0377.0xff.255.g/index.html') let params = new Url.URL('http://0377.0xff.255.g/index.html')
...@@ -1900,7 +2906,6 @@ describe('UrlFunTest', function () { ...@@ -1900,7 +2906,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlIPv4003 * @tc.name: testUrlIPv4003
* @tc.desc: Gets and sets the serialized URL. * @tc.desc: Gets and sets the serialized URL.
* @tc.author: zhaoduwei
*/ */
it('testUrlIPv4003', 0, function () { it('testUrlIPv4003', 0, function () {
let params = new Url.URL('http://190.254.245.9:80/index.html') let params = new Url.URL('http://190.254.245.9:80/index.html')
...@@ -1911,7 +2916,6 @@ describe('UrlFunTest', function () { ...@@ -1911,7 +2916,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlConstruction001 * @tc.name: testUrlConstruction001
* @tc.desc: URL constructor, which is used to instantiate a URL object. * @tc.desc: URL constructor, which is used to instantiate a URL object.
* @tc.author: zhaoduwei
*/ */
it('testUrlConstruction001', 0, function () { it('testUrlConstruction001', 0, function () {
let params = new Url.URL('https://developer.mozilla.org',) let params = new Url.URL('https://developer.mozilla.org',)
...@@ -1922,7 +2926,6 @@ describe('UrlFunTest', function () { ...@@ -1922,7 +2926,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlConstruction002 * @tc.name: testUrlConstruction002
* @tc.desc: URL constructor, which is used to instantiate a URL object. * @tc.desc: URL constructor, which is used to instantiate a URL object.
* @tc.author: zhaoduwei
*/ */
it('testUrlConstruction002', 0, function () { it('testUrlConstruction002', 0, function () {
let params = new Url.URL('https://developer.mozilla.org','flie:/developer.mozilla.org') let params = new Url.URL('https://developer.mozilla.org','flie:/developer.mozilla.org')
...@@ -1933,7 +2936,6 @@ describe('UrlFunTest', function () { ...@@ -1933,7 +2936,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlConstruction003 * @tc.name: testUrlConstruction003
* @tc.desc: URL constructor, which is used to instantiate a URL object. * @tc.desc: URL constructor, which is used to instantiate a URL object.
* @tc.author: zhaoduwei
*/ */
it('testUrlConstruction003', 0, function () { it('testUrlConstruction003', 0, function () {
let params = new Url.URL('https://developer.mozilla.org','ftp://www.example.com') let params = new Url.URL('https://developer.mozilla.org','ftp://www.example.com')
...@@ -1944,7 +2946,6 @@ describe('UrlFunTest', function () { ...@@ -1944,7 +2946,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlConstruction004 * @tc.name: testUrlConstruction004
* @tc.desc: URL constructor, which is used to instantiate a URL object. * @tc.desc: URL constructor, which is used to instantiate a URL object.
* @tc.author: zhaoduwei
*/ */
it('testUrlConstruction004', 0, function () { it('testUrlConstruction004', 0, function () {
let params = new Url.URL(' ', 'http://www.example.com') let params = new Url.URL(' ', 'http://www.example.com')
...@@ -1955,7 +2956,6 @@ describe('UrlFunTest', function () { ...@@ -1955,7 +2956,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlConstruction005 * @tc.name: testUrlConstruction005
* @tc.desc: URL constructor, which is used to instantiate a URL object. * @tc.desc: URL constructor, which is used to instantiate a URL object.
* @tc.author: zhaoduwei
*/ */
it('testUrlConstruction005', 0, function () { it('testUrlConstruction005', 0, function () {
let params = new Url.URL('.', 'http://www.example.com') let params = new Url.URL('.', 'http://www.example.com')
...@@ -1966,7 +2966,6 @@ describe('UrlFunTest', function () { ...@@ -1966,7 +2966,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlConstruction006 * @tc.name: testUrlConstruction006
* @tc.desc: URL constructor, which is used to instantiate a URL object. * @tc.desc: URL constructor, which is used to instantiate a URL object.
* @tc.author: zhaoduwei
*/ */
it('testUrlConstruction006', 0, function () { it('testUrlConstruction006', 0, function () {
let params = new Url.URL('../h:', 'http://www.example.com') let params = new Url.URL('../h:', 'http://www.example.com')
...@@ -1977,7 +2976,6 @@ describe('UrlFunTest', function () { ...@@ -1977,7 +2976,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlConstruction007 * @tc.name: testUrlConstruction007
* @tc.desc: URL constructor, which is used to instantiate a URL object. * @tc.desc: URL constructor, which is used to instantiate a URL object.
* @tc.author: zhaoduwei
*/ */
it('testUrlConstruction007', 0, function () { it('testUrlConstruction007', 0, function () {
let params = new Url.URL('/sca/./path/path/../scasa/jjjjj', 'http://www.example.com') let params = new Url.URL('/sca/./path/path/../scasa/jjjjj', 'http://www.example.com')
...@@ -1988,7 +2986,6 @@ describe('UrlFunTest', function () { ...@@ -1988,7 +2986,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlConstruction008 * @tc.name: testUrlConstruction008
* @tc.desc: URL constructor, which is used to instantiate a URL object. * @tc.desc: URL constructor, which is used to instantiate a URL object.
* @tc.author: zhaoduwei
*/ */
it('testUrlConstruction008', 0, function () { it('testUrlConstruction008', 0, function () {
let params = new Url.URL('/../sca/./path/path/../scasa/jjjjj', 'http://www.example.com') let params = new Url.URL('/../sca/./path/path/../scasa/jjjjj', 'http://www.example.com')
...@@ -1999,7 +2996,6 @@ describe('UrlFunTest', function () { ...@@ -1999,7 +2996,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlConstruction009 * @tc.name: testUrlConstruction009
* @tc.desc: URL constructor, which is used to instantiate a URL object. * @tc.desc: URL constructor, which is used to instantiate a URL object.
* @tc.author: zhaoduwei
*/ */
it('testUrlConstruction009', 0, function () { it('testUrlConstruction009', 0, function () {
let params = new Url.URL( '/../sca/./path/path/../scasa/jjjjj', 'file://www.example.com') let params = new Url.URL( '/../sca/./path/path/../scasa/jjjjj', 'file://www.example.com')
...@@ -2010,7 +3006,6 @@ describe('UrlFunTest', function () { ...@@ -2010,7 +3006,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlConstruction010 * @tc.name: testUrlConstruction010
* @tc.desc: URL constructor, which is used to instantiate a URL object. * @tc.desc: URL constructor, which is used to instantiate a URL object.
* @tc.author: zhaoduwei
*/ */
it('testUrlConstruction010', 0, function () { it('testUrlConstruction010', 0, function () {
let params = new Url.URL('/../sca/./path/path/../scasa/jjjjj', 'file1://www.example.com') let params = new Url.URL('/../sca/./path/path/../scasa/jjjjj', 'file1://www.example.com')
...@@ -2021,7 +3016,6 @@ describe('UrlFunTest', function () { ...@@ -2021,7 +3016,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlConstruction011 * @tc.name: testUrlConstruction011
* @tc.desc: URL constructor, which is used to instantiate a URL object. * @tc.desc: URL constructor, which is used to instantiate a URL object.
* @tc.author: zhaoduwei
*/ */
it('testUrlConstruction011', 0, function () { it('testUrlConstruction011', 0, function () {
let params = new Url.URL('htt1p://www.0902zy.cn/path?abc=123&def=456#yyyy') let params = new Url.URL('htt1p://www.0902zy.cn/path?abc=123&def=456#yyyy')
...@@ -2033,7 +3027,6 @@ describe('UrlFunTest', function () { ...@@ -2033,7 +3027,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlConstruction012 * @tc.name: testUrlConstruction012
* @tc.desc: URL constructor, which is used to instantiate a URL object. * @tc.desc: URL constructor, which is used to instantiate a URL object.
* @tc.author: zhaoduwei
*/ */
it('testUrlConstruction012', 0, function () { it('testUrlConstruction012', 0, function () {
let params = new Url.URL('htt1p://www.0902zy.cn/path?abc=123&def=456#yyyy') let params = new Url.URL('htt1p://www.0902zy.cn/path?abc=123&def=456#yyyy')
...@@ -2045,7 +3038,6 @@ describe('UrlFunTest', function () { ...@@ -2045,7 +3038,6 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlConstruction013 * @tc.name: testUrlConstruction013
* @tc.desc: URL constructor, which is used to instantiate a URL object. * @tc.desc: URL constructor, which is used to instantiate a URL object.
* @tc.author: zhaoduwei
*/ */
it('testUrlConstruction013', 0, function () { it('testUrlConstruction013', 0, function () {
let params = new Url.URL('htt1p://www.0902zy.cn/path?abc=123&def=456#yyyy') let params = new Url.URL('htt1p://www.0902zy.cn/path?abc=123&def=456#yyyy')
...@@ -2057,11 +3049,151 @@ describe('UrlFunTest', function () { ...@@ -2057,11 +3049,151 @@ describe('UrlFunTest', function () {
/** /**
* @tc.name: testUrlConstruction014 * @tc.name: testUrlConstruction014
* @tc.desc: URL constructor, which is used to instantiate a URL object. * @tc.desc: URL constructor, which is used to instantiate a URL object.
* @tc.author: zhaoduwei
*/ */
it('testUrlConstruction014', 0, function () { it('testUrlConstruction014', 0, function () {
let params = new Url.URL('htt1p://www.0902zy.cn/path?abc=123&def=456#yyyy') let params = new Url.URL('htt1p://www.0902zy.cn/path?abc=123&def=456#yyyy')
var result = params.searchParams.toString(); var result = params.searchParams.toString();
expect(result).assertEqual('abc=123&def=456') expect(result).assertEqual('abc=123&def=456')
}) })
/**
* @tc.name: testUrlparseURL001
* @tc.desc: URL constructor, which is used to instantiate a URL object.
*/
it('testUrlparseURL001', 0, function () {
let params = new Url.URL()
params.parseURL('https://developer.mozilla.org',)
var result= params.href
expect(result).assertEqual('https://developer.mozilla.org/')
})
/**
* @tc.name: testUrlparseURL002
* @tc.desc: URL constructor, which is used to instantiate a URL object.
*/
it('testUrlparseURL002', 0, function () {
let params = new Url.URL()
params.parseURL('https://developer.mozilla.org','flie:/developer.mozilla.org')
var result= params.href
expect(result).assertEqual('https://developer.mozilla.org/')
})
/**
* @tc.name: testUrlparseURL003
* @tc.desc: URL constructor, which is used to instantiate a URL object.
*/
it('testUrlparseURL003', 0, function () {
let params = new Url.URL()
params.parseURL('https://developer.mozilla.org','ftp://www.example.com')
var result= params.href
expect(result).assertEqual('https://developer.mozilla.org/')
})
/**
* @tc.name: testUrlparseURL004
* @tc.desc: URL constructor, which is used to instantiate a URL object.
*/
it('testUrlparseURL004', 0, function () {
let params = new Url.URL()
params.parseURL(' ', 'http://www.example.com')
var result= params.href
expect(result).assertEqual('http://www.example.com/')
})
/**
* @tc.name: testUrlparseURL005
* @tc.desc: URL constructor, which is used to instantiate a URL object.
*/
it('testUrlparseURL005', 0, function () {
let params = new Url.URL()
params.parseURL('.', 'http://www.example.com')
var result= params.href
expect(result).assertEqual('http://www.example.com/')
})
/**
* @tc.name: testUrlparseURL006
* @tc.desc: URL constructor, which is used to instantiate a URL object.
*/
it('testUrlparseURL006', 0, function () {
let params = new Url.URL()
params.parseURL('../h:', 'http://www.example.com')
var result= params.href
expect(result).assertEqual('http://www.example.com/h:')
})
/**
* @tc.name: testUrlparseURL007
* @tc.desc: URL constructor, BusinessError: Parameter error.
*/
it('testUrlparseURL007', 0, function () {
try{
let params = new Url.URL()
var a = undefined
params.parseURL(a)
var result= params.href
expect(0).assertEqual(1)
} catch(err) {
expect(err.toString()).assertEqual(`BusinessError: Parameter error.The type of ${a} must be string`)
expect(err.code).assertEqual(401)
expect(err.message).assertEqual(`Parameter error.The type of ${a} must be string`);
}
})
/**
* @tc.name: testUrlparseURL008
* @tc.desc: URL constructor, BusinessError: Parameter error.
*/
it('testUrlparseURL008', 0, function () {
try{
let params = new Url.URL()
var a = 666;
var b = 666;
params.parseURL(a, b)
var result= params.href
expect(0).assertEqual(1)
} catch(err) {
expect(err.toString()).assertEqual(`BusinessError: Parameter error.The type of ${a} must be string`)
expect(err.code).assertEqual(401)
expect(err.message).assertEqual(`Parameter error.The type of ${a} must be string`);
}
})
/**
* @tc.name: testUrlparseURL009
* @tc.desc: URL constructor, throw BusinessError:Parameter error.
*/
it('testUrlparseURL009', 0, function () {
try{
let params = new Url.URL()
var a = '666666';
var b = 666666;
params.parseURL(a, b)
var result= params.href
expect(0).assertEqual(1)
} catch(err) {
expect(err.toString()).assertEqual(`BusinessError: Parameter error.The type of ${b} must be string or URL`);
expect(err.code).assertEqual(401)
expect(err.message).assertEqual(`Parameter error.The type of ${b} must be string or URL`);
}
})
/**
* @tc.name: testUrlparseURL0010
* @tc.desc: URL constructor, throw BusinessError: Syntax Error. Invalid Url string.
*/
it('testUrlparseURL0010', 0, function () {
try{
let params = new Url.URL()
var a = '666666';
var b = "666666";
params.parseURL(a, b)
var result= params.href
expect(0).assertEqual(1)
} catch(err) {
expect(err.toString()).assertEqual(`BusinessError: Syntax Error. Invalid Url string`)
expect(err.code).assertEqual(10200002)
expect(err.message).assertEqual(`Syntax Error. Invalid Url string`);
}
})
})} })}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册