PageRenderTime 68ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/netwerk/test/gtest/urltestdata.json

https://bitbucket.org/vionika/spin.android
JSON | 6480 lines | 6480 code | 0 blank | 0 comment | 0 complexity | beaecb578fd4304c61d005b379b41a81 MD5 | raw file
Possible License(s): JSON, 0BSD, AGPL-1.0, BSD-2-Clause, GPL-3.0, LGPL-2.1, LGPL-3.0, CC0-1.0, AGPL-3.0, MPL-2.0, Apache-2.0, MIT, BSD-3-Clause, MPL-2.0-no-copyleft-exception, GPL-2.0, Unlicense
  1. [
  2. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/segments.js",
  3. {
  4. "input": "http://example\t.\norg",
  5. "base": "http://example.org/foo/bar",
  6. "href": "http://example.org/",
  7. "origin": "http://example.org",
  8. "protocol": "http:",
  9. "username": "",
  10. "password": "",
  11. "host": "example.org",
  12. "hostname": "example.org",
  13. "port": "",
  14. "pathname": "/",
  15. "search": "",
  16. "hash": ""
  17. },
  18. {
  19. "input": "http://user:pass@foo:21/bar;par?b#c",
  20. "base": "http://example.org/foo/bar",
  21. "href": "http://user:pass@foo:21/bar;par?b#c",
  22. "origin": "http://foo:21",
  23. "protocol": "http:",
  24. "username": "user",
  25. "password": "pass",
  26. "host": "foo:21",
  27. "hostname": "foo",
  28. "port": "21",
  29. "pathname": "/bar;par",
  30. "search": "?b",
  31. "hash": "#c"
  32. },
  33. {
  34. "input": "https://test:@test",
  35. "base": "about:blank",
  36. "href": "https://test@test/",
  37. "origin": "https://test",
  38. "protocol": "https:",
  39. "username": "test",
  40. "password": "",
  41. "host": "test",
  42. "hostname": "test",
  43. "port": "",
  44. "pathname": "/",
  45. "search": "",
  46. "hash": ""
  47. },
  48. {
  49. "input": "https://:@test",
  50. "base": "about:blank",
  51. "href": "https://test/",
  52. "origin": "https://test",
  53. "protocol": "https:",
  54. "username": "",
  55. "password": "",
  56. "host": "test",
  57. "hostname": "test",
  58. "port": "",
  59. "pathname": "/",
  60. "search": "",
  61. "hash": ""
  62. },
  63. {
  64. "input": "non-special://test:@test/x",
  65. "base": "about:blank",
  66. "href": "non-special://test@test/x",
  67. "origin": "null",
  68. "protocol": "non-special:",
  69. "username": "test",
  70. "password": "",
  71. "host": "test",
  72. "hostname": "test",
  73. "port": "",
  74. "pathname": "/x",
  75. "search": "",
  76. "hash": ""
  77. },
  78. {
  79. "input": "non-special://:@test/x",
  80. "base": "about:blank",
  81. "href": "non-special://test/x",
  82. "origin": "null",
  83. "protocol": "non-special:",
  84. "username": "",
  85. "password": "",
  86. "host": "test",
  87. "hostname": "test",
  88. "port": "",
  89. "pathname": "/x",
  90. "search": "",
  91. "hash": ""
  92. },
  93. {
  94. "input": "http:foo.com",
  95. "base": "http://example.org/foo/bar",
  96. "href": "http://example.org/foo/foo.com",
  97. "origin": "http://example.org",
  98. "protocol": "http:",
  99. "username": "",
  100. "password": "",
  101. "host": "example.org",
  102. "hostname": "example.org",
  103. "port": "",
  104. "pathname": "/foo/foo.com",
  105. "search": "",
  106. "hash": ""
  107. },
  108. {
  109. "input": "\t :foo.com \n",
  110. "base": "http://example.org/foo/bar",
  111. "href": "http://example.org/foo/:foo.com",
  112. "origin": "http://example.org",
  113. "protocol": "http:",
  114. "username": "",
  115. "password": "",
  116. "host": "example.org",
  117. "hostname": "example.org",
  118. "port": "",
  119. "pathname": "/foo/:foo.com",
  120. "search": "",
  121. "hash": ""
  122. },
  123. {
  124. "input": " foo.com ",
  125. "base": "http://example.org/foo/bar",
  126. "href": "http://example.org/foo/foo.com",
  127. "origin": "http://example.org",
  128. "protocol": "http:",
  129. "username": "",
  130. "password": "",
  131. "host": "example.org",
  132. "hostname": "example.org",
  133. "port": "",
  134. "pathname": "/foo/foo.com",
  135. "search": "",
  136. "hash": ""
  137. },
  138. {
  139. "input": "a:\t foo.com",
  140. "base": "http://example.org/foo/bar",
  141. "href": "a: foo.com",
  142. "origin": "null",
  143. "protocol": "a:",
  144. "username": "",
  145. "password": "",
  146. "host": "",
  147. "hostname": "",
  148. "port": "",
  149. "pathname": " foo.com",
  150. "search": "",
  151. "hash": ""
  152. },
  153. {
  154. "input": "http://f:21/ b ? d # e ",
  155. "base": "http://example.org/foo/bar",
  156. "href": "http://f:21/%20b%20?%20d%20# e",
  157. "origin": "http://f:21",
  158. "protocol": "http:",
  159. "username": "",
  160. "password": "",
  161. "host": "f:21",
  162. "hostname": "f",
  163. "port": "21",
  164. "pathname": "/%20b%20",
  165. "search": "?%20d%20",
  166. "hash": "# e"
  167. },
  168. {
  169. "input": "lolscheme:x x#x x",
  170. "base": "about:blank",
  171. "href": "lolscheme:x x#x x",
  172. "protocol": "lolscheme:",
  173. "username": "",
  174. "password": "",
  175. "host": "",
  176. "hostname": "",
  177. "port": "",
  178. "pathname": "x x",
  179. "search": "",
  180. "hash": "#x x"
  181. },
  182. {
  183. "input": "http://f:/c",
  184. "base": "http://example.org/foo/bar",
  185. "href": "http://f/c",
  186. "origin": "http://f",
  187. "protocol": "http:",
  188. "username": "",
  189. "password": "",
  190. "host": "f",
  191. "hostname": "f",
  192. "port": "",
  193. "pathname": "/c",
  194. "search": "",
  195. "hash": ""
  196. },
  197. {
  198. "input": "http://f:0/c",
  199. "base": "http://example.org/foo/bar",
  200. "href": "http://f:0/c",
  201. "origin": "http://f:0",
  202. "protocol": "http:",
  203. "username": "",
  204. "password": "",
  205. "host": "f:0",
  206. "hostname": "f",
  207. "port": "0",
  208. "pathname": "/c",
  209. "search": "",
  210. "hash": ""
  211. },
  212. {
  213. "input": "http://f:00000000000000/c",
  214. "base": "http://example.org/foo/bar",
  215. "href": "http://f:0/c",
  216. "origin": "http://f:0",
  217. "protocol": "http:",
  218. "username": "",
  219. "password": "",
  220. "host": "f:0",
  221. "hostname": "f",
  222. "port": "0",
  223. "pathname": "/c",
  224. "search": "",
  225. "hash": ""
  226. },
  227. {
  228. "input": "http://f:00000000000000000000080/c",
  229. "base": "http://example.org/foo/bar",
  230. "href": "http://f/c",
  231. "origin": "http://f",
  232. "protocol": "http:",
  233. "username": "",
  234. "password": "",
  235. "host": "f",
  236. "hostname": "f",
  237. "port": "",
  238. "pathname": "/c",
  239. "search": "",
  240. "hash": ""
  241. },
  242. {
  243. "input": "http://f:b/c",
  244. "base": "http://example.org/foo/bar",
  245. "failure": true
  246. },
  247. {
  248. "input": "http://f: /c",
  249. "base": "http://example.org/foo/bar",
  250. "failure": true
  251. },
  252. {
  253. "input": "http://f:\n/c",
  254. "base": "http://example.org/foo/bar",
  255. "href": "http://f/c",
  256. "origin": "http://f",
  257. "protocol": "http:",
  258. "username": "",
  259. "password": "",
  260. "host": "f",
  261. "hostname": "f",
  262. "port": "",
  263. "pathname": "/c",
  264. "search": "",
  265. "hash": ""
  266. },
  267. {
  268. "input": "http://f:fifty-two/c",
  269. "base": "http://example.org/foo/bar",
  270. "failure": true
  271. },
  272. {
  273. "input": "http://f:999999/c",
  274. "base": "http://example.org/foo/bar",
  275. "failure": true
  276. },
  277. {
  278. "input": "non-special://f:999999/c",
  279. "base": "http://example.org/foo/bar",
  280. "failure": true
  281. },
  282. {
  283. "input": "http://f: 21 / b ? d # e ",
  284. "base": "http://example.org/foo/bar",
  285. "failure": true
  286. },
  287. {
  288. "input": "",
  289. "base": "http://example.org/foo/bar",
  290. "href": "http://example.org/foo/bar",
  291. "origin": "http://example.org",
  292. "protocol": "http:",
  293. "username": "",
  294. "password": "",
  295. "host": "example.org",
  296. "hostname": "example.org",
  297. "port": "",
  298. "pathname": "/foo/bar",
  299. "search": "",
  300. "hash": ""
  301. },
  302. {
  303. "input": " \t",
  304. "base": "http://example.org/foo/bar",
  305. "href": "http://example.org/foo/bar",
  306. "origin": "http://example.org",
  307. "protocol": "http:",
  308. "username": "",
  309. "password": "",
  310. "host": "example.org",
  311. "hostname": "example.org",
  312. "port": "",
  313. "pathname": "/foo/bar",
  314. "search": "",
  315. "hash": ""
  316. },
  317. {
  318. "input": ":foo.com/",
  319. "base": "http://example.org/foo/bar",
  320. "href": "http://example.org/foo/:foo.com/",
  321. "origin": "http://example.org",
  322. "protocol": "http:",
  323. "username": "",
  324. "password": "",
  325. "host": "example.org",
  326. "hostname": "example.org",
  327. "port": "",
  328. "pathname": "/foo/:foo.com/",
  329. "search": "",
  330. "hash": ""
  331. },
  332. {
  333. "input": ":foo.com\\",
  334. "base": "http://example.org/foo/bar",
  335. "href": "http://example.org/foo/:foo.com/",
  336. "origin": "http://example.org",
  337. "protocol": "http:",
  338. "username": "",
  339. "password": "",
  340. "host": "example.org",
  341. "hostname": "example.org",
  342. "port": "",
  343. "pathname": "/foo/:foo.com/",
  344. "search": "",
  345. "hash": ""
  346. },
  347. {
  348. "input": ":",
  349. "base": "http://example.org/foo/bar",
  350. "href": "http://example.org/foo/:",
  351. "origin": "http://example.org",
  352. "protocol": "http:",
  353. "username": "",
  354. "password": "",
  355. "host": "example.org",
  356. "hostname": "example.org",
  357. "port": "",
  358. "pathname": "/foo/:",
  359. "search": "",
  360. "hash": ""
  361. },
  362. {
  363. "input": ":a",
  364. "base": "http://example.org/foo/bar",
  365. "href": "http://example.org/foo/:a",
  366. "origin": "http://example.org",
  367. "protocol": "http:",
  368. "username": "",
  369. "password": "",
  370. "host": "example.org",
  371. "hostname": "example.org",
  372. "port": "",
  373. "pathname": "/foo/:a",
  374. "search": "",
  375. "hash": ""
  376. },
  377. {
  378. "input": ":/",
  379. "base": "http://example.org/foo/bar",
  380. "href": "http://example.org/foo/:/",
  381. "origin": "http://example.org",
  382. "protocol": "http:",
  383. "username": "",
  384. "password": "",
  385. "host": "example.org",
  386. "hostname": "example.org",
  387. "port": "",
  388. "pathname": "/foo/:/",
  389. "search": "",
  390. "hash": ""
  391. },
  392. {
  393. "input": ":\\",
  394. "base": "http://example.org/foo/bar",
  395. "href": "http://example.org/foo/:/",
  396. "origin": "http://example.org",
  397. "protocol": "http:",
  398. "username": "",
  399. "password": "",
  400. "host": "example.org",
  401. "hostname": "example.org",
  402. "port": "",
  403. "pathname": "/foo/:/",
  404. "search": "",
  405. "hash": ""
  406. },
  407. {
  408. "input": ":#",
  409. "base": "http://example.org/foo/bar",
  410. "href": "http://example.org/foo/:#",
  411. "origin": "http://example.org",
  412. "protocol": "http:",
  413. "username": "",
  414. "password": "",
  415. "host": "example.org",
  416. "hostname": "example.org",
  417. "port": "",
  418. "pathname": "/foo/:",
  419. "search": "",
  420. "hash": ""
  421. },
  422. {
  423. "input": "#",
  424. "base": "http://example.org/foo/bar",
  425. "href": "http://example.org/foo/bar#",
  426. "origin": "http://example.org",
  427. "protocol": "http:",
  428. "username": "",
  429. "password": "",
  430. "host": "example.org",
  431. "hostname": "example.org",
  432. "port": "",
  433. "pathname": "/foo/bar",
  434. "search": "",
  435. "hash": ""
  436. },
  437. {
  438. "input": "#/",
  439. "base": "http://example.org/foo/bar",
  440. "href": "http://example.org/foo/bar#/",
  441. "origin": "http://example.org",
  442. "protocol": "http:",
  443. "username": "",
  444. "password": "",
  445. "host": "example.org",
  446. "hostname": "example.org",
  447. "port": "",
  448. "pathname": "/foo/bar",
  449. "search": "",
  450. "hash": "#/"
  451. },
  452. {
  453. "input": "#\\",
  454. "base": "http://example.org/foo/bar",
  455. "href": "http://example.org/foo/bar#\\",
  456. "origin": "http://example.org",
  457. "protocol": "http:",
  458. "username": "",
  459. "password": "",
  460. "host": "example.org",
  461. "hostname": "example.org",
  462. "port": "",
  463. "pathname": "/foo/bar",
  464. "search": "",
  465. "hash": "#\\"
  466. },
  467. {
  468. "input": "#;?",
  469. "base": "http://example.org/foo/bar",
  470. "href": "http://example.org/foo/bar#;?",
  471. "origin": "http://example.org",
  472. "protocol": "http:",
  473. "username": "",
  474. "password": "",
  475. "host": "example.org",
  476. "hostname": "example.org",
  477. "port": "",
  478. "pathname": "/foo/bar",
  479. "search": "",
  480. "hash": "#;?"
  481. },
  482. {
  483. "input": "?",
  484. "base": "http://example.org/foo/bar",
  485. "href": "http://example.org/foo/bar?",
  486. "origin": "http://example.org",
  487. "protocol": "http:",
  488. "username": "",
  489. "password": "",
  490. "host": "example.org",
  491. "hostname": "example.org",
  492. "port": "",
  493. "pathname": "/foo/bar",
  494. "search": "",
  495. "hash": ""
  496. },
  497. {
  498. "input": "/",
  499. "base": "http://example.org/foo/bar",
  500. "href": "http://example.org/",
  501. "origin": "http://example.org",
  502. "protocol": "http:",
  503. "username": "",
  504. "password": "",
  505. "host": "example.org",
  506. "hostname": "example.org",
  507. "port": "",
  508. "pathname": "/",
  509. "search": "",
  510. "hash": ""
  511. },
  512. {
  513. "input": ":23",
  514. "base": "http://example.org/foo/bar",
  515. "href": "http://example.org/foo/:23",
  516. "origin": "http://example.org",
  517. "protocol": "http:",
  518. "username": "",
  519. "password": "",
  520. "host": "example.org",
  521. "hostname": "example.org",
  522. "port": "",
  523. "pathname": "/foo/:23",
  524. "search": "",
  525. "hash": ""
  526. },
  527. {
  528. "input": "/:23",
  529. "base": "http://example.org/foo/bar",
  530. "href": "http://example.org/:23",
  531. "origin": "http://example.org",
  532. "protocol": "http:",
  533. "username": "",
  534. "password": "",
  535. "host": "example.org",
  536. "hostname": "example.org",
  537. "port": "",
  538. "pathname": "/:23",
  539. "search": "",
  540. "hash": ""
  541. },
  542. {
  543. "input": "::",
  544. "base": "http://example.org/foo/bar",
  545. "href": "http://example.org/foo/::",
  546. "origin": "http://example.org",
  547. "protocol": "http:",
  548. "username": "",
  549. "password": "",
  550. "host": "example.org",
  551. "hostname": "example.org",
  552. "port": "",
  553. "pathname": "/foo/::",
  554. "search": "",
  555. "hash": ""
  556. },
  557. {
  558. "input": "::23",
  559. "base": "http://example.org/foo/bar",
  560. "href": "http://example.org/foo/::23",
  561. "origin": "http://example.org",
  562. "protocol": "http:",
  563. "username": "",
  564. "password": "",
  565. "host": "example.org",
  566. "hostname": "example.org",
  567. "port": "",
  568. "pathname": "/foo/::23",
  569. "search": "",
  570. "hash": ""
  571. },
  572. {
  573. "input": "foo://",
  574. "base": "http://example.org/foo/bar",
  575. "href": "foo:///",
  576. "origin": "null",
  577. "protocol": "foo:",
  578. "username": "",
  579. "password": "",
  580. "host": "",
  581. "hostname": "",
  582. "port": "",
  583. "pathname": "/",
  584. "search": "",
  585. "hash": ""
  586. },
  587. {
  588. "input": "http://a:b@c:29/d",
  589. "base": "http://example.org/foo/bar",
  590. "href": "http://a:b@c:29/d",
  591. "origin": "http://c:29",
  592. "protocol": "http:",
  593. "username": "a",
  594. "password": "b",
  595. "host": "c:29",
  596. "hostname": "c",
  597. "port": "29",
  598. "pathname": "/d",
  599. "search": "",
  600. "hash": ""
  601. },
  602. {
  603. "input": "http::@c:29",
  604. "base": "http://example.org/foo/bar",
  605. "href": "http://example.org/foo/:@c:29",
  606. "origin": "http://example.org",
  607. "protocol": "http:",
  608. "username": "",
  609. "password": "",
  610. "host": "example.org",
  611. "hostname": "example.org",
  612. "port": "",
  613. "pathname": "/foo/:@c:29",
  614. "search": "",
  615. "hash": ""
  616. },
  617. {
  618. "input": "http://&a:foo(b]c@d:2/",
  619. "base": "http://example.org/foo/bar",
  620. "href": "http://&a:foo(b%5Dc@d:2/",
  621. "origin": "http://d:2",
  622. "protocol": "http:",
  623. "username": "&a",
  624. "password": "foo(b%5Dc",
  625. "host": "d:2",
  626. "hostname": "d",
  627. "port": "2",
  628. "pathname": "/",
  629. "search": "",
  630. "hash": ""
  631. },
  632. {
  633. "input": "http://::@c@d:2",
  634. "base": "http://example.org/foo/bar",
  635. "href": "http://:%3A%40c@d:2/",
  636. "origin": "http://d:2",
  637. "protocol": "http:",
  638. "username": "",
  639. "password": "%3A%40c",
  640. "host": "d:2",
  641. "hostname": "d",
  642. "port": "2",
  643. "pathname": "/",
  644. "search": "",
  645. "hash": ""
  646. },
  647. {
  648. "input": "http://foo.com:b@d/",
  649. "base": "http://example.org/foo/bar",
  650. "href": "http://foo.com:b@d/",
  651. "origin": "http://d",
  652. "protocol": "http:",
  653. "username": "foo.com",
  654. "password": "b",
  655. "host": "d",
  656. "hostname": "d",
  657. "port": "",
  658. "pathname": "/",
  659. "search": "",
  660. "hash": ""
  661. },
  662. {
  663. "input": "http://foo.com/\\@",
  664. "base": "http://example.org/foo/bar",
  665. "href": "http://foo.com//@",
  666. "origin": "http://foo.com",
  667. "protocol": "http:",
  668. "username": "",
  669. "password": "",
  670. "host": "foo.com",
  671. "hostname": "foo.com",
  672. "port": "",
  673. "pathname": "//@",
  674. "search": "",
  675. "hash": ""
  676. },
  677. {
  678. "input": "http:\\\\foo.com\\",
  679. "base": "http://example.org/foo/bar",
  680. "href": "http://foo.com/",
  681. "origin": "http://foo.com",
  682. "protocol": "http:",
  683. "username": "",
  684. "password": "",
  685. "host": "foo.com",
  686. "hostname": "foo.com",
  687. "port": "",
  688. "pathname": "/",
  689. "search": "",
  690. "hash": ""
  691. },
  692. {
  693. "input": "http:\\\\a\\b:c\\d@foo.com\\",
  694. "base": "http://example.org/foo/bar",
  695. "href": "http://a/b:c/d@foo.com/",
  696. "origin": "http://a",
  697. "protocol": "http:",
  698. "username": "",
  699. "password": "",
  700. "host": "a",
  701. "hostname": "a",
  702. "port": "",
  703. "pathname": "/b:c/d@foo.com/",
  704. "search": "",
  705. "hash": ""
  706. },
  707. {
  708. "input": "foo:/",
  709. "base": "http://example.org/foo/bar",
  710. "href": "foo:/",
  711. "origin": "null",
  712. "protocol": "foo:",
  713. "username": "",
  714. "password": "",
  715. "host": "",
  716. "hostname": "",
  717. "port": "",
  718. "pathname": "/",
  719. "search": "",
  720. "hash": ""
  721. },
  722. {
  723. "input": "foo:/bar.com/",
  724. "base": "http://example.org/foo/bar",
  725. "href": "foo:/bar.com/",
  726. "origin": "null",
  727. "protocol": "foo:",
  728. "username": "",
  729. "password": "",
  730. "host": "",
  731. "hostname": "",
  732. "port": "",
  733. "pathname": "/bar.com/",
  734. "search": "",
  735. "hash": ""
  736. },
  737. {
  738. "input": "foo://///////",
  739. "base": "http://example.org/foo/bar",
  740. "href": "foo://///////",
  741. "origin": "null",
  742. "protocol": "foo:",
  743. "username": "",
  744. "password": "",
  745. "host": "",
  746. "hostname": "",
  747. "port": "",
  748. "pathname": "///////",
  749. "search": "",
  750. "hash": ""
  751. },
  752. {
  753. "input": "foo://///////bar.com/",
  754. "base": "http://example.org/foo/bar",
  755. "href": "foo://///////bar.com/",
  756. "origin": "null",
  757. "protocol": "foo:",
  758. "username": "",
  759. "password": "",
  760. "host": "",
  761. "hostname": "",
  762. "port": "",
  763. "pathname": "///////bar.com/",
  764. "search": "",
  765. "hash": ""
  766. },
  767. {
  768. "input": "foo:////://///",
  769. "base": "http://example.org/foo/bar",
  770. "href": "foo:////://///",
  771. "origin": "null",
  772. "protocol": "foo:",
  773. "username": "",
  774. "password": "",
  775. "host": "",
  776. "hostname": "",
  777. "port": "",
  778. "pathname": "//://///",
  779. "search": "",
  780. "hash": ""
  781. },
  782. {
  783. "input": "c:/foo",
  784. "base": "http://example.org/foo/bar",
  785. "href": "c:/foo",
  786. "origin": "null",
  787. "protocol": "c:",
  788. "username": "",
  789. "password": "",
  790. "host": "",
  791. "hostname": "",
  792. "port": "",
  793. "pathname": "/foo",
  794. "search": "",
  795. "hash": ""
  796. },
  797. {
  798. "input": "//foo/bar",
  799. "base": "http://example.org/foo/bar",
  800. "href": "http://foo/bar",
  801. "origin": "http://foo",
  802. "protocol": "http:",
  803. "username": "",
  804. "password": "",
  805. "host": "foo",
  806. "hostname": "foo",
  807. "port": "",
  808. "pathname": "/bar",
  809. "search": "",
  810. "hash": ""
  811. },
  812. {
  813. "input": "http://foo/path;a??e#f#g",
  814. "base": "http://example.org/foo/bar",
  815. "href": "http://foo/path;a??e#f#g",
  816. "origin": "http://foo",
  817. "protocol": "http:",
  818. "username": "",
  819. "password": "",
  820. "host": "foo",
  821. "hostname": "foo",
  822. "port": "",
  823. "pathname": "/path;a",
  824. "search": "??e",
  825. "hash": "#f#g"
  826. },
  827. {
  828. "input": "http://foo/abcd?efgh?ijkl",
  829. "base": "http://example.org/foo/bar",
  830. "href": "http://foo/abcd?efgh?ijkl",
  831. "origin": "http://foo",
  832. "protocol": "http:",
  833. "username": "",
  834. "password": "",
  835. "host": "foo",
  836. "hostname": "foo",
  837. "port": "",
  838. "pathname": "/abcd",
  839. "search": "?efgh?ijkl",
  840. "hash": ""
  841. },
  842. {
  843. "input": "http://foo/abcd#foo?bar",
  844. "base": "http://example.org/foo/bar",
  845. "href": "http://foo/abcd#foo?bar",
  846. "origin": "http://foo",
  847. "protocol": "http:",
  848. "username": "",
  849. "password": "",
  850. "host": "foo",
  851. "hostname": "foo",
  852. "port": "",
  853. "pathname": "/abcd",
  854. "search": "",
  855. "hash": "#foo?bar"
  856. },
  857. {
  858. "input": "[61:24:74]:98",
  859. "base": "http://example.org/foo/bar",
  860. "href": "http://example.org/foo/[61:24:74]:98",
  861. "origin": "http://example.org",
  862. "protocol": "http:",
  863. "username": "",
  864. "password": "",
  865. "host": "example.org",
  866. "hostname": "example.org",
  867. "port": "",
  868. "pathname": "/foo/[61:24:74]:98",
  869. "search": "",
  870. "hash": ""
  871. },
  872. {
  873. "input": "http:[61:27]/:foo",
  874. "base": "http://example.org/foo/bar",
  875. "href": "http://example.org/foo/[61:27]/:foo",
  876. "origin": "http://example.org",
  877. "protocol": "http:",
  878. "username": "",
  879. "password": "",
  880. "host": "example.org",
  881. "hostname": "example.org",
  882. "port": "",
  883. "pathname": "/foo/[61:27]/:foo",
  884. "search": "",
  885. "hash": ""
  886. },
  887. {
  888. "input": "http://[1::2]:3:4",
  889. "base": "http://example.org/foo/bar",
  890. "failure": true
  891. },
  892. {
  893. "input": "http://2001::1",
  894. "base": "http://example.org/foo/bar",
  895. "failure": true
  896. },
  897. {
  898. "input": "http://2001::1]",
  899. "base": "http://example.org/foo/bar",
  900. "failure": true
  901. },
  902. {
  903. "input": "http://2001::1]:80",
  904. "base": "http://example.org/foo/bar",
  905. "failure": true
  906. },
  907. {
  908. "input": "http://[2001::1]",
  909. "base": "http://example.org/foo/bar",
  910. "href": "http://[2001::1]/",
  911. "origin": "http://[2001::1]",
  912. "protocol": "http:",
  913. "username": "",
  914. "password": "",
  915. "host": "[2001::1]",
  916. "hostname": "[2001::1]",
  917. "port": "",
  918. "pathname": "/",
  919. "search": "",
  920. "hash": ""
  921. },
  922. {
  923. "input": "http://[::127.0.0.1]",
  924. "base": "http://example.org/foo/bar",
  925. "href": "http://[::7f00:1]/",
  926. "origin": "http://[::7f00:1]",
  927. "protocol": "http:",
  928. "username": "",
  929. "password": "",
  930. "host": "[::7f00:1]",
  931. "hostname": "[::7f00:1]",
  932. "port": "",
  933. "pathname": "/",
  934. "search": "",
  935. "hash": ""
  936. },
  937. {
  938. "input": "http://[0:0:0:0:0:0:13.1.68.3]",
  939. "base": "http://example.org/foo/bar",
  940. "href": "http://[::d01:4403]/",
  941. "origin": "http://[::d01:4403]",
  942. "protocol": "http:",
  943. "username": "",
  944. "password": "",
  945. "host": "[::d01:4403]",
  946. "hostname": "[::d01:4403]",
  947. "port": "",
  948. "pathname": "/",
  949. "search": "",
  950. "hash": ""
  951. },
  952. {
  953. "input": "http://[2001::1]:80",
  954. "base": "http://example.org/foo/bar",
  955. "href": "http://[2001::1]/",
  956. "origin": "http://[2001::1]",
  957. "protocol": "http:",
  958. "username": "",
  959. "password": "",
  960. "host": "[2001::1]",
  961. "hostname": "[2001::1]",
  962. "port": "",
  963. "pathname": "/",
  964. "search": "",
  965. "hash": ""
  966. },
  967. {
  968. "input": "http:/example.com/",
  969. "base": "http://example.org/foo/bar",
  970. "href": "http://example.org/example.com/",
  971. "origin": "http://example.org",
  972. "protocol": "http:",
  973. "username": "",
  974. "password": "",
  975. "host": "example.org",
  976. "hostname": "example.org",
  977. "port": "",
  978. "pathname": "/example.com/",
  979. "search": "",
  980. "hash": ""
  981. },
  982. {
  983. "input": "ftp:/example.com/",
  984. "base": "http://example.org/foo/bar",
  985. "href": "ftp://example.com/",
  986. "origin": "ftp://example.com",
  987. "protocol": "ftp:",
  988. "username": "",
  989. "password": "",
  990. "host": "example.com",
  991. "hostname": "example.com",
  992. "port": "",
  993. "pathname": "/",
  994. "search": "",
  995. "hash": ""
  996. },
  997. {
  998. "input": "https:/example.com/",
  999. "base": "http://example.org/foo/bar",
  1000. "href": "https://example.com/",
  1001. "origin": "https://example.com",
  1002. "protocol": "https:",
  1003. "username": "",
  1004. "password": "",
  1005. "host": "example.com",
  1006. "hostname": "example.com",
  1007. "port": "",
  1008. "pathname": "/",
  1009. "search": "",
  1010. "hash": ""
  1011. },
  1012. {
  1013. "input": "madeupscheme:/example.com/",
  1014. "base": "http://example.org/foo/bar",
  1015. "href": "madeupscheme:/example.com/",
  1016. "origin": "null",
  1017. "protocol": "madeupscheme:",
  1018. "username": "",
  1019. "password": "",
  1020. "host": "",
  1021. "hostname": "",
  1022. "port": "",
  1023. "pathname": "/example.com/",
  1024. "search": "",
  1025. "hash": ""
  1026. },
  1027. {
  1028. "input": "file:/example.com/",
  1029. "base": "http://example.org/foo/bar",
  1030. "href": "file:///example.com/",
  1031. "protocol": "file:",
  1032. "username": "",
  1033. "password": "",
  1034. "host": "",
  1035. "hostname": "",
  1036. "port": "",
  1037. "pathname": "/example.com/",
  1038. "search": "",
  1039. "hash": ""
  1040. },
  1041. {
  1042. "input": "file://example:1/",
  1043. "base": "about:blank",
  1044. "failure": true
  1045. },
  1046. {
  1047. "input": "file://example:test/",
  1048. "base": "about:blank",
  1049. "failure": true
  1050. },
  1051. {
  1052. "input": "file://example%/",
  1053. "base": "about:blank",
  1054. "failure": true
  1055. },
  1056. {
  1057. "input": "file://[example]/",
  1058. "base": "about:blank",
  1059. "failure": true
  1060. },
  1061. {
  1062. "input": "ftps:/example.com/",
  1063. "base": "http://example.org/foo/bar",
  1064. "href": "ftps:/example.com/",
  1065. "origin": "null",
  1066. "protocol": "ftps:",
  1067. "username": "",
  1068. "password": "",
  1069. "host": "",
  1070. "hostname": "",
  1071. "port": "",
  1072. "pathname": "/example.com/",
  1073. "search": "",
  1074. "hash": ""
  1075. },
  1076. {
  1077. "input": "gopher:/example.com/",
  1078. "base": "http://example.org/foo/bar",
  1079. "href": "gopher://example.com/",
  1080. "origin": "null",
  1081. "protocol": "gopher:",
  1082. "username": "",
  1083. "password": "",
  1084. "host": "example.com",
  1085. "hostname": "example.com",
  1086. "port": "",
  1087. "pathname": "/",
  1088. "search": "",
  1089. "hash": ""
  1090. },
  1091. {
  1092. "input": "ws:/example.com/",
  1093. "base": "http://example.org/foo/bar",
  1094. "href": "ws://example.com/",
  1095. "origin": "ws://example.com",
  1096. "protocol": "ws:",
  1097. "username": "",
  1098. "password": "",
  1099. "host": "example.com",
  1100. "hostname": "example.com",
  1101. "port": "",
  1102. "pathname": "/",
  1103. "search": "",
  1104. "hash": ""
  1105. },
  1106. {
  1107. "input": "wss:/example.com/",
  1108. "base": "http://example.org/foo/bar",
  1109. "href": "wss://example.com/",
  1110. "origin": "wss://example.com",
  1111. "protocol": "wss:",
  1112. "username": "",
  1113. "password": "",
  1114. "host": "example.com",
  1115. "hostname": "example.com",
  1116. "port": "",
  1117. "pathname": "/",
  1118. "search": "",
  1119. "hash": ""
  1120. },
  1121. "NS_NewURI for given input and base fails",
  1122. {
  1123. "input": "data:/example.com/",
  1124. "base": "http://example.org/foo/bar",
  1125. "href": "data:/example.com/",
  1126. "origin": "null",
  1127. "protocol": "data:",
  1128. "username": "",
  1129. "password": "",
  1130. "host": "",
  1131. "hostname": "",
  1132. "port": "",
  1133. "pathname": "/example.com/",
  1134. "search": "",
  1135. "hash": "",
  1136. "skip": true
  1137. },
  1138. {
  1139. "input": "javascript:/example.com/",
  1140. "base": "http://example.org/foo/bar",
  1141. "href": "javascript:/example.com/",
  1142. "origin": "null",
  1143. "protocol": "javascript:",
  1144. "username": "",
  1145. "password": "",
  1146. "host": "",
  1147. "hostname": "",
  1148. "port": "",
  1149. "pathname": "/example.com/",
  1150. "search": "",
  1151. "hash": ""
  1152. },
  1153. {
  1154. "input": "mailto:/example.com/",
  1155. "base": "http://example.org/foo/bar",
  1156. "href": "mailto:/example.com/",
  1157. "origin": "null",
  1158. "protocol": "mailto:",
  1159. "username": "",
  1160. "password": "",
  1161. "host": "",
  1162. "hostname": "",
  1163. "port": "",
  1164. "pathname": "/example.com/",
  1165. "search": "",
  1166. "hash": ""
  1167. },
  1168. {
  1169. "input": "http:example.com/",
  1170. "base": "http://example.org/foo/bar",
  1171. "href": "http://example.org/foo/example.com/",
  1172. "origin": "http://example.org",
  1173. "protocol": "http:",
  1174. "username": "",
  1175. "password": "",
  1176. "host": "example.org",
  1177. "hostname": "example.org",
  1178. "port": "",
  1179. "pathname": "/foo/example.com/",
  1180. "search": "",
  1181. "hash": ""
  1182. },
  1183. {
  1184. "input": "ftp:example.com/",
  1185. "base": "http://example.org/foo/bar",
  1186. "href": "ftp://example.com/",
  1187. "origin": "ftp://example.com",
  1188. "protocol": "ftp:",
  1189. "username": "",
  1190. "password": "",
  1191. "host": "example.com",
  1192. "hostname": "example.com",
  1193. "port": "",
  1194. "pathname": "/",
  1195. "search": "",
  1196. "hash": ""
  1197. },
  1198. {
  1199. "input": "https:example.com/",
  1200. "base": "http://example.org/foo/bar",
  1201. "href": "https://example.com/",
  1202. "origin": "https://example.com",
  1203. "protocol": "https:",
  1204. "username": "",
  1205. "password": "",
  1206. "host": "example.com",
  1207. "hostname": "example.com",
  1208. "port": "",
  1209. "pathname": "/",
  1210. "search": "",
  1211. "hash": ""
  1212. },
  1213. {
  1214. "input": "madeupscheme:example.com/",
  1215. "base": "http://example.org/foo/bar",
  1216. "href": "madeupscheme:example.com/",
  1217. "origin": "null",
  1218. "protocol": "madeupscheme:",
  1219. "username": "",
  1220. "password": "",
  1221. "host": "",
  1222. "hostname": "",
  1223. "port": "",
  1224. "pathname": "example.com/",
  1225. "search": "",
  1226. "hash": ""
  1227. },
  1228. {
  1229. "input": "ftps:example.com/",
  1230. "base": "http://example.org/foo/bar",
  1231. "href": "ftps:example.com/",
  1232. "origin": "null",
  1233. "protocol": "ftps:",
  1234. "username": "",
  1235. "password": "",
  1236. "host": "",
  1237. "hostname": "",
  1238. "port": "",
  1239. "pathname": "example.com/",
  1240. "search": "",
  1241. "hash": ""
  1242. },
  1243. {
  1244. "input": "gopher:example.com/",
  1245. "base": "http://example.org/foo/bar",
  1246. "href": "gopher://example.com/",
  1247. "origin": "null",
  1248. "protocol": "gopher:",
  1249. "username": "",
  1250. "password": "",
  1251. "host": "example.com",
  1252. "hostname": "example.com",
  1253. "port": "",
  1254. "pathname": "/",
  1255. "search": "",
  1256. "hash": ""
  1257. },
  1258. {
  1259. "input": "ws:example.com/",
  1260. "base": "http://example.org/foo/bar",
  1261. "href": "ws://example.com/",
  1262. "origin": "ws://example.com",
  1263. "protocol": "ws:",
  1264. "username": "",
  1265. "password": "",
  1266. "host": "example.com",
  1267. "hostname": "example.com",
  1268. "port": "",
  1269. "pathname": "/",
  1270. "search": "",
  1271. "hash": ""
  1272. },
  1273. {
  1274. "input": "wss:example.com/",
  1275. "base": "http://example.org/foo/bar",
  1276. "href": "wss://example.com/",
  1277. "origin": "wss://example.com",
  1278. "protocol": "wss:",
  1279. "username": "",
  1280. "password": "",
  1281. "host": "example.com",
  1282. "hostname": "example.com",
  1283. "port": "",
  1284. "pathname": "/",
  1285. "search": "",
  1286. "hash": ""
  1287. },
  1288. "NS_NewURI for given input and base fails",
  1289. {
  1290. "input": "data:example.com/",
  1291. "base": "http://example.org/foo/bar",
  1292. "href": "data:example.com/",
  1293. "origin": "null",
  1294. "protocol": "data:",
  1295. "username": "",
  1296. "password": "",
  1297. "host": "",
  1298. "hostname": "",
  1299. "port": "",
  1300. "pathname": "example.com/",
  1301. "search": "",
  1302. "hash": "",
  1303. "skip": true
  1304. },
  1305. {
  1306. "input": "javascript:example.com/",
  1307. "base": "http://example.org/foo/bar",
  1308. "href": "javascript:example.com/",
  1309. "origin": "null",
  1310. "protocol": "javascript:",
  1311. "username": "",
  1312. "password": "",
  1313. "host": "",
  1314. "hostname": "",
  1315. "port": "",
  1316. "pathname": "example.com/",
  1317. "search": "",
  1318. "hash": ""
  1319. },
  1320. {
  1321. "input": "mailto:example.com/",
  1322. "base": "http://example.org/foo/bar",
  1323. "href": "mailto:example.com/",
  1324. "origin": "null",
  1325. "protocol": "mailto:",
  1326. "username": "",
  1327. "password": "",
  1328. "host": "",
  1329. "hostname": "",
  1330. "port": "",
  1331. "pathname": "example.com/",
  1332. "search": "",
  1333. "hash": ""
  1334. },
  1335. {
  1336. "input": "/a/b/c",
  1337. "base": "http://example.org/foo/bar",
  1338. "href": "http://example.org/a/b/c",
  1339. "origin": "http://example.org",
  1340. "protocol": "http:",
  1341. "username": "",
  1342. "password": "",
  1343. "host": "example.org",
  1344. "hostname": "example.org",
  1345. "port": "",
  1346. "pathname": "/a/b/c",
  1347. "search": "",
  1348. "hash": ""
  1349. },
  1350. {
  1351. "input": "/a/ /c",
  1352. "base": "http://example.org/foo/bar",
  1353. "href": "http://example.org/a/%20/c",
  1354. "origin": "http://example.org",
  1355. "protocol": "http:",
  1356. "username": "",
  1357. "password": "",
  1358. "host": "example.org",
  1359. "hostname": "example.org",
  1360. "port": "",
  1361. "pathname": "/a/%20/c",
  1362. "search": "",
  1363. "hash": ""
  1364. },
  1365. {
  1366. "input": "/a%2fc",
  1367. "base": "http://example.org/foo/bar",
  1368. "href": "http://example.org/a%2fc",
  1369. "origin": "http://example.org",
  1370. "protocol": "http:",
  1371. "username": "",
  1372. "password": "",
  1373. "host": "example.org",
  1374. "hostname": "example.org",
  1375. "port": "",
  1376. "pathname": "/a%2fc",
  1377. "search": "",
  1378. "hash": ""
  1379. },
  1380. {
  1381. "input": "/a/%2f/c",
  1382. "base": "http://example.org/foo/bar",
  1383. "href": "http://example.org/a/%2f/c",
  1384. "origin": "http://example.org",
  1385. "protocol": "http:",
  1386. "username": "",
  1387. "password": "",
  1388. "host": "example.org",
  1389. "hostname": "example.org",
  1390. "port": "",
  1391. "pathname": "/a/%2f/c",
  1392. "search": "",
  1393. "hash": ""
  1394. },
  1395. {
  1396. "input": "#β",
  1397. "base": "http://example.org/foo/bar",
  1398. "href": "http://example.org/foo/bar#%CE%B2",
  1399. "origin": "http://example.org",
  1400. "protocol": "http:",
  1401. "username": "",
  1402. "password": "",
  1403. "host": "example.org",
  1404. "hostname": "example.org",
  1405. "port": "",
  1406. "pathname": "/foo/bar",
  1407. "search": "",
  1408. "hash": "#%CE%B2"
  1409. },
  1410. {
  1411. "input": "data:text/html,test#test",
  1412. "base": "http://example.org/foo/bar",
  1413. "href": "data:text/html,test#test",
  1414. "origin": "null",
  1415. "protocol": "data:",
  1416. "username": "",
  1417. "password": "",
  1418. "host": "",
  1419. "hostname": "",
  1420. "port": "",
  1421. "pathname": "text/html,test",
  1422. "search": "",
  1423. "hash": "#test"
  1424. },
  1425. {
  1426. "input": "tel:1234567890",
  1427. "base": "http://example.org/foo/bar",
  1428. "href": "tel:1234567890",
  1429. "origin": "null",
  1430. "protocol": "tel:",
  1431. "username": "",
  1432. "password": "",
  1433. "host": "",
  1434. "hostname": "",
  1435. "port": "",
  1436. "pathname": "1234567890",
  1437. "search": "",
  1438. "hash": ""
  1439. },
  1440. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/file.html",
  1441. {
  1442. "input": "file:c:\\foo\\bar.html",
  1443. "base": "file:///tmp/mock/path",
  1444. "href": "file:///c:/foo/bar.html",
  1445. "protocol": "file:",
  1446. "username": "",
  1447. "password": "",
  1448. "host": "",
  1449. "hostname": "",
  1450. "port": "",
  1451. "pathname": "/c:/foo/bar.html",
  1452. "search": "",
  1453. "hash": ""
  1454. },
  1455. {
  1456. "input": " File:c|////foo\\bar.html",
  1457. "base": "file:///tmp/mock/path",
  1458. "href": "file:///c:////foo/bar.html",
  1459. "protocol": "file:",
  1460. "username": "",
  1461. "password": "",
  1462. "host": "",
  1463. "hostname": "",
  1464. "port": "",
  1465. "pathname": "/c:////foo/bar.html",
  1466. "search": "",
  1467. "hash": ""
  1468. },
  1469. {
  1470. "input": "C|/foo/bar",
  1471. "base": "file:///tmp/mock/path",
  1472. "href": "file:///C:/foo/bar",
  1473. "protocol": "file:",
  1474. "username": "",
  1475. "password": "",
  1476. "host": "",
  1477. "hostname": "",
  1478. "port": "",
  1479. "pathname": "/C:/foo/bar",
  1480. "search": "",
  1481. "hash": ""
  1482. },
  1483. {
  1484. "input": "/C|\\foo\\bar",
  1485. "base": "file:///tmp/mock/path",
  1486. "href": "file:///C:/foo/bar",
  1487. "protocol": "file:",
  1488. "username": "",
  1489. "password": "",
  1490. "host": "",
  1491. "hostname": "",
  1492. "port": "",
  1493. "pathname": "/C:/foo/bar",
  1494. "search": "",
  1495. "hash": ""
  1496. },
  1497. {
  1498. "input": "//C|/foo/bar",
  1499. "base": "file:///tmp/mock/path",
  1500. "href": "file:///C:/foo/bar",
  1501. "protocol": "file:",
  1502. "username": "",
  1503. "password": "",
  1504. "host": "",
  1505. "hostname": "",
  1506. "port": "",
  1507. "pathname": "/C:/foo/bar",
  1508. "search": "",
  1509. "hash": ""
  1510. },
  1511. {
  1512. "input": "//server/file",
  1513. "base": "file:///tmp/mock/path",
  1514. "href": "file://server/file",
  1515. "protocol": "file:",
  1516. "username": "",
  1517. "password": "",
  1518. "host": "server",
  1519. "hostname": "server",
  1520. "port": "",
  1521. "pathname": "/file",
  1522. "search": "",
  1523. "hash": ""
  1524. },
  1525. {
  1526. "input": "\\\\server\\file",
  1527. "base": "file:///tmp/mock/path",
  1528. "href": "file://server/file",
  1529. "protocol": "file:",
  1530. "username": "",
  1531. "password": "",
  1532. "host": "server",
  1533. "hostname": "server",
  1534. "port": "",
  1535. "pathname": "/file",
  1536. "search": "",
  1537. "hash": ""
  1538. },
  1539. {
  1540. "input": "/\\server/file",
  1541. "base": "file:///tmp/mock/path",
  1542. "href": "file://server/file",
  1543. "protocol": "file:",
  1544. "username": "",
  1545. "password": "",
  1546. "host": "server",
  1547. "hostname": "server",
  1548. "port": "",
  1549. "pathname": "/file",
  1550. "search": "",
  1551. "hash": ""
  1552. },
  1553. {
  1554. "input": "file:///foo/bar.txt",
  1555. "base": "file:///tmp/mock/path",
  1556. "href": "file:///foo/bar.txt",
  1557. "protocol": "file:",
  1558. "username": "",
  1559. "password": "",
  1560. "host": "",
  1561. "hostname": "",
  1562. "port": "",
  1563. "pathname": "/foo/bar.txt",
  1564. "search": "",
  1565. "hash": ""
  1566. },
  1567. {
  1568. "input": "file:///home/me",
  1569. "base": "file:///tmp/mock/path",
  1570. "href": "file:///home/me",
  1571. "protocol": "file:",
  1572. "username": "",
  1573. "password": "",
  1574. "host": "",
  1575. "hostname": "",
  1576. "port": "",
  1577. "pathname": "/home/me",
  1578. "search": "",
  1579. "hash": ""
  1580. },
  1581. {
  1582. "input": "//",
  1583. "base": "file:///tmp/mock/path",
  1584. "href": "file:///",
  1585. "protocol": "file:",
  1586. "username": "",
  1587. "password": "",
  1588. "host": "",
  1589. "hostname": "",
  1590. "port": "",
  1591. "pathname": "/",
  1592. "search": "",
  1593. "hash": ""
  1594. },
  1595. {
  1596. "input": "///",
  1597. "base": "file:///tmp/mock/path",
  1598. "href": "file:///",
  1599. "protocol": "file:",
  1600. "username": "",
  1601. "password": "",
  1602. "host": "",
  1603. "hostname": "",
  1604. "port": "",
  1605. "pathname": "/",
  1606. "search": "",
  1607. "hash": ""
  1608. },
  1609. {
  1610. "input": "///test",
  1611. "base": "file:///tmp/mock/path",
  1612. "href": "file:///test",
  1613. "protocol": "file:",
  1614. "username": "",
  1615. "password": "",
  1616. "host": "",
  1617. "hostname": "",
  1618. "port": "",
  1619. "pathname": "/test",
  1620. "search": "",
  1621. "hash": ""
  1622. },
  1623. {
  1624. "input": "file://test",
  1625. "base": "file:///tmp/mock/path",
  1626. "href": "file://test/",
  1627. "protocol": "file:",
  1628. "username": "",
  1629. "password": "",
  1630. "host": "test",
  1631. "hostname": "test",
  1632. "port": "",
  1633. "pathname": "/",
  1634. "search": "",
  1635. "hash": ""
  1636. },
  1637. {
  1638. "input": "file://localhost",
  1639. "base": "file:///tmp/mock/path",
  1640. "href": "file:///",
  1641. "protocol": "file:",
  1642. "username": "",
  1643. "password": "",
  1644. "host": "",
  1645. "hostname": "",
  1646. "port": "",
  1647. "pathname": "/",
  1648. "search": "",
  1649. "hash": ""
  1650. },
  1651. {
  1652. "input": "file://localhost/",
  1653. "base": "file:///tmp/mock/path",
  1654. "href": "file:///",
  1655. "protocol": "file:",
  1656. "username": "",
  1657. "password": "",
  1658. "host": "",
  1659. "hostname": "",
  1660. "port": "",
  1661. "pathname": "/",
  1662. "search": "",
  1663. "hash": ""
  1664. },
  1665. {
  1666. "input": "file://localhost/test",
  1667. "base": "file:///tmp/mock/path",
  1668. "href": "file:///test",
  1669. "protocol": "file:",
  1670. "username": "",
  1671. "password": "",
  1672. "host": "",
  1673. "hostname": "",
  1674. "port": "",
  1675. "pathname": "/test",
  1676. "search": "",
  1677. "hash": ""
  1678. },
  1679. {
  1680. "input": "test",
  1681. "base": "file:///tmp/mock/path",
  1682. "href": "file:///tmp/mock/test",
  1683. "protocol": "file:",
  1684. "username": "",
  1685. "password": "",
  1686. "host": "",
  1687. "hostname": "",
  1688. "port": "",
  1689. "pathname": "/tmp/mock/test",
  1690. "search": "",
  1691. "hash": ""
  1692. },
  1693. {
  1694. "input": "file:test",
  1695. "base": "file:///tmp/mock/path",
  1696. "href": "file:///tmp/mock/test",
  1697. "protocol": "file:",
  1698. "username": "",
  1699. "password": "",
  1700. "host": "",
  1701. "hostname": "",
  1702. "port": "",
  1703. "pathname": "/tmp/mock/test",
  1704. "search": "",
  1705. "hash": ""
  1706. },
  1707. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/path.js",
  1708. {
  1709. "input": "http://example.com/././foo",
  1710. "base": "about:blank",
  1711. "href": "http://example.com/foo",
  1712. "origin": "http://example.com",
  1713. "protocol": "http:",
  1714. "username": "",
  1715. "password": "",
  1716. "host": "example.com",
  1717. "hostname": "example.com",
  1718. "port": "",
  1719. "pathname": "/foo",
  1720. "search": "",
  1721. "hash": ""
  1722. },
  1723. {
  1724. "input": "http://example.com/./.foo",
  1725. "base": "about:blank",
  1726. "href": "http://example.com/.foo",
  1727. "origin": "http://example.com",
  1728. "protocol": "http:",
  1729. "username": "",
  1730. "password": "",
  1731. "host": "example.com",
  1732. "hostname": "example.com",
  1733. "port": "",
  1734. "pathname": "/.foo",
  1735. "search": "",
  1736. "hash": ""
  1737. },
  1738. {
  1739. "input": "http://example.com/foo/.",
  1740. "base": "about:blank",
  1741. "href": "http://example.com/foo/",
  1742. "origin": "http://example.com",
  1743. "protocol": "http:",
  1744. "username": "",
  1745. "password": "",
  1746. "host": "example.com",
  1747. "hostname": "example.com",
  1748. "port": "",
  1749. "pathname": "/foo/",
  1750. "search": "",
  1751. "hash": ""
  1752. },
  1753. {
  1754. "input": "http://example.com/foo/./",
  1755. "base": "about:blank",
  1756. "href": "http://example.com/foo/",
  1757. "origin": "http://example.com",
  1758. "protocol": "http:",
  1759. "username": "",
  1760. "password": "",
  1761. "host": "example.com",
  1762. "hostname": "example.com",
  1763. "port": "",
  1764. "pathname": "/foo/",
  1765. "search": "",
  1766. "hash": ""
  1767. },
  1768. {
  1769. "input": "http://example.com/foo/bar/..",
  1770. "base": "about:blank",
  1771. "href": "http://example.com/foo/",
  1772. "origin": "http://example.com",
  1773. "protocol": "http:",
  1774. "username": "",
  1775. "password": "",
  1776. "host": "example.com",
  1777. "hostname": "example.com",
  1778. "port": "",
  1779. "pathname": "/foo/",
  1780. "search": "",
  1781. "hash": ""
  1782. },
  1783. {
  1784. "input": "http://example.com/foo/bar/../",
  1785. "base": "about:blank",
  1786. "href": "http://example.com/foo/",
  1787. "origin": "http://example.com",
  1788. "protocol": "http:",
  1789. "username": "",
  1790. "password": "",
  1791. "host": "example.com",
  1792. "hostname": "example.com",
  1793. "port": "",
  1794. "pathname": "/foo/",
  1795. "search": "",
  1796. "hash": ""
  1797. },
  1798. {
  1799. "input": "http://example.com/foo/..bar",
  1800. "base": "about:blank",
  1801. "href": "http://example.com/foo/..bar",
  1802. "origin": "http://example.com",
  1803. "protocol": "http:",
  1804. "username": "",
  1805. "password": "",
  1806. "host": "example.com",
  1807. "hostname": "example.com",
  1808. "port": "",
  1809. "pathname": "/foo/..bar",
  1810. "search": "",
  1811. "hash": ""
  1812. },
  1813. {
  1814. "input": "http://example.com/foo/bar/../ton",
  1815. "base": "about:blank",
  1816. "href": "http://example.com/foo/ton",
  1817. "origin": "http://example.com",
  1818. "protocol": "http:",
  1819. "username": "",
  1820. "password": "",
  1821. "host": "example.com",
  1822. "hostname": "example.com",
  1823. "port": "",
  1824. "pathname": "/foo/ton",
  1825. "search": "",
  1826. "hash": ""
  1827. },
  1828. {
  1829. "input": "http://example.com/foo/bar/../ton/../../a",
  1830. "base": "about:blank",
  1831. "href": "http://example.com/a",
  1832. "origin": "http://example.com",
  1833. "protocol": "http:",
  1834. "username": "",
  1835. "password": "",
  1836. "host": "example.com",
  1837. "hostname": "example.com",
  1838. "port": "",
  1839. "pathname": "/a",
  1840. "search": "",
  1841. "hash": ""
  1842. },
  1843. {
  1844. "input": "http://example.com/foo/../../..",
  1845. "base": "about:blank",
  1846. "href": "http://example.com/",
  1847. "origin": "http://example.com",
  1848. "protocol": "http:",
  1849. "username": "",
  1850. "password": "",
  1851. "host": "example.com",
  1852. "hostname": "example.com",
  1853. "port": "",
  1854. "pathname": "/",
  1855. "search": "",
  1856. "hash": ""
  1857. },
  1858. {
  1859. "input": "http://example.com/foo/../../../ton",
  1860. "base": "about:blank",
  1861. "href": "http://example.com/ton",
  1862. "origin": "http://example.com",
  1863. "protocol": "http:",
  1864. "username": "",
  1865. "password": "",
  1866. "host": "example.com",
  1867. "hostname": "example.com",
  1868. "port": "",
  1869. "pathname": "/ton",
  1870. "search": "",
  1871. "hash": ""
  1872. },
  1873. {
  1874. "input": "http://example.com/foo/%2e",
  1875. "base": "about:blank",
  1876. "href": "http://example.com/foo/",
  1877. "origin": "http://example.com",
  1878. "protocol": "http:",
  1879. "username": "",
  1880. "password": "",
  1881. "host": "example.com",
  1882. "hostname": "example.com",
  1883. "port": "",
  1884. "pathname": "/foo/",
  1885. "search": "",
  1886. "hash": ""
  1887. },
  1888. {
  1889. "input": "http://example.com/foo/%2e%2",
  1890. "base": "about:blank",
  1891. "href": "http://example.com/foo/%2e%2",
  1892. "origin": "http://example.com",
  1893. "protocol": "http:",
  1894. "username": "",
  1895. "password": "",
  1896. "host": "example.com",
  1897. "hostname": "example.com",
  1898. "port": "",
  1899. "pathname": "/foo/%2e%2",
  1900. "search": "",
  1901. "hash": ""
  1902. },
  1903. {
  1904. "input": "http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar",
  1905. "base": "about:blank",
  1906. "href": "http://example.com/%2e.bar",
  1907. "origin": "http://example.com",
  1908. "protocol": "http:",
  1909. "username": "",
  1910. "password": "",
  1911. "host": "example.com",
  1912. "hostname": "example.com",
  1913. "port": "",
  1914. "pathname": "/%2e.bar",
  1915. "search": "",
  1916. "hash": ""
  1917. },
  1918. {
  1919. "input": "http://example.com////../..",
  1920. "base": "about:blank",
  1921. "href": "http://example.com//",
  1922. "origin": "http://example.com",
  1923. "protocol": "http:",
  1924. "username": "",
  1925. "password": "",
  1926. "host": "example.com",
  1927. "hostname": "example.com",
  1928. "port": "",
  1929. "pathname": "//",
  1930. "search": "",
  1931. "hash": ""
  1932. },
  1933. {
  1934. "input": "http://example.com/foo/bar//../..",
  1935. "base": "about:blank",
  1936. "href": "http://example.com/foo/",
  1937. "origin": "http://example.com",
  1938. "protocol": "http:",
  1939. "username": "",
  1940. "password": "",
  1941. "host": "example.com",
  1942. "hostname": "example.com",
  1943. "port": "",
  1944. "pathname": "/foo/",
  1945. "search": "",
  1946. "hash": ""
  1947. },
  1948. {
  1949. "input": "http://example.com/foo/bar//..",
  1950. "base": "about:blank",
  1951. "href": "http://example.com/foo/bar/",
  1952. "origin": "http://example.com",
  1953. "protocol": "http:",
  1954. "username": "",
  1955. "password": "",
  1956. "host": "example.com",
  1957. "hostname": "example.com",
  1958. "port": "",
  1959. "pathname": "/foo/bar/",
  1960. "search": "",
  1961. "hash": ""
  1962. },
  1963. {
  1964. "input": "http://example.com/foo",
  1965. "base": "about:blank",
  1966. "href": "http://example.com/foo",
  1967. "origin": "http://example.com",
  1968. "protocol": "http:",
  1969. "username": "",
  1970. "password": "",
  1971. "host": "example.com",
  1972. "hostname": "example.com",
  1973. "port": "",
  1974. "pathname": "/foo",
  1975. "search": "",
  1976. "hash": ""
  1977. },
  1978. {
  1979. "input": "http://example.com/%20foo",
  1980. "base": "about:blank",
  1981. "href": "http://example.com/%20foo",
  1982. "origin": "http://example.com",
  1983. "protocol": "http:",
  1984. "username": "",
  1985. "password": "",
  1986. "host": "example.com",
  1987. "hostname": "example.com",
  1988. "port": "",
  1989. "pathname": "/%20foo",
  1990. "search": "",
  1991. "hash": ""
  1992. },
  1993. {
  1994. "input": "http://example.com/foo%",
  1995. "base": "about:blank",
  1996. "href": "http://example.com/foo%",
  1997. "origin": "http://example.com",
  1998. "protocol": "http:",
  1999. "username": "",
  2000. "password": "",
  2001. "host": "example.com",
  2002. "hostname": "example.com",
  2003. "port": "",
  2004. "pathname": "/foo%",
  2005. "search": "",
  2006. "hash": ""
  2007. },
  2008. {
  2009. "input": "http://example.com/foo%2",
  2010. "base": "about:blank",
  2011. "href": "http://example.com/foo%2",
  2012. "origin": "http://example.com",
  2013. "protocol": "http:",
  2014. "username": "",
  2015. "password": "",
  2016. "host": "example.com",
  2017. "hostname": "example.com",
  2018. "port": "",
  2019. "pathname": "/foo%2",
  2020. "search": "",
  2021. "hash": ""
  2022. },
  2023. {
  2024. "input": "http://example.com/foo%2zbar",
  2025. "base": "about:blank",
  2026. "href": "http://example.com/foo%2zbar",
  2027. "origin": "http://example.com",
  2028. "protocol": "http:",
  2029. "username": "",
  2030. "password": "",
  2031. "host": "example.com",
  2032. "hostname": "example.com",
  2033. "port": "",
  2034. "pathname": "/foo%2zbar",
  2035. "search": "",
  2036. "hash": ""
  2037. },
  2038. {
  2039. "input": "http://example.com/foo%2©zbar",
  2040. "base": "about:blank",
  2041. "href": "http://example.com/foo%2%C3%82%C2%A9zbar",
  2042. "origin": "http://example.com",
  2043. "protocol": "http:",
  2044. "username": "",
  2045. "password": "",
  2046. "host": "example.com",
  2047. "hostname": "example.com",
  2048. "port": "",
  2049. "pathname": "/foo%2%C3%82%C2%A9zbar",
  2050. "search": "",
  2051. "hash": ""
  2052. },
  2053. {
  2054. "input": "http://example.com/foo%41%7a",
  2055. "base": "about:blank",
  2056. "href": "http://example.com/foo%41%7a",
  2057. "origin": "http://example.com",
  2058. "protocol": "http:",
  2059. "username": "",
  2060. "password": "",
  2061. "host": "example.com",
  2062. "hostname": "example.com",
  2063. "port": "",
  2064. "pathname": "/foo%41%7a",
  2065. "search": "",
  2066. "hash": ""
  2067. },
  2068. {
  2069. "input": "http://example.com/foo\t\u0091%91",
  2070. "base": "about:blank",
  2071. "href": "http://example.com/foo%C2%91%91",
  2072. "origin": "http://example.com",
  2073. "protocol": "http:",
  2074. "username": "",
  2075. "password": "",
  2076. "host": "example.com",
  2077. "hostname": "example.com",
  2078. "port": "",
  2079. "pathname": "/foo%C2%91%91",
  2080. "search": "",
  2081. "hash": ""
  2082. },
  2083. {
  2084. "input": "http://example.com/foo%00%51",
  2085. "base": "about:blank",
  2086. "href": "http://example.com/foo%00%51",
  2087. "origin": "http://example.com",
  2088. "protocol": "http:",
  2089. "username": "",
  2090. "password": "",
  2091. "host": "example.com",
  2092. "hostname": "example.com",
  2093. "port": "",
  2094. "pathname": "/foo%00%51",
  2095. "search": "",
  2096. "hash": ""
  2097. },
  2098. {
  2099. "input": "http://example.com/(%28:%3A%29)",
  2100. "base": "about:blank",
  2101. "href": "http://example.com/(%28:%3A%29)",
  2102. "origin": "http://example.com",
  2103. "protocol": "http:",
  2104. "username": "",
  2105. "password": "",
  2106. "host": "example.com",
  2107. "hostname": "example.com",
  2108. "port": "",
  2109. "pathname": "/(%28:%3A%29)",
  2110. "search": "",
  2111. "hash": ""
  2112. },
  2113. {
  2114. "input": "http://example.com/%3A%3a%3C%3c",
  2115. "base": "about:blank",
  2116. "href": "http://example.com/%3A%3a%3C%3c",
  2117. "origin": "http://example.com",
  2118. "protocol": "http:",
  2119. "username": "",
  2120. "password": "",
  2121. "host": "example.com",
  2122. "hostname": "example.com",
  2123. "port": "",
  2124. "pathname": "/%3A%3a%3C%3c",
  2125. "search": "",
  2126. "hash": ""
  2127. },
  2128. {
  2129. "input": "http://example.com/foo\tbar",
  2130. "base": "about:blank",
  2131. "href": "http://example.com/foobar",
  2132. "origin": "http://example.com",
  2133. "protocol": "http:",
  2134. "username": "",
  2135. "password": "",
  2136. "host": "example.com",
  2137. "hostname": "example.com",
  2138. "port": "",
  2139. "pathname": "/foobar",
  2140. "search": "",
  2141. "hash": ""
  2142. },
  2143. {
  2144. "input": "http://example.com\\\\foo\\\\bar",
  2145. "base": "about:blank",
  2146. "href": "http://example.com//foo//bar",
  2147. "origin": "http://example.com",
  2148. "protocol": "http:",
  2149. "username": "",
  2150. "password": "",
  2151. "host": "example.com",
  2152. "hostname": "example.com",
  2153. "port": "",
  2154. "pathname": "//foo//bar",
  2155. "search": "",
  2156. "hash": ""
  2157. },
  2158. {
  2159. "input": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd",
  2160. "base": "about:blank",
  2161. "href": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd",
  2162. "origin": "http://example.com",
  2163. "protocol": "http:",
  2164. "username": "",
  2165. "password": "",
  2166. "host": "example.com",
  2167. "hostname": "example.com",
  2168. "port": "",
  2169. "pathname": "/%7Ffp3%3Eju%3Dduvgw%3Dd",
  2170. "search": "",
  2171. "hash": ""
  2172. },
  2173. {
  2174. "input": "http://example.com/@asdf%40",
  2175. "base": "about:blank",
  2176. "href": "http://example.com/@asdf%40",
  2177. "origin": "http://example.com",
  2178. "protocol": "http:",
  2179. "username": "",
  2180. "password": "",
  2181. "host": "example.com",
  2182. "hostname": "example.com",
  2183. "port": "",
  2184. "pathname": "/@asdf%40",
  2185. "search": "",
  2186. "hash": ""
  2187. },
  2188. {
  2189. "input": "http://example.com/你好你好",
  2190. "base": "about:blank",
  2191. "href": "http://example.com/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD",
  2192. "origin": "http://example.com",
  2193. "protocol": "http:",
  2194. "username": "",
  2195. "password": "",
  2196. "host": "example.com",
  2197. "hostname": "example.com",
  2198. "port": "",
  2199. "pathname": "/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD",
  2200. "search": "",
  2201. "hash": ""
  2202. },
  2203. {
  2204. "input": "http://example.com/‥/foo",
  2205. "base": "about:blank",
  2206. "href": "http://example.com/%E2%80%A5/foo",
  2207. "origin": "http://example.com",
  2208. "protocol": "http:",
  2209. "username": "",
  2210. "password": "",
  2211. "host": "example.com",
  2212. "hostname": "example.com",
  2213. "port": "",
  2214. "pathname": "/%E2%80%A5/foo",
  2215. "search": "",
  2216. "hash": ""
  2217. },
  2218. {
  2219. "input": "http://example.com//foo",
  2220. "base": "about:blank",
  2221. "href": "http://example.com/%EF%BB%BF/foo",
  2222. "origin": "http://example.com",
  2223. "protocol": "http:",
  2224. "username": "",
  2225. "password": "",
  2226. "host": "example.com",
  2227. "hostname": "example.com",
  2228. "port": "",
  2229. "pathname": "/%EF%BB%BF/foo",
  2230. "search": "",
  2231. "hash": ""
  2232. },
  2233. {
  2234. "input": "http://example.com/‮/foo/‭/bar",
  2235. "base": "about:blank",
  2236. "href": "http://example.com/%E2%80%AE/foo/%E2%80%AD/bar",
  2237. "origin": "http://example.com",
  2238. "protocol": "http:",
  2239. "username": "",
  2240. "password": "",
  2241. "host": "example.com",
  2242. "hostname": "example.com",
  2243. "port": "",
  2244. "pathname": "/%E2%80%AE/foo/%E2%80%AD/bar",
  2245. "search": "",
  2246. "hash": ""
  2247. },
  2248. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/relative.js",
  2249. {
  2250. "input": "http://www.google.com/foo?bar=baz#",
  2251. "base": "about:blank",
  2252. "href": "http://www.google.com/foo?bar=baz#",
  2253. "origin": "http://www.google.com",
  2254. "protocol": "http:",
  2255. "username": "",
  2256. "password": "",
  2257. "host": "www.google.com",
  2258. "hostname": "www.google.com",
  2259. "port": "",
  2260. "pathname": "/foo",
  2261. "search": "?bar=baz",
  2262. "hash": ""
  2263. },
  2264. {
  2265. "input": "http://www.google.com/foo?bar=baz# »",
  2266. "base": "about:blank",
  2267. "href": "http://www.google.com/foo?bar=baz# %C2%BB",
  2268. "origin": "http://www.google.com",
  2269. "protocol": "http:",
  2270. "username": "",
  2271. "password": "",
  2272. "host": "www.google.com",
  2273. "hostname": "www.google.com",
  2274. "port": "",
  2275. "pathname": "/foo",
  2276. "search": "?bar=baz",
  2277. "hash": "# %C2%BB"
  2278. },
  2279. "NS_NewURI for given input and base fails",
  2280. {
  2281. "input": "data:test# »",
  2282. "base": "about:blank",
  2283. "href": "data:test# %C2%BB",
  2284. "origin": "null",
  2285. "protocol": "data:",
  2286. "username": "",
  2287. "password": "",
  2288. "host": "",
  2289. "hostname": "",
  2290. "port": "",
  2291. "pathname": "test",
  2292. "search": "",
  2293. "hash": "# %C2%BB",
  2294. "skip": true
  2295. },
  2296. {
  2297. "input": "http://www.google.com",
  2298. "base": "about:blank",
  2299. "href": "http://www.google.com/",
  2300. "origin": "http://www.google.com",
  2301. "protocol": "http:",
  2302. "username": "",
  2303. "password": "",
  2304. "host": "www.google.com",
  2305. "hostname": "www.google.com",
  2306. "port": "",
  2307. "pathname": "/",
  2308. "search": "",
  2309. "hash": ""
  2310. },
  2311. {
  2312. "input": "http://192.0x00A80001",
  2313. "base": "about:blank",
  2314. "href": "http://192.168.0.1/",
  2315. "origin": "http://192.168.0.1",
  2316. "protocol": "http:",
  2317. "username": "",
  2318. "password": "",
  2319. "host": "192.168.0.1",
  2320. "hostname": "192.168.0.1",
  2321. "port": "",
  2322. "pathname": "/",
  2323. "search": "",
  2324. "hash": ""
  2325. },
  2326. {
  2327. "input": "http://www/foo%2Ehtml",
  2328. "base": "about:blank",
  2329. "href": "http://www/foo%2Ehtml",
  2330. "origin": "http://www",
  2331. "protocol": "http:",
  2332. "username": "",
  2333. "password": "",
  2334. "host": "www",
  2335. "hostname": "www",
  2336. "port": "",
  2337. "pathname": "/foo%2Ehtml",
  2338. "search": "",
  2339. "hash": ""
  2340. },
  2341. {
  2342. "input": "http://www/foo/%2E/html",
  2343. "base": "about:blank",
  2344. "href": "http://www/foo/html",
  2345. "origin": "http://www",
  2346. "protocol": "http:",
  2347. "username": "",
  2348. "password": "",
  2349. "host": "www",
  2350. "hostname": "www",
  2351. "port": "",
  2352. "pathname": "/foo/html",
  2353. "search": "",
  2354. "hash": ""
  2355. },
  2356. {
  2357. "input": "http://user:pass@/",
  2358. "base": "about:blank",
  2359. "failure": true
  2360. },
  2361. {
  2362. "input": "http://%25DOMAIN:foobar@foodomain.com/",
  2363. "base": "about:blank",
  2364. "href": "http://%25DOMAIN:foobar@foodomain.com/",
  2365. "origin": "http://foodomain.com",
  2366. "protocol": "http:",
  2367. "username": "%25DOMAIN",
  2368. "password": "foobar",
  2369. "host": "foodomain.com",
  2370. "hostname": "foodomain.com",
  2371. "port": "",
  2372. "pathname": "/",
  2373. "search": "",
  2374. "hash": ""
  2375. },
  2376. {
  2377. "input": "http:\\\\www.google.com\\foo",
  2378. "base": "about:blank",
  2379. "href": "http://www.google.com/foo",
  2380. "origin": "http://www.google.com",
  2381. "protocol": "http:",
  2382. "username": "",
  2383. "password": "",
  2384. "host": "www.google.com",
  2385. "hostname": "www.google.com",
  2386. "port": "",
  2387. "pathname": "/foo",
  2388. "search": "",
  2389. "hash": ""
  2390. },
  2391. {
  2392. "input": "http://foo:80/",
  2393. "base": "about:blank",
  2394. "href": "http://foo/",
  2395. "origin": "http://foo",
  2396. "protocol": "http:",
  2397. "username": "",
  2398. "password": "",
  2399. "host": "foo",
  2400. "hostname": "foo",
  2401. "port": "",
  2402. "pathname": "/",
  2403. "search": "",
  2404. "hash": ""
  2405. },
  2406. {
  2407. "input": "http://foo:81/",
  2408. "base": "about:blank",
  2409. "href": "http://foo:81/",
  2410. "origin": "http://foo:81",
  2411. "protocol": "http:",
  2412. "username": "",
  2413. "password": "",
  2414. "host": "foo:81",
  2415. "hostname": "foo",
  2416. "port": "81",
  2417. "pathname": "/",
  2418. "search": "",
  2419. "hash": ""
  2420. },
  2421. {
  2422. "input": "httpa://foo:80/",
  2423. "base": "about:blank",
  2424. "href": "httpa://foo:80/",
  2425. "origin": "null",
  2426. "protocol": "httpa:",
  2427. "username": "",
  2428. "password": "",
  2429. "host": "foo:80",
  2430. "hostname": "foo",
  2431. "port": "80",
  2432. "pathname": "/",
  2433. "search": "",
  2434. "hash": ""
  2435. },
  2436. {
  2437. "input": "http://foo:-80/",
  2438. "base": "about:blank",
  2439. "failure": true
  2440. },
  2441. {
  2442. "input": "https://foo:443/",
  2443. "base": "about:blank",
  2444. "href": "https://foo/",
  2445. "origin": "https://foo",
  2446. "protocol": "https:",
  2447. "username": "",
  2448. "password": "",
  2449. "host": "foo",
  2450. "hostname": "foo",
  2451. "port": "",
  2452. "pathname": "/",
  2453. "search": "",
  2454. "hash": ""
  2455. },
  2456. {
  2457. "input": "https://foo:80/",
  2458. "base": "about:blank",
  2459. "href": "https://foo:80/",
  2460. "origin": "https://foo:80",
  2461. "protocol": "https:",
  2462. "username": "",
  2463. "password": "",
  2464. "host": "foo:80",
  2465. "hostname": "foo",
  2466. "port": "80",
  2467. "pathname": "/",
  2468. "search": "",
  2469. "hash": ""
  2470. },
  2471. {
  2472. "input": "ftp://foo:21/",
  2473. "base": "about:blank",
  2474. "href": "ftp://foo/",
  2475. "origin": "ftp://foo",
  2476. "protocol": "ftp:",
  2477. "username": "",
  2478. "password": "",
  2479. "host": "foo",
  2480. "hostname": "foo",
  2481. "port": "",
  2482. "pathname": "/",
  2483. "search": "",
  2484. "hash": ""
  2485. },
  2486. {
  2487. "input": "ftp://foo:80/",
  2488. "base": "about:blank",
  2489. "href": "ftp://foo:80/",
  2490. "origin": "ftp://foo:80",
  2491. "protocol": "ftp:",
  2492. "username": "",
  2493. "password": "",
  2494. "host": "foo:80",
  2495. "hostname": "foo",
  2496. "port": "80",
  2497. "pathname": "/",
  2498. "search": "",
  2499. "hash": ""
  2500. },
  2501. {
  2502. "input": "gopher://foo:70/",
  2503. "base": "about:blank",
  2504. "href": "gopher://foo/",
  2505. "origin": "null",
  2506. "protocol": "gopher:",
  2507. "username": "",
  2508. "password": "",
  2509. "host": "foo",
  2510. "hostname": "foo",
  2511. "port": "",
  2512. "pathname": "/",
  2513. "search": "",
  2514. "hash": ""
  2515. },
  2516. {
  2517. "input": "gopher://foo:443/",
  2518. "base": "about:blank",
  2519. "href": "gopher://foo:443/",
  2520. "origin": "null",
  2521. "protocol": "gopher:",
  2522. "username": "",
  2523. "password": "",
  2524. "host": "foo:443",
  2525. "hostname": "foo",
  2526. "port": "443",
  2527. "pathname": "/",
  2528. "search": "",
  2529. "hash": ""
  2530. },
  2531. {
  2532. "input": "ws://foo:80/",
  2533. "base": "about:blank",
  2534. "href": "ws://foo/",
  2535. "origin": "ws://foo",
  2536. "protocol": "ws:",
  2537. "username": "",
  2538. "password": "",
  2539. "host": "foo",
  2540. "hostname": "foo",
  2541. "port": "",
  2542. "pathname": "/",
  2543. "search": "",
  2544. "hash": ""
  2545. },
  2546. {
  2547. "input": "ws://foo:81/",
  2548. "base": "about:blank",
  2549. "href": "ws://foo:81/",
  2550. "origin": "ws://foo:81",
  2551. "protocol": "ws:",
  2552. "username": "",
  2553. "password": "",
  2554. "host": "foo:81",
  2555. "hostname": "foo",
  2556. "port": "81",
  2557. "pathname": "/",
  2558. "search": "",
  2559. "hash": ""
  2560. },
  2561. {
  2562. "input": "ws://foo:443/",
  2563. "base": "about:blank",
  2564. "href": "ws://foo:443/",
  2565. "origin": "ws://foo:443",
  2566. "protocol": "ws:",
  2567. "username": "",
  2568. "password": "",
  2569. "host": "foo:443",
  2570. "hostname": "foo",
  2571. "port": "443",
  2572. "pathname": "/",
  2573. "search": "",
  2574. "hash": ""
  2575. },
  2576. {
  2577. "input": "ws://foo:815/",
  2578. "base": "about:blank",
  2579. "href": "ws://foo:815/",
  2580. "origin": "ws://foo:815",
  2581. "protocol": "ws:",
  2582. "username": "",
  2583. "password": "",
  2584. "host": "foo:815",
  2585. "hostname": "foo",
  2586. "port": "815",
  2587. "pathname": "/",
  2588. "search": "",
  2589. "hash": ""
  2590. },
  2591. {
  2592. "input": "wss://foo:80/",
  2593. "base": "about:blank",
  2594. "href": "wss://foo:80/",
  2595. "origin": "wss://foo:80",
  2596. "protocol": "wss:",
  2597. "username": "",
  2598. "password": "",
  2599. "host": "foo:80",
  2600. "hostname": "foo",
  2601. "port": "80",
  2602. "pathname": "/",
  2603. "search": "",
  2604. "hash": ""
  2605. },
  2606. {
  2607. "input": "wss://foo:81/",
  2608. "base": "about:blank",
  2609. "href": "wss://foo:81/",
  2610. "origin": "wss://foo:81",
  2611. "protocol": "wss:",
  2612. "username": "",
  2613. "password": "",
  2614. "host": "foo:81",
  2615. "hostname": "foo",
  2616. "port": "81",
  2617. "pathname": "/",
  2618. "search": "",
  2619. "hash": ""
  2620. },
  2621. {
  2622. "input": "wss://foo:443/",
  2623. "base": "about:blank",
  2624. "href": "wss://foo/",
  2625. "origin": "wss://foo",
  2626. "protocol": "wss:",
  2627. "username": "",
  2628. "password": "",
  2629. "host": "foo",
  2630. "hostname": "foo",
  2631. "port": "",
  2632. "pathname": "/",
  2633. "search": "",
  2634. "hash": ""
  2635. },
  2636. {
  2637. "input": "wss://foo:815/",
  2638. "base": "about:blank",
  2639. "href": "wss://foo:815/",
  2640. "origin": "wss://foo:815",
  2641. "protocol": "wss:",
  2642. "username": "",
  2643. "password": "",
  2644. "host": "foo:815",
  2645. "hostname": "foo",
  2646. "port": "815",
  2647. "pathname": "/",
  2648. "search": "",
  2649. "hash": ""
  2650. },
  2651. {
  2652. "input": "http:/example.com/",
  2653. "base": "about:blank",
  2654. "href": "http://example.com/",
  2655. "origin": "http://example.com",
  2656. "protocol": "http:",
  2657. "username": "",
  2658. "password": "",
  2659. "host": "example.com",
  2660. "hostname": "example.com",
  2661. "port": "",
  2662. "pathname": "/",
  2663. "search": "",
  2664. "hash": ""
  2665. },
  2666. {
  2667. "input": "ftp:/example.com/",
  2668. "base": "about:blank",
  2669. "href": "ftp://example.com/",
  2670. "origin": "ftp://example.com",
  2671. "protocol": "ftp:",
  2672. "username": "",
  2673. "password": "",
  2674. "host": "example.com",
  2675. "hostname": "example.com",
  2676. "port": "",
  2677. "pathname": "/",
  2678. "search": "",
  2679. "hash": ""
  2680. },
  2681. {
  2682. "input": "https:/example.com/",
  2683. "base": "about:blank",
  2684. "href": "https://example.com/",
  2685. "origin": "https://example.com",
  2686. "protocol": "https:",
  2687. "username": "",
  2688. "password": "",
  2689. "host": "example.com",
  2690. "hostname": "example.com",
  2691. "port": "",
  2692. "pathname": "/",
  2693. "search": "",
  2694. "hash": ""
  2695. },
  2696. {
  2697. "input": "madeupscheme:/example.com/",
  2698. "base": "about:blank",
  2699. "href": "madeupscheme:/example.com/",
  2700. "origin": "null",
  2701. "protocol": "madeupscheme:",
  2702. "username": "",
  2703. "password": "",
  2704. "host": "",
  2705. "hostname": "",
  2706. "port": "",
  2707. "pathname": "/example.com/",
  2708. "search": "",
  2709. "hash": ""
  2710. },
  2711. {
  2712. "input": "file:/example.com/",
  2713. "base": "about:blank",
  2714. "href": "file:///example.com/",
  2715. "protocol": "file:",
  2716. "username": "",
  2717. "password": "",
  2718. "host": "",
  2719. "hostname": "",
  2720. "port": "",
  2721. "pathname": "/example.com/",
  2722. "search": "",
  2723. "hash": ""
  2724. },
  2725. {
  2726. "input": "ftps:/example.com/",
  2727. "base": "about:blank",
  2728. "href": "ftps:/example.com/",
  2729. "origin": "null",
  2730. "protocol": "ftps:",
  2731. "username": "",
  2732. "password": "",
  2733. "host": "",
  2734. "hostname": "",
  2735. "port": "",
  2736. "pathname": "/example.com/",
  2737. "search": "",
  2738. "hash": ""
  2739. },
  2740. {
  2741. "input": "gopher:/example.com/",
  2742. "base": "about:blank",
  2743. "href": "gopher://example.com/",
  2744. "origin": "null",
  2745. "protocol": "gopher:",
  2746. "username": "",
  2747. "password": "",
  2748. "host": "example.com",
  2749. "hostname": "example.com",
  2750. "port": "",
  2751. "pathname": "/",
  2752. "search": "",
  2753. "hash": ""
  2754. },
  2755. {
  2756. "input": "ws:/example.com/",
  2757. "base": "about:blank",
  2758. "href": "ws://example.com/",
  2759. "origin": "ws://example.com",
  2760. "protocol": "ws:",
  2761. "username": "",
  2762. "password": "",
  2763. "host": "example.com",
  2764. "hostname": "example.com",
  2765. "port": "",
  2766. "pathname": "/",
  2767. "search": "",
  2768. "hash": ""
  2769. },
  2770. {
  2771. "input": "wss:/example.com/",
  2772. "base": "about:blank",
  2773. "href": "wss://example.com/",
  2774. "origin": "wss://example.com",
  2775. "protocol": "wss:",
  2776. "username": "",
  2777. "password": "",
  2778. "host": "example.com",
  2779. "hostname": "example.com",
  2780. "port": "",
  2781. "pathname": "/",
  2782. "search": "",
  2783. "hash": ""
  2784. },
  2785. "NS_NewURI for given input and base fails",
  2786. {
  2787. "input": "data:/example.com/",
  2788. "base": "about:blank",
  2789. "href": "data:/example.com/",
  2790. "origin": "null",
  2791. "protocol": "data:",
  2792. "username": "",
  2793. "password": "",
  2794. "host": "",
  2795. "hostname": "",
  2796. "port": "",
  2797. "pathname": "/example.com/",
  2798. "search": "",
  2799. "hash": "",
  2800. "skip": true
  2801. },
  2802. {
  2803. "input": "javascript:/example.com/",
  2804. "base": "about:blank",
  2805. "href": "javascript:/example.com/",
  2806. "origin": "null",
  2807. "protocol": "javascript:",
  2808. "username": "",
  2809. "password": "",
  2810. "host": "",
  2811. "hostname": "",
  2812. "port": "",
  2813. "pathname": "/example.com/",
  2814. "search": "",
  2815. "hash": ""
  2816. },
  2817. {
  2818. "input": "mailto:/example.com/",
  2819. "base": "about:blank",
  2820. "href": "mailto:/example.com/",
  2821. "origin": "null",
  2822. "protocol": "mailto:",
  2823. "username": "",
  2824. "password": "",
  2825. "host": "",
  2826. "hostname": "",
  2827. "port": "",
  2828. "pathname": "/example.com/",
  2829. "search": "",
  2830. "hash": ""
  2831. },
  2832. {
  2833. "input": "http:example.com/",
  2834. "base": "about:blank",
  2835. "href": "http://example.com/",
  2836. "origin": "http://example.com",
  2837. "protocol": "http:",
  2838. "username": "",
  2839. "password": "",
  2840. "host": "example.com",
  2841. "hostname": "example.com",
  2842. "port": "",
  2843. "pathname": "/",
  2844. "search": "",
  2845. "hash": ""
  2846. },
  2847. {
  2848. "input": "ftp:example.com/",
  2849. "base": "about:blank",
  2850. "href": "ftp://example.com/",
  2851. "origin": "ftp://example.com",
  2852. "protocol": "ftp:",
  2853. "username": "",
  2854. "password": "",
  2855. "host": "example.com",
  2856. "hostname": "example.com",
  2857. "port": "",
  2858. "pathname": "/",
  2859. "search": "",
  2860. "hash": ""
  2861. },
  2862. {
  2863. "input": "https:example.com/",
  2864. "base": "about:blank",
  2865. "href": "https://example.com/",
  2866. "origin": "https://example.com",
  2867. "protocol": "https:",
  2868. "username": "",
  2869. "password": "",
  2870. "host": "example.com",
  2871. "hostname": "example.com",
  2872. "port": "",
  2873. "pathname": "/",
  2874. "search": "",
  2875. "hash": ""
  2876. },
  2877. {
  2878. "input": "madeupscheme:example.com/",
  2879. "base": "about:blank",
  2880. "href": "madeupscheme:example.com/",
  2881. "origin": "null",
  2882. "protocol": "madeupscheme:",
  2883. "username": "",
  2884. "password": "",
  2885. "host": "",
  2886. "hostname": "",
  2887. "port": "",
  2888. "pathname": "example.com/",
  2889. "search": "",
  2890. "hash": ""
  2891. },
  2892. {
  2893. "input": "ftps:example.com/",
  2894. "base": "about:blank",
  2895. "href": "ftps:example.com/",
  2896. "origin": "null",
  2897. "protocol": "ftps:",
  2898. "username": "",
  2899. "password": "",
  2900. "host": "",
  2901. "hostname": "",
  2902. "port": "",
  2903. "pathname": "example.com/",
  2904. "search": "",
  2905. "hash": ""
  2906. },
  2907. {
  2908. "input": "gopher:example.com/",
  2909. "base": "about:blank",
  2910. "href": "gopher://example.com/",
  2911. "origin": "null",
  2912. "protocol": "gopher:",
  2913. "username": "",
  2914. "password": "",
  2915. "host": "example.com",
  2916. "hostname": "example.com",
  2917. "port": "",
  2918. "pathname": "/",
  2919. "search": "",
  2920. "hash": ""
  2921. },
  2922. {
  2923. "input": "ws:example.com/",
  2924. "base": "about:blank",
  2925. "href": "ws://example.com/",
  2926. "origin": "ws://example.com",
  2927. "protocol": "ws:",
  2928. "username": "",
  2929. "password": "",
  2930. "host": "example.com",
  2931. "hostname": "example.com",
  2932. "port": "",
  2933. "pathname": "/",
  2934. "search": "",
  2935. "hash": ""
  2936. },
  2937. {
  2938. "input": "wss:example.com/",
  2939. "base": "about:blank",
  2940. "href": "wss://example.com/",
  2941. "origin": "wss://example.com",
  2942. "protocol": "wss:",
  2943. "username": "",
  2944. "password": "",
  2945. "host": "example.com",
  2946. "hostname": "example.com",
  2947. "port": "",
  2948. "pathname": "/",
  2949. "search": "",
  2950. "hash": ""
  2951. },
  2952. "NS_NewURI for given input and base fails",
  2953. {
  2954. "input": "data:example.com/",
  2955. "base": "about:blank",
  2956. "href": "data:example.com/",
  2957. "origin": "null",
  2958. "protocol": "data:",
  2959. "username": "",
  2960. "password": "",
  2961. "host": "",
  2962. "hostname": "",
  2963. "port": "",
  2964. "pathname": "example.com/",
  2965. "search": "",
  2966. "hash": "",
  2967. "skip": true
  2968. },
  2969. {
  2970. "input": "javascript:example.com/",
  2971. "base": "about:blank",
  2972. "href": "javascript:example.com/",
  2973. "origin": "null",
  2974. "protocol": "javascript:",
  2975. "username": "",
  2976. "password": "",
  2977. "host": "",
  2978. "hostname": "",
  2979. "port": "",
  2980. "pathname": "example.com/",
  2981. "search": "",
  2982. "hash": ""
  2983. },
  2984. {
  2985. "input": "mailto:example.com/",
  2986. "base": "about:blank",
  2987. "href": "mailto:example.com/",
  2988. "origin": "null",
  2989. "protocol": "mailto:",
  2990. "username": "",
  2991. "password": "",
  2992. "host": "",
  2993. "hostname": "",
  2994. "port": "",
  2995. "pathname": "example.com/",
  2996. "search": "",
  2997. "hash": ""
  2998. },
  2999. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/segments-userinfo-vs-host.html",
  3000. {
  3001. "input": "http:@www.example.com",
  3002. "base": "about:blank",
  3003. "href": "http://www.example.com/",
  3004. "origin": "http://www.example.com",
  3005. "protocol": "http:",
  3006. "username": "",
  3007. "password": "",
  3008. "host": "www.example.com",
  3009. "hostname": "www.example.com",
  3010. "port": "",
  3011. "pathname": "/",
  3012. "search": "",
  3013. "hash": ""
  3014. },
  3015. {
  3016. "input": "http:/@www.example.com",
  3017. "base": "about:blank",
  3018. "href": "http://www.example.com/",
  3019. "origin": "http://www.example.com",
  3020. "protocol": "http:",
  3021. "username": "",
  3022. "password": "",
  3023. "host": "www.example.com",
  3024. "hostname": "www.example.com",
  3025. "port": "",
  3026. "pathname": "/",
  3027. "search": "",
  3028. "hash": ""
  3029. },
  3030. {
  3031. "input": "http://@www.example.com",
  3032. "base": "about:blank",
  3033. "href": "http://www.example.com/",
  3034. "origin": "http://www.example.com",
  3035. "protocol": "http:",
  3036. "username": "",
  3037. "password": "",
  3038. "host": "www.example.com",
  3039. "hostname": "www.example.com",
  3040. "port": "",
  3041. "pathname": "/",
  3042. "search": "",
  3043. "hash": ""
  3044. },
  3045. {
  3046. "input": "http:a:b@www.example.com",
  3047. "base": "about:blank",
  3048. "href": "http://a:b@www.example.com/",
  3049. "origin": "http://www.example.com",
  3050. "protocol": "http:",
  3051. "username": "a",
  3052. "password": "b",
  3053. "host": "www.example.com",
  3054. "hostname": "www.example.com",
  3055. "port": "",
  3056. "pathname": "/",
  3057. "search": "",
  3058. "hash": ""
  3059. },
  3060. {
  3061. "input": "http:/a:b@www.example.com",
  3062. "base": "about:blank",
  3063. "href": "http://a:b@www.example.com/",
  3064. "origin": "http://www.example.com",
  3065. "protocol": "http:",
  3066. "username": "a",
  3067. "password": "b",
  3068. "host": "www.example.com",
  3069. "hostname": "www.example.com",
  3070. "port": "",
  3071. "pathname": "/",
  3072. "search": "",
  3073. "hash": ""
  3074. },
  3075. {
  3076. "input": "http://a:b@www.example.com",
  3077. "base": "about:blank",
  3078. "href": "http://a:b@www.example.com/",
  3079. "origin": "http://www.example.com",
  3080. "protocol": "http:",
  3081. "username": "a",
  3082. "password": "b",
  3083. "host": "www.example.com",
  3084. "hostname": "www.example.com",
  3085. "port": "",
  3086. "pathname": "/",
  3087. "search": "",
  3088. "hash": ""
  3089. },
  3090. {
  3091. "input": "http://@pple.com",
  3092. "base": "about:blank",
  3093. "href": "http://pple.com/",
  3094. "origin": "http://pple.com",
  3095. "protocol": "http:",
  3096. "username": "",
  3097. "password": "",
  3098. "host": "pple.com",
  3099. "hostname": "pple.com",
  3100. "port": "",
  3101. "pathname": "/",
  3102. "search": "",
  3103. "hash": ""
  3104. },
  3105. "NS_NewURI for given input and base fails",
  3106. {
  3107. "input": "http::b@www.example.com",
  3108. "base": "about:blank",
  3109. "href": "http://:b@www.example.com/",
  3110. "origin": "http://www.example.com",
  3111. "protocol": "http:",
  3112. "username": "",
  3113. "password": "b",
  3114. "host": "www.example.com",
  3115. "hostname": "www.example.com",
  3116. "port": "",
  3117. "pathname": "/",
  3118. "search": "",
  3119. "hash": "",
  3120. "skip": true
  3121. },
  3122. {
  3123. "input": "http:/:b@www.example.com",
  3124. "base": "about:blank",
  3125. "href": "http://:b@www.example.com/",
  3126. "origin": "http://www.example.com",
  3127. "protocol": "http:",
  3128. "username": "",
  3129. "password": "b",
  3130. "host": "www.example.com",
  3131. "hostname": "www.example.com",
  3132. "port": "",
  3133. "pathname": "/",
  3134. "search": "",
  3135. "hash": ""
  3136. },
  3137. {
  3138. "input": "http://:b@www.example.com",
  3139. "base": "about:blank",
  3140. "href": "http://:b@www.example.com/",
  3141. "origin": "http://www.example.com",
  3142. "protocol": "http:",
  3143. "username": "",
  3144. "password": "b",
  3145. "host": "www.example.com",
  3146. "hostname": "www.example.com",
  3147. "port": "",
  3148. "pathname": "/",
  3149. "search": "",
  3150. "hash": ""
  3151. },
  3152. {
  3153. "input": "http:/:@/www.example.com",
  3154. "base": "about:blank",
  3155. "failure": true
  3156. },
  3157. {
  3158. "input": "http://user@/www.example.com",
  3159. "base": "about:blank",
  3160. "failure": true
  3161. },
  3162. {
  3163. "input": "http:@/www.example.com",
  3164. "base": "about:blank",
  3165. "failure": true
  3166. },
  3167. {
  3168. "input": "http:/@/www.example.com",
  3169. "base": "about:blank",
  3170. "failure": true
  3171. },
  3172. {
  3173. "input": "http://@/www.example.com",
  3174. "base": "about:blank",
  3175. "failure": true
  3176. },
  3177. {
  3178. "input": "https:@/www.example.com",
  3179. "base": "about:blank",
  3180. "failure": true
  3181. },
  3182. {
  3183. "input": "http:a:b@/www.example.com",
  3184. "base": "about:blank",
  3185. "failure": true
  3186. },
  3187. {
  3188. "input": "http:/a:b@/www.example.com",
  3189. "base": "about:blank",
  3190. "failure": true
  3191. },
  3192. {
  3193. "input": "http://a:b@/www.example.com",
  3194. "base": "about:blank",
  3195. "failure": true
  3196. },
  3197. {
  3198. "input": "http::@/www.example.com",
  3199. "base": "about:blank",
  3200. "failure": true
  3201. },
  3202. {
  3203. "input": "http:a:@www.example.com",
  3204. "base": "about:blank",
  3205. "href": "http://a@www.example.com/",
  3206. "origin": "http://www.example.com",
  3207. "protocol": "http:",
  3208. "username": "a",
  3209. "password": "",
  3210. "host": "www.example.com",
  3211. "hostname": "www.example.com",
  3212. "port": "",
  3213. "pathname": "/",
  3214. "search": "",
  3215. "hash": ""
  3216. },
  3217. {
  3218. "input": "http:/a:@www.example.com",
  3219. "base": "about:blank",
  3220. "href": "http://a@www.example.com/",
  3221. "origin": "http://www.example.com",
  3222. "protocol": "http:",
  3223. "username": "a",
  3224. "password": "",
  3225. "host": "www.example.com",
  3226. "hostname": "www.example.com",
  3227. "port": "",
  3228. "pathname": "/",
  3229. "search": "",
  3230. "hash": ""
  3231. },
  3232. {
  3233. "input": "http://a:@www.example.com",
  3234. "base": "about:blank",
  3235. "href": "http://a@www.example.com/",
  3236. "origin": "http://www.example.com",
  3237. "protocol": "http:",
  3238. "username": "a",
  3239. "password": "",
  3240. "host": "www.example.com",
  3241. "hostname": "www.example.com",
  3242. "port": "",
  3243. "pathname": "/",
  3244. "search": "",
  3245. "hash": ""
  3246. },
  3247. {
  3248. "input": "http://www.@pple.com",
  3249. "base": "about:blank",
  3250. "href": "http://www.@pple.com/",
  3251. "origin": "http://pple.com",
  3252. "protocol": "http:",
  3253. "username": "www.",
  3254. "password": "",
  3255. "host": "pple.com",
  3256. "hostname": "pple.com",
  3257. "port": "",
  3258. "pathname": "/",
  3259. "search": "",
  3260. "hash": ""
  3261. },
  3262. {
  3263. "input": "http:@:www.example.com",
  3264. "base": "about:blank",
  3265. "failure": true
  3266. },
  3267. {
  3268. "input": "http:/@:www.example.com",
  3269. "base": "about:blank",
  3270. "failure": true
  3271. },
  3272. {
  3273. "input": "http://@:www.example.com",
  3274. "base": "about:blank",
  3275. "failure": true
  3276. },
  3277. {
  3278. "input": "http://:@www.example.com",
  3279. "base": "about:blank",
  3280. "href": "http://www.example.com/",
  3281. "origin": "http://www.example.com",
  3282. "protocol": "http:",
  3283. "username": "",
  3284. "password": "",
  3285. "host": "www.example.com",
  3286. "hostname": "www.example.com",
  3287. "port": "",
  3288. "pathname": "/",
  3289. "search": "",
  3290. "hash": ""
  3291. },
  3292. "# Others",
  3293. {
  3294. "input": "/",
  3295. "base": "http://www.example.com/test",
  3296. "href": "http://www.example.com/",
  3297. "origin": "http://www.example.com",
  3298. "protocol": "http:",
  3299. "username": "",
  3300. "password": "",
  3301. "host": "www.example.com",
  3302. "hostname": "www.example.com",
  3303. "port": "",
  3304. "pathname": "/",
  3305. "search": "",
  3306. "hash": ""
  3307. },
  3308. {
  3309. "input": "/test.txt",
  3310. "base": "http://www.example.com/test",
  3311. "href": "http://www.example.com/test.txt",
  3312. "origin": "http://www.example.com",
  3313. "protocol": "http:",
  3314. "username": "",
  3315. "password": "",
  3316. "host": "www.example.com",
  3317. "hostname": "www.example.com",
  3318. "port": "",
  3319. "pathname": "/test.txt",
  3320. "search": "",
  3321. "hash": ""
  3322. },
  3323. {
  3324. "input": ".",
  3325. "base": "http://www.example.com/test",
  3326. "href": "http://www.example.com/",
  3327. "origin": "http://www.example.com",
  3328. "protocol": "http:",
  3329. "username": "",
  3330. "password": "",
  3331. "host": "www.example.com",
  3332. "hostname": "www.example.com",
  3333. "port": "",
  3334. "pathname": "/",
  3335. "search": "",
  3336. "hash": ""
  3337. },
  3338. {
  3339. "input": "..",
  3340. "base": "http://www.example.com/test",
  3341. "href": "http://www.example.com/",
  3342. "origin": "http://www.example.com",
  3343. "protocol": "http:",
  3344. "username": "",
  3345. "password": "",
  3346. "host": "www.example.com",
  3347. "hostname": "www.example.com",
  3348. "port": "",
  3349. "pathname": "/",
  3350. "search": "",
  3351. "hash": ""
  3352. },
  3353. {
  3354. "input": "test.txt",
  3355. "base": "http://www.example.com/test",
  3356. "href": "http://www.example.com/test.txt",
  3357. "origin": "http://www.example.com",
  3358. "protocol": "http:",
  3359. "username": "",
  3360. "password": "",
  3361. "host": "www.example.com",
  3362. "hostname": "www.example.com",
  3363. "port": "",
  3364. "pathname": "/test.txt",
  3365. "search": "",
  3366. "hash": ""
  3367. },
  3368. {
  3369. "input": "./test.txt",
  3370. "base": "http://www.example.com/test",
  3371. "href": "http://www.example.com/test.txt",
  3372. "origin": "http://www.example.com",
  3373. "protocol": "http:",
  3374. "username": "",
  3375. "password": "",
  3376. "host": "www.example.com",
  3377. "hostname": "www.example.com",
  3378. "port": "",
  3379. "pathname": "/test.txt",
  3380. "search": "",
  3381. "hash": ""
  3382. },
  3383. {
  3384. "input": "../test.txt",
  3385. "base": "http://www.example.com/test",
  3386. "href": "http://www.example.com/test.txt",
  3387. "origin": "http://www.example.com",
  3388. "protocol": "http:",
  3389. "username": "",
  3390. "password": "",
  3391. "host": "www.example.com",
  3392. "hostname": "www.example.com",
  3393. "port": "",
  3394. "pathname": "/test.txt",
  3395. "search": "",
  3396. "hash": ""
  3397. },
  3398. {
  3399. "input": "../aaa/test.txt",
  3400. "base": "http://www.example.com/test",
  3401. "href": "http://www.example.com/aaa/test.txt",
  3402. "origin": "http://www.example.com",
  3403. "protocol": "http:",
  3404. "username": "",
  3405. "password": "",
  3406. "host": "www.example.com",
  3407. "hostname": "www.example.com",
  3408. "port": "",
  3409. "pathname": "/aaa/test.txt",
  3410. "search": "",
  3411. "hash": ""
  3412. },
  3413. {
  3414. "input": "../../test.txt",
  3415. "base": "http://www.example.com/test",
  3416. "href": "http://www.example.com/test.txt",
  3417. "origin": "http://www.example.com",
  3418. "protocol": "http:",
  3419. "username": "",
  3420. "password": "",
  3421. "host": "www.example.com",
  3422. "hostname": "www.example.com",
  3423. "port": "",
  3424. "pathname": "/test.txt",
  3425. "search": "",
  3426. "hash": ""
  3427. },
  3428. {
  3429. "input": "中/test.txt",
  3430. "base": "http://www.example.com/test",
  3431. "href": "http://www.example.com/%E4%B8%AD/test.txt",
  3432. "origin": "http://www.example.com",
  3433. "protocol": "http:",
  3434. "username": "",
  3435. "password": "",
  3436. "host": "www.example.com",
  3437. "hostname": "www.example.com",
  3438. "port": "",
  3439. "pathname": "/%E4%B8%AD/test.txt",
  3440. "search": "",
  3441. "hash": ""
  3442. },
  3443. {
  3444. "input": "http://www.example2.com",
  3445. "base": "http://www.example.com/test",
  3446. "href": "http://www.example2.com/",
  3447. "origin": "http://www.example2.com",
  3448. "protocol": "http:",
  3449. "username": "",
  3450. "password": "",
  3451. "host": "www.example2.com",
  3452. "hostname": "www.example2.com",
  3453. "port": "",
  3454. "pathname": "/",
  3455. "search": "",
  3456. "hash": ""
  3457. },
  3458. {
  3459. "input": "//www.example2.com",
  3460. "base": "http://www.example.com/test",
  3461. "href": "http://www.example2.com/",
  3462. "origin": "http://www.example2.com",
  3463. "protocol": "http:",
  3464. "username": "",
  3465. "password": "",
  3466. "host": "www.example2.com",
  3467. "hostname": "www.example2.com",
  3468. "port": "",
  3469. "pathname": "/",
  3470. "search": "",
  3471. "hash": ""
  3472. },
  3473. {
  3474. "input": "file:...",
  3475. "base": "http://www.example.com/test",
  3476. "href": "file:///...",
  3477. "protocol": "file:",
  3478. "username": "",
  3479. "password": "",
  3480. "host": "",
  3481. "hostname": "",
  3482. "port": "",
  3483. "pathname": "/...",
  3484. "search": "",
  3485. "hash": ""
  3486. },
  3487. {
  3488. "input": "file:..",
  3489. "base": "http://www.example.com/test",
  3490. "href": "file:///",
  3491. "protocol": "file:",
  3492. "username": "",
  3493. "password": "",
  3494. "host": "",
  3495. "hostname": "",
  3496. "port": "",
  3497. "pathname": "/",
  3498. "search": "",
  3499. "hash": ""
  3500. },
  3501. {
  3502. "input": "file:a",
  3503. "base": "http://www.example.com/test",
  3504. "href": "file:///a",
  3505. "protocol": "file:",
  3506. "username": "",
  3507. "password": "",
  3508. "host": "",
  3509. "hostname": "",
  3510. "port": "",
  3511. "pathname": "/a",
  3512. "search": "",
  3513. "hash": ""
  3514. },
  3515. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/host.html",
  3516. "Basic canonicalization, uppercase should be converted to lowercase",
  3517. {
  3518. "input": "http://ExAmPlE.CoM",
  3519. "base": "http://other.com/",
  3520. "href": "http://example.com/",
  3521. "origin": "http://example.com",
  3522. "protocol": "http:",
  3523. "username": "",
  3524. "password": "",
  3525. "host": "example.com",
  3526. "hostname": "example.com",
  3527. "port": "",
  3528. "pathname": "/",
  3529. "search": "",
  3530. "hash": ""
  3531. },
  3532. {
  3533. "input": "http://example example.com",
  3534. "base": "http://other.com/",
  3535. "failure": true
  3536. },
  3537. {
  3538. "input": "http://Goo%20 goo%7C|.com",
  3539. "base": "http://other.com/",
  3540. "failure": true
  3541. },
  3542. {
  3543. "input": "http://[]",
  3544. "base": "http://other.com/",
  3545. "failure": true
  3546. },
  3547. {
  3548. "input": "http://[:]",
  3549. "base": "http://other.com/",
  3550. "failure": true
  3551. },
  3552. "U+3000 is mapped to U+0020 (space) which is disallowed",
  3553. {
  3554. "input": "http://GOO\u00a0\u3000goo.com",
  3555. "base": "http://other.com/",
  3556. "failure": true
  3557. },
  3558. "Other types of space (no-break, zero-width, zero-width-no-break) are name-prepped away to nothing. U+200B, U+2060, and U+FEFF, are ignored",
  3559. {
  3560. "input": "http://GOO\u200b\u2060\ufeffgoo.com",
  3561. "base": "http://other.com/",
  3562. "href": "http://googoo.com/",
  3563. "origin": "http://googoo.com",
  3564. "protocol": "http:",
  3565. "username": "",
  3566. "password": "",
  3567. "host": "googoo.com",
  3568. "hostname": "googoo.com",
  3569. "port": "",
  3570. "pathname": "/",
  3571. "search": "",
  3572. "hash": ""
  3573. },
  3574. "Leading and trailing C0 control or space",
  3575. {
  3576. "input": "\u0000\u001b\u0004\u0012 http://example.com/\u001f \u000d ",
  3577. "base": "about:blank",
  3578. "href": "http://example.com/",
  3579. "origin": "http://example.com",
  3580. "protocol": "http:",
  3581. "username": "",
  3582. "password": "",
  3583. "host": "example.com",
  3584. "hostname": "example.com",
  3585. "port": "",
  3586. "pathname": "/",
  3587. "search": "",
  3588. "hash": ""
  3589. },
  3590. "Ideographic full stop (full-width period for Chinese, etc.) should be treated as a dot. U+3002 is mapped to U+002E (dot)",
  3591. {
  3592. "input": "http://www.foo。bar.com",
  3593. "base": "http://other.com/",
  3594. "href": "http://www.foo.bar.com/",
  3595. "origin": "http://www.foo.bar.com",
  3596. "protocol": "http:",
  3597. "username": "",
  3598. "password": "",
  3599. "host": "www.foo.bar.com",
  3600. "hostname": "www.foo.bar.com",
  3601. "port": "",
  3602. "pathname": "/",
  3603. "search": "",
  3604. "hash": ""
  3605. },
  3606. "Invalid unicode characters should fail... U+FDD0 is disallowed; %ef%b7%90 is U+FDD0",
  3607. {
  3608. "input": "http://\ufdd0zyx.com",
  3609. "base": "http://other.com/",
  3610. "failure": true
  3611. },
  3612. "This is the same as previous but escaped",
  3613. {
  3614. "input": "http://%ef%b7%90zyx.com",
  3615. "base": "http://other.com/",
  3616. "failure": true
  3617. },
  3618. "U+FFFD",
  3619. {
  3620. "input": "https://\ufffd",
  3621. "base": "about:blank",
  3622. "failure": true
  3623. },
  3624. {
  3625. "input": "https://%EF%BF%BD",
  3626. "base": "about:blank",
  3627. "failure": true
  3628. },
  3629. {
  3630. "input": "https://x/\ufffd?\ufffd#\ufffd",
  3631. "base": "about:blank",
  3632. "href": "https://x/%EF%BF%BD?%EF%BF%BD#%EF%BF%BD",
  3633. "origin": "https://x",
  3634. "protocol": "https:",
  3635. "username": "",
  3636. "password": "",
  3637. "host": "x",
  3638. "hostname": "x",
  3639. "port": "",
  3640. "pathname": "/%EF%BF%BD",
  3641. "search": "?%EF%BF%BD",
  3642. "hash": "#%EF%BF%BD"
  3643. },
  3644. "Test name prepping, fullwidth input should be converted to ASCII and NOT IDN-ized. This is 'Go' in fullwidth UTF-8/UTF-16.",
  3645. {
  3646. "input": "http://Go.com",
  3647. "base": "http://other.com/",
  3648. "href": "http://go.com/",
  3649. "origin": "http://go.com",
  3650. "protocol": "http:",
  3651. "username": "",
  3652. "password": "",
  3653. "host": "go.com",
  3654. "hostname": "go.com",
  3655. "port": "",
  3656. "pathname": "/",
  3657. "search": "",
  3658. "hash": ""
  3659. },
  3660. "URL spec forbids the following. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24257",
  3661. {
  3662. "input": "http://%41.com",
  3663. "base": "http://other.com/",
  3664. "failure": true
  3665. },
  3666. {
  3667. "input": "http://%ef%bc%85%ef%bc%94%ef%bc%91.com",
  3668. "base": "http://other.com/",
  3669. "failure": true
  3670. },
  3671. "...%00 in fullwidth should fail (also as escaped UTF-8 input)",
  3672. {
  3673. "input": "http://%00.com",
  3674. "base": "http://other.com/",
  3675. "failure": true
  3676. },
  3677. {
  3678. "input": "http://%ef%bc%85%ef%bc%90%ef%bc%90.com",
  3679. "base": "http://other.com/",
  3680. "failure": true
  3681. },
  3682. "Basic IDN support, UTF-8 and UTF-16 input should be converted to IDN",
  3683. {
  3684. "input": "http://你好你好",
  3685. "base": "http://other.com/",
  3686. "href": "http://xn--6qqa088eba/",
  3687. "origin": "http://xn--6qqa088eba",
  3688. "protocol": "http:",
  3689. "username": "",
  3690. "password": "",
  3691. "host": "xn--6qqa088eba",
  3692. "hostname": "xn--6qqa088eba",
  3693. "port": "",
  3694. "pathname": "/",
  3695. "search": "",
  3696. "hash": ""
  3697. },
  3698. "Origin computed by MozURL is wrong",
  3699. {
  3700. "input": "https://faß.ExAmPlE/",
  3701. "base": "about:blank",
  3702. "href": "https://xn--fa-hia.example/",
  3703. "origin": "https://xn--fa-hia.example",
  3704. "protocol": "https:",
  3705. "username": "",
  3706. "password": "",
  3707. "host": "xn--fa-hia.example",
  3708. "hostname": "xn--fa-hia.example",
  3709. "port": "",
  3710. "pathname": "/",
  3711. "search": "",
  3712. "hash": "",
  3713. "skip": true
  3714. },
  3715. {
  3716. "input": "sc://faß.ExAmPlE/",
  3717. "base": "about:blank",
  3718. "href": "sc://fa%C3%9F.ExAmPlE/",
  3719. "origin": "null",
  3720. "protocol": "sc:",
  3721. "username": "",
  3722. "password": "",
  3723. "host": "fa%C3%9F.ExAmPlE",
  3724. "hostname": "fa%C3%9F.ExAmPlE",
  3725. "port": "",
  3726. "pathname": "/",
  3727. "search": "",
  3728. "hash": ""
  3729. },
  3730. "Invalid escaped characters should fail and the percents should be escaped. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24191",
  3731. {
  3732. "input": "http://%zz%66%a.com",
  3733. "base": "http://other.com/",
  3734. "failure": true
  3735. },
  3736. "If we get an invalid character that has been escaped.",
  3737. {
  3738. "input": "http://%25",
  3739. "base": "http://other.com/",
  3740. "failure": true
  3741. },
  3742. {
  3743. "input": "http://hello%00",
  3744. "base": "http://other.com/",
  3745. "failure": true
  3746. },
  3747. "Escaped numbers should be treated like IP addresses if they are.",
  3748. {
  3749. "input": "http://%30%78%63%30%2e%30%32%35%30.01",
  3750. "base": "http://other.com/",
  3751. "href": "http://192.168.0.1/",
  3752. "origin": "http://192.168.0.1",
  3753. "protocol": "http:",
  3754. "username": "",
  3755. "password": "",
  3756. "host": "192.168.0.1",
  3757. "hostname": "192.168.0.1",
  3758. "port": "",
  3759. "pathname": "/",
  3760. "search": "",
  3761. "hash": ""
  3762. },
  3763. {
  3764. "input": "http://%30%78%63%30%2e%30%32%35%30.01%2e",
  3765. "base": "http://other.com/",
  3766. "href": "http://192.168.0.1/",
  3767. "origin": "http://192.168.0.1",
  3768. "protocol": "http:",
  3769. "username": "",
  3770. "password": "",
  3771. "host": "192.168.0.1",
  3772. "hostname": "192.168.0.1",
  3773. "port": "",
  3774. "pathname": "/",
  3775. "search": "",
  3776. "hash": ""
  3777. },
  3778. {
  3779. "input": "http://192.168.0.257",
  3780. "base": "http://other.com/",
  3781. "failure": true
  3782. },
  3783. "Invalid escaping in hosts causes failure",
  3784. {
  3785. "input": "http://%3g%78%63%30%2e%30%32%35%30%2E.01",
  3786. "base": "http://other.com/",
  3787. "failure": true
  3788. },
  3789. "A space in a host causes failure",
  3790. {
  3791. "input": "http://192.168.0.1 hello",
  3792. "base": "http://other.com/",
  3793. "failure": true
  3794. },
  3795. {
  3796. "input": "https://x x:12",
  3797. "base": "about:blank",
  3798. "failure": true
  3799. },
  3800. "Fullwidth and escaped UTF-8 fullwidth should still be treated as IP",
  3801. {
  3802. "input": "http://0Xc0.0250.01",
  3803. "base": "http://other.com/",
  3804. "href": "http://192.168.0.1/",
  3805. "origin": "http://192.168.0.1",
  3806. "protocol": "http:",
  3807. "username": "",
  3808. "password": "",
  3809. "host": "192.168.0.1",
  3810. "hostname": "192.168.0.1",
  3811. "port": "",
  3812. "pathname": "/",
  3813. "search": "",
  3814. "hash": ""
  3815. },
  3816. "Domains with empty labels",
  3817. {
  3818. "input": "http://./",
  3819. "base": "about:blank",
  3820. "href": "http://./",
  3821. "origin": "http://.",
  3822. "protocol": "http:",
  3823. "username": "",
  3824. "password": "",
  3825. "host": ".",
  3826. "hostname": ".",
  3827. "port": "",
  3828. "pathname": "/",
  3829. "search": "",
  3830. "hash": ""
  3831. },
  3832. {
  3833. "input": "http://../",
  3834. "base": "about:blank",
  3835. "href": "http://../",
  3836. "origin": "http://..",
  3837. "protocol": "http:",
  3838. "username": "",
  3839. "password": "",
  3840. "host": "..",
  3841. "hostname": "..",
  3842. "port": "",
  3843. "pathname": "/",
  3844. "search": "",
  3845. "hash": ""
  3846. },
  3847. {
  3848. "input": "http://0..0x300/",
  3849. "base": "about:blank",
  3850. "href": "http://0..0x300/",
  3851. "origin": "http://0..0x300",
  3852. "protocol": "http:",
  3853. "username": "",
  3854. "password": "",
  3855. "host": "0..0x300",
  3856. "hostname": "0..0x300",
  3857. "port": "",
  3858. "pathname": "/",
  3859. "search": "",
  3860. "hash": ""
  3861. },
  3862. "Broken IPv6",
  3863. {
  3864. "input": "http://[www.google.com]/",
  3865. "base": "about:blank",
  3866. "failure": true
  3867. },
  3868. {
  3869. "input": "http://[google.com]",
  3870. "base": "http://other.com/",
  3871. "failure": true
  3872. },
  3873. {
  3874. "input": "http://[::1.2.3.4x]",
  3875. "base": "http://other.com/",
  3876. "failure": true
  3877. },
  3878. {
  3879. "input": "http://[::1.2.3.]",
  3880. "base": "http://other.com/",
  3881. "failure": true
  3882. },
  3883. {
  3884. "input": "http://[::1.2.]",
  3885. "base": "http://other.com/",
  3886. "failure": true
  3887. },
  3888. {
  3889. "input": "http://[::1.]",
  3890. "base": "http://other.com/",
  3891. "failure": true
  3892. },
  3893. "Misc Unicode",
  3894. {
  3895. "input": "http://foo:💩@example.com/bar",
  3896. "base": "http://other.com/",
  3897. "href": "http://foo:%F0%9F%92%A9@example.com/bar",
  3898. "origin": "http://example.com",
  3899. "protocol": "http:",
  3900. "username": "foo",
  3901. "password": "%F0%9F%92%A9",
  3902. "host": "example.com",
  3903. "hostname": "example.com",
  3904. "port": "",
  3905. "pathname": "/bar",
  3906. "search": "",
  3907. "hash": ""
  3908. },
  3909. "# resolving a fragment against any scheme succeeds",
  3910. {
  3911. "input": "#",
  3912. "base": "test:test",
  3913. "href": "test:test#",
  3914. "origin": "null",
  3915. "protocol": "test:",
  3916. "username": "",
  3917. "password": "",
  3918. "host": "",
  3919. "hostname": "",
  3920. "port": "",
  3921. "pathname": "test",
  3922. "search": "",
  3923. "hash": ""
  3924. },
  3925. {
  3926. "input": "#x",
  3927. "base": "mailto:x@x.com",
  3928. "href": "mailto:x@x.com#x",
  3929. "origin": "null",
  3930. "protocol": "mailto:",
  3931. "username": "",
  3932. "password": "",
  3933. "host": "",
  3934. "hostname": "",
  3935. "port": "",
  3936. "pathname": "x@x.com",
  3937. "search": "",
  3938. "hash": "#x"
  3939. },
  3940. {
  3941. "input": "#x",
  3942. "base": "data:,",
  3943. "href": "data:,#x",
  3944. "origin": "null",
  3945. "protocol": "data:",
  3946. "username": "",
  3947. "password": "",
  3948. "host": "",
  3949. "hostname": "",
  3950. "port": "",
  3951. "pathname": ",",
  3952. "search": "",
  3953. "hash": "#x"
  3954. },
  3955. {
  3956. "input": "#x",
  3957. "base": "about:blank",
  3958. "href": "about:blank#x",
  3959. "origin": "null",
  3960. "protocol": "about:",
  3961. "username": "",
  3962. "password": "",
  3963. "host": "",
  3964. "hostname": "",
  3965. "port": "",
  3966. "pathname": "blank",
  3967. "search": "",
  3968. "hash": "#x"
  3969. },
  3970. {
  3971. "input": "#",
  3972. "base": "test:test?test",
  3973. "href": "test:test?test#",
  3974. "origin": "null",
  3975. "protocol": "test:",
  3976. "username": "",
  3977. "password": "",
  3978. "host": "",
  3979. "hostname": "",
  3980. "port": "",
  3981. "pathname": "test",
  3982. "search": "?test",
  3983. "hash": ""
  3984. },
  3985. "# multiple @ in authority state",
  3986. {
  3987. "input": "https://@test@test@example:800/",
  3988. "base": "http://doesnotmatter/",
  3989. "href": "https://%40test%40test@example:800/",
  3990. "origin": "https://example:800",
  3991. "protocol": "https:",
  3992. "username": "%40test%40test",
  3993. "password": "",
  3994. "host": "example:800",
  3995. "hostname": "example",
  3996. "port": "800",
  3997. "pathname": "/",
  3998. "search": "",
  3999. "hash": ""
  4000. },
  4001. {
  4002. "input": "https://@@@example",
  4003. "base": "http://doesnotmatter/",
  4004. "href": "https://%40%40@example/",
  4005. "origin": "https://example",
  4006. "protocol": "https:",
  4007. "username": "%40%40",
  4008. "password": "",
  4009. "host": "example",
  4010. "hostname": "example",
  4011. "port": "",
  4012. "pathname": "/",
  4013. "search": "",
  4014. "hash": ""
  4015. },
  4016. "non-az-09 characters",
  4017. {
  4018. "input": "http://`{}:`{}@h/`{}?`{}",
  4019. "base": "http://doesnotmatter/",
  4020. "href": "http://%60%7B%7D:%60%7B%7D@h/%60%7B%7D?`{}",
  4021. "origin": "http://h",
  4022. "protocol": "http:",
  4023. "username": "%60%7B%7D",
  4024. "password": "%60%7B%7D",
  4025. "host": "h",
  4026. "hostname": "h",
  4027. "port": "",
  4028. "pathname": "/%60%7B%7D",
  4029. "search": "?`{}",
  4030. "hash": ""
  4031. },
  4032. "# Credentials in base",
  4033. {
  4034. "input": "/some/path",
  4035. "base": "http://user@example.org/smth",
  4036. "href": "http://user@example.org/some/path",
  4037. "origin": "http://example.org",
  4038. "protocol": "http:",
  4039. "username": "user",
  4040. "password": "",
  4041. "host": "example.org",
  4042. "hostname": "example.org",
  4043. "port": "",
  4044. "pathname": "/some/path",
  4045. "search": "",
  4046. "hash": ""
  4047. },
  4048. {
  4049. "input": "",
  4050. "base": "http://user:pass@example.org:21/smth",
  4051. "href": "http://user:pass@example.org:21/smth",
  4052. "origin": "http://example.org:21",
  4053. "protocol": "http:",
  4054. "username": "user",
  4055. "password": "pass",
  4056. "host": "example.org:21",
  4057. "hostname": "example.org",
  4058. "port": "21",
  4059. "pathname": "/smth",
  4060. "search": "",
  4061. "hash": ""
  4062. },
  4063. {
  4064. "input": "/some/path",
  4065. "base": "http://user:pass@example.org:21/smth",
  4066. "href": "http://user:pass@example.org:21/some/path",
  4067. "origin": "http://example.org:21",
  4068. "protocol": "http:",
  4069. "username": "user",
  4070. "password": "pass",
  4071. "host": "example.org:21",
  4072. "hostname": "example.org",
  4073. "port": "21",
  4074. "pathname": "/some/path",
  4075. "search": "",
  4076. "hash": ""
  4077. },
  4078. "# a set of tests designed by zcorpan for relative URLs with unknown schemes",
  4079. {
  4080. "input": "i",
  4081. "base": "sc:sd",
  4082. "failure": true
  4083. },
  4084. {
  4085. "input": "i",
  4086. "base": "sc:sd/sd",
  4087. "failure": true
  4088. },
  4089. "NS_NewURI for given input and base fails",
  4090. {
  4091. "input": "i",
  4092. "base": "sc:/pa/pa",
  4093. "href": "sc:/pa/i",
  4094. "origin": "null",
  4095. "protocol": "sc:",
  4096. "username": "",
  4097. "password": "",
  4098. "host": "",
  4099. "hostname": "",
  4100. "port": "",
  4101. "pathname": "/pa/i",
  4102. "search": "",
  4103. "hash": "",
  4104. "skip": true
  4105. },
  4106. "NS_NewURI for given input and base fails",
  4107. {
  4108. "input": "i",
  4109. "base": "sc://ho/pa",
  4110. "href": "sc://ho/i",
  4111. "origin": "null",
  4112. "protocol": "sc:",
  4113. "username": "",
  4114. "password": "",
  4115. "host": "ho",
  4116. "hostname": "ho",
  4117. "port": "",
  4118. "pathname": "/i",
  4119. "search": "",
  4120. "hash": "",
  4121. "skip": true
  4122. },
  4123. "NS_NewURI for given input and base fails",
  4124. {
  4125. "input": "i",
  4126. "base": "sc:///pa/pa",
  4127. "href": "sc:///pa/i",
  4128. "origin": "null",
  4129. "protocol": "sc:",
  4130. "username": "",
  4131. "password": "",
  4132. "host": "",
  4133. "hostname": "",
  4134. "port": "",
  4135. "pathname": "/pa/i",
  4136. "search": "",
  4137. "hash": "",
  4138. "skip": true
  4139. },
  4140. {
  4141. "input": "../i",
  4142. "base": "sc:sd",
  4143. "failure": true
  4144. },
  4145. {
  4146. "input": "../i",
  4147. "base": "sc:sd/sd",
  4148. "failure": true
  4149. },
  4150. "NS_NewURI for given input and base fails",
  4151. {
  4152. "input": "../i",
  4153. "base": "sc:/pa/pa",
  4154. "href": "sc:/i",
  4155. "origin": "null",
  4156. "protocol": "sc:",
  4157. "username": "",
  4158. "password": "",
  4159. "host": "",
  4160. "hostname": "",
  4161. "port": "",
  4162. "pathname": "/i",
  4163. "search": "",
  4164. "hash": "",
  4165. "skip": true
  4166. },
  4167. "NS_NewURI for given input and base fails",
  4168. {
  4169. "input": "../i",
  4170. "base": "sc://ho/pa",
  4171. "href": "sc://ho/i",
  4172. "origin": "null",
  4173. "protocol": "sc:",
  4174. "username": "",
  4175. "password": "",
  4176. "host": "ho",
  4177. "hostname": "ho",
  4178. "port": "",
  4179. "pathname": "/i",
  4180. "search": "",
  4181. "hash": "",
  4182. "skip": true
  4183. },
  4184. "NS_NewURI for given input and base fails",
  4185. {
  4186. "input": "../i",
  4187. "base": "sc:///pa/pa",
  4188. "href": "sc:///i",
  4189. "origin": "null",
  4190. "protocol": "sc:",
  4191. "username": "",
  4192. "password": "",
  4193. "host": "",
  4194. "hostname": "",
  4195. "port": "",
  4196. "pathname": "/i",
  4197. "search": "",
  4198. "hash": "",
  4199. "skip": true
  4200. },
  4201. {
  4202. "input": "/i",
  4203. "base": "sc:sd",
  4204. "failure": true
  4205. },
  4206. {
  4207. "input": "/i",
  4208. "base": "sc:sd/sd",
  4209. "failure": true
  4210. },
  4211. "NS_NewURI for given input and base fails",
  4212. {
  4213. "input": "/i",
  4214. "base": "sc:/pa/pa",
  4215. "href": "sc:/i",
  4216. "origin": "null",
  4217. "protocol": "sc:",
  4218. "username": "",
  4219. "password": "",
  4220. "host": "",
  4221. "hostname": "",
  4222. "port": "",
  4223. "pathname": "/i",
  4224. "search": "",
  4225. "hash": "",
  4226. "skip": true
  4227. },
  4228. "NS_NewURI for given input and base fails",
  4229. {
  4230. "input": "/i",
  4231. "base": "sc://ho/pa",
  4232. "href": "sc://ho/i",
  4233. "origin": "null",
  4234. "protocol": "sc:",
  4235. "username": "",
  4236. "password": "",
  4237. "host": "ho",
  4238. "hostname": "ho",
  4239. "port": "",
  4240. "pathname": "/i",
  4241. "search": "",
  4242. "hash": "",
  4243. "skip": true
  4244. },
  4245. "NS_NewURI for given input and base fails",
  4246. {
  4247. "input": "/i",
  4248. "base": "sc:///pa/pa",
  4249. "href": "sc:///i",
  4250. "origin": "null",
  4251. "protocol": "sc:",
  4252. "username": "",
  4253. "password": "",
  4254. "host": "",
  4255. "hostname": "",
  4256. "port": "",
  4257. "pathname": "/i",
  4258. "search": "",
  4259. "hash": "",
  4260. "skip": true
  4261. },
  4262. {
  4263. "input": "?i",
  4264. "base": "sc:sd",
  4265. "failure": true
  4266. },
  4267. {
  4268. "input": "?i",
  4269. "base": "sc:sd/sd",
  4270. "failure": true
  4271. },
  4272. "NS_NewURI for given input and base fails",
  4273. {
  4274. "input": "?i",
  4275. "base": "sc:/pa/pa",
  4276. "href": "sc:/pa/pa?i",
  4277. "origin": "null",
  4278. "protocol": "sc:",
  4279. "username": "",
  4280. "password": "",
  4281. "host": "",
  4282. "hostname": "",
  4283. "port": "",
  4284. "pathname": "/pa/pa",
  4285. "search": "?i",
  4286. "hash": "",
  4287. "skip": true
  4288. },
  4289. "NS_NewURI for given input and base fails",
  4290. {
  4291. "input": "?i",
  4292. "base": "sc://ho/pa",
  4293. "href": "sc://ho/pa?i",
  4294. "origin": "null",
  4295. "protocol": "sc:",
  4296. "username": "",
  4297. "password": "",
  4298. "host": "ho",
  4299. "hostname": "ho",
  4300. "port": "",
  4301. "pathname": "/pa",
  4302. "search": "?i",
  4303. "hash": "",
  4304. "skip": true
  4305. },
  4306. "NS_NewURI for given input and base fails",
  4307. {
  4308. "skip": true,
  4309. "input": "?i",
  4310. "base": "sc:///pa/pa",
  4311. "href": "sc:///pa/pa?i",
  4312. "origin": "null",
  4313. "protocol": "sc:",
  4314. "username": "",
  4315. "password": "",
  4316. "host": "",
  4317. "hostname": "",
  4318. "port": "",
  4319. "pathname": "/pa/pa",
  4320. "search": "?i",
  4321. "hash": ""
  4322. },
  4323. {
  4324. "input": "#i",
  4325. "base": "sc:sd",
  4326. "href": "sc:sd#i",
  4327. "origin": "null",
  4328. "protocol": "sc:",
  4329. "username": "",
  4330. "password": "",
  4331. "host": "",
  4332. "hostname": "",
  4333. "port": "",
  4334. "pathname": "sd",
  4335. "search": "",
  4336. "hash": "#i"
  4337. },
  4338. {
  4339. "input": "#i",
  4340. "base": "sc:sd/sd",
  4341. "href": "sc:sd/sd#i",
  4342. "origin": "null",
  4343. "protocol": "sc:",
  4344. "username": "",
  4345. "password": "",
  4346. "host": "",
  4347. "hostname": "",
  4348. "port": "",
  4349. "pathname": "sd/sd",
  4350. "search": "",
  4351. "hash": "#i"
  4352. },
  4353. {
  4354. "input": "#i",
  4355. "base": "sc:/pa/pa",
  4356. "href": "sc:/pa/pa#i",
  4357. "origin": "null",
  4358. "protocol": "sc:",
  4359. "username": "",
  4360. "password": "",
  4361. "host": "",
  4362. "hostname": "",
  4363. "port": "",
  4364. "pathname": "/pa/pa",
  4365. "search": "",
  4366. "hash": "#i"
  4367. },
  4368. {
  4369. "input": "#i",
  4370. "base": "sc://ho/pa",
  4371. "href": "sc://ho/pa#i",
  4372. "origin": "null",
  4373. "protocol": "sc:",
  4374. "username": "",
  4375. "password": "",
  4376. "host": "ho",
  4377. "hostname": "ho",
  4378. "port": "",
  4379. "pathname": "/pa",
  4380. "search": "",
  4381. "hash": "#i"
  4382. },
  4383. {
  4384. "input": "#i",
  4385. "base": "sc:///pa/pa",
  4386. "href": "sc:///pa/pa#i",
  4387. "origin": "null",
  4388. "protocol": "sc:",
  4389. "username": "",
  4390. "password": "",
  4391. "host": "",
  4392. "hostname": "",
  4393. "port": "",
  4394. "pathname": "/pa/pa",
  4395. "search": "",
  4396. "hash": "#i"
  4397. },
  4398. "# make sure that relative URL logic works on known typically non-relative schemes too",
  4399. "Origin computed by MozURL is wrong",
  4400. {
  4401. "input": "about:/../",
  4402. "base": "about:blank",
  4403. "href": "about:/",
  4404. "origin": "about:/../",
  4405. "protocol": "about:",
  4406. "username": "",
  4407. "password": "",
  4408. "host": "",
  4409. "hostname": "",
  4410. "port": "",
  4411. "pathname": "/",
  4412. "search": "",
  4413. "hash": "",
  4414. "skip": true
  4415. },
  4416. "NS_NewURI for given input and base fails",
  4417. {
  4418. "input": "data:/../",
  4419. "base": "about:blank",
  4420. "href": "data:/",
  4421. "origin": "null",
  4422. "protocol": "data:",
  4423. "username": "",
  4424. "password": "",
  4425. "host": "",
  4426. "hostname": "",
  4427. "port": "",
  4428. "pathname": "/",
  4429. "search": "",
  4430. "hash": "",
  4431. "skip": true
  4432. },
  4433. {
  4434. "input": "javascript:/../",
  4435. "base": "about:blank",
  4436. "href": "javascript:/",
  4437. "origin": "null",
  4438. "protocol": "javascript:",
  4439. "username": "",
  4440. "password": "",
  4441. "host": "",
  4442. "hostname": "",
  4443. "port": "",
  4444. "pathname": "/",
  4445. "search": "",
  4446. "hash": ""
  4447. },
  4448. {
  4449. "input": "mailto:/../",
  4450. "base": "about:blank",
  4451. "href": "mailto:/",
  4452. "origin": "null",
  4453. "protocol": "mailto:",
  4454. "username": "",
  4455. "password": "",
  4456. "host": "",
  4457. "hostname": "",
  4458. "port": "",
  4459. "pathname": "/",
  4460. "search": "",
  4461. "hash": ""
  4462. },
  4463. "# unknown schemes and their hosts",
  4464. {
  4465. "input": "sc://ñ.test/",
  4466. "base": "about:blank",
  4467. "href": "sc://%C3%B1.test/",
  4468. "origin": "null",
  4469. "protocol": "sc:",
  4470. "username": "",
  4471. "password": "",
  4472. "host": "%C3%B1.test",
  4473. "hostname": "%C3%B1.test",
  4474. "port": "",
  4475. "pathname": "/",
  4476. "search": "",
  4477. "hash": ""
  4478. },
  4479. {
  4480. "input": "sc://\u001F!\"$&'()*+,-.;<=>^_`{|}~/",
  4481. "base": "about:blank",
  4482. "href": "sc://%1F!\"$&'()*+,-.;<=>^_`{|}~/",
  4483. "origin": "null",
  4484. "protocol": "sc:",
  4485. "username": "",
  4486. "password": "",
  4487. "host": "%1F!\"$&'()*+,-.;<=>^_`{|}~",
  4488. "hostname": "%1F!\"$&'()*+,-.;<=>^_`{|}~",
  4489. "port": "",
  4490. "pathname": "/",
  4491. "search": "",
  4492. "hash": ""
  4493. },
  4494. {
  4495. "input": "sc://\u0000/",
  4496. "base": "about:blank",
  4497. "failure": true
  4498. },
  4499. {
  4500. "input": "sc:// /",
  4501. "base": "about:blank",
  4502. "failure": true
  4503. },
  4504. {
  4505. "input": "sc://%/",
  4506. "base": "about:blank",
  4507. "href": "sc://%/",
  4508. "protocol": "sc:",
  4509. "username": "",
  4510. "password": "",
  4511. "host": "%",
  4512. "hostname": "%",
  4513. "port": "",
  4514. "pathname": "/",
  4515. "search": "",
  4516. "hash": ""
  4517. },
  4518. {
  4519. "input": "sc://[/",
  4520. "base": "about:blank",
  4521. "failure": true
  4522. },
  4523. {
  4524. "input": "sc://\\/",
  4525. "base": "about:blank",
  4526. "failure": true
  4527. },
  4528. {
  4529. "input": "sc://]/",
  4530. "base": "about:blank",
  4531. "failure": true
  4532. },
  4533. "NS_NewURI for given input and base fails",
  4534. {
  4535. "input": "x",
  4536. "base": "sc://ñ",
  4537. "href": "sc://%C3%B1/x",
  4538. "origin": "null",
  4539. "protocol": "sc:",
  4540. "username": "",
  4541. "password": "",
  4542. "host": "%C3%B1",
  4543. "hostname": "%C3%B1",
  4544. "port": "",
  4545. "pathname": "/x",
  4546. "search": "",
  4547. "hash": "",
  4548. "skip": true
  4549. },
  4550. "# unknown schemes and backslashes",
  4551. {
  4552. "input": "sc:\\../",
  4553. "base": "about:blank",
  4554. "href": "sc:\\../",
  4555. "origin": "null",
  4556. "protocol": "sc:",
  4557. "username": "",
  4558. "password": "",
  4559. "host": "",
  4560. "hostname": "",
  4561. "port": "",
  4562. "pathname": "\\../",
  4563. "search": "",
  4564. "hash": ""
  4565. },
  4566. "# unknown scheme with path looking like a password",
  4567. {
  4568. "input": "sc::a@example.net",
  4569. "base": "about:blank",
  4570. "href": "sc::a@example.net",
  4571. "origin": "null",
  4572. "protocol": "sc:",
  4573. "username": "",
  4574. "password": "",
  4575. "host": "",
  4576. "hostname": "",
  4577. "port": "",
  4578. "pathname": ":a@example.net",
  4579. "search": "",
  4580. "hash": ""
  4581. },
  4582. "# unknown scheme with bogus percent-encoding",
  4583. {
  4584. "input": "wow:%NBD",
  4585. "base": "about:blank",
  4586. "href": "wow:%NBD",
  4587. "origin": "null",
  4588. "protocol": "wow:",
  4589. "username": "",
  4590. "password": "",
  4591. "host": "",
  4592. "hostname": "",
  4593. "port": "",
  4594. "pathname": "%NBD",
  4595. "search": "",
  4596. "hash": ""
  4597. },
  4598. {
  4599. "input": "wow:%1G",
  4600. "base": "about:blank",
  4601. "href": "wow:%1G",
  4602. "origin": "null",
  4603. "protocol": "wow:",
  4604. "username": "",
  4605. "password": "",
  4606. "host": "",
  4607. "hostname": "",
  4608. "port": "",
  4609. "pathname": "%1G",
  4610. "search": "",
  4611. "hash": ""
  4612. },
  4613. "# Hosts and percent-encoding",
  4614. {
  4615. "input": "ftp://example.com%80/",
  4616. "base": "about:blank",
  4617. "failure": true
  4618. },
  4619. {
  4620. "input": "ftp://example.com%A0/",
  4621. "base": "about:blank",
  4622. "failure": true
  4623. },
  4624. {
  4625. "input": "https://example.com%80/",
  4626. "base": "about:blank",
  4627. "failure": true
  4628. },
  4629. {
  4630. "input": "https://example.com%A0/",
  4631. "base": "about:blank",
  4632. "failure": true
  4633. },
  4634. {
  4635. "input": "ftp://%e2%98%83",
  4636. "base": "about:blank",
  4637. "href": "ftp://xn--n3h/",
  4638. "origin": "ftp://xn--n3h",
  4639. "protocol": "ftp:",
  4640. "username": "",
  4641. "password": "",
  4642. "host": "xn--n3h",
  4643. "hostname": "xn--n3h",
  4644. "port": "",
  4645. "pathname": "/",
  4646. "search": "",
  4647. "hash": ""
  4648. },
  4649. {
  4650. "input": "https://%e2%98%83",
  4651. "base": "about:blank",
  4652. "href": "https://xn--n3h/",
  4653. "origin": "https://xn--n3h",
  4654. "protocol": "https:",
  4655. "username": "",
  4656. "password": "",
  4657. "host": "xn--n3h",
  4658. "hostname": "xn--n3h",
  4659. "port": "",
  4660. "pathname": "/",
  4661. "search": "",
  4662. "hash": ""
  4663. },
  4664. "# tests from jsdom/whatwg-url designed for code coverage",
  4665. {
  4666. "input": "http://127.0.0.1:10100/relative_import.html",
  4667. "base": "about:blank",
  4668. "href": "http://127.0.0.1:10100/relative_import.html",
  4669. "origin": "http://127.0.0.1:10100",
  4670. "protocol": "http:",
  4671. "username": "",
  4672. "password": "",
  4673. "host": "127.0.0.1:10100",
  4674. "hostname": "127.0.0.1",
  4675. "port": "10100",
  4676. "pathname": "/relative_import.html",
  4677. "search": "",
  4678. "hash": ""
  4679. },
  4680. {
  4681. "input": "http://facebook.com/?foo=%7B%22abc%22",
  4682. "base": "about:blank",
  4683. "href": "http://facebook.com/?foo=%7B%22abc%22",
  4684. "origin": "http://facebook.com",
  4685. "protocol": "http:",
  4686. "username": "",
  4687. "password": "",
  4688. "host": "facebook.com",
  4689. "hostname": "facebook.com",
  4690. "port": "",
  4691. "pathname": "/",
  4692. "search": "?foo=%7B%22abc%22",
  4693. "hash": ""
  4694. },
  4695. {
  4696. "input": "https://localhost:3000/jqueryui@1.2.3",
  4697. "base": "about:blank",
  4698. "href": "https://localhost:3000/jqueryui@1.2.3",
  4699. "origin": "https://localhost:3000",
  4700. "protocol": "https:",
  4701. "username": "",
  4702. "password": "",
  4703. "host": "localhost:3000",
  4704. "hostname": "localhost",
  4705. "port": "3000",
  4706. "pathname": "/jqueryui@1.2.3",
  4707. "search": "",
  4708. "hash": ""
  4709. },
  4710. "# tab/LF/CR",
  4711. {
  4712. "input": "h\tt\nt\rp://h\to\ns\rt:9\t0\n0\r0/p\ta\nt\rh?q\tu\ne\rry#f\tr\na\rg",
  4713. "base": "about:blank",
  4714. "href": "http://host:9000/path?query#frag",
  4715. "origin": "http://host:9000",
  4716. "protocol": "http:",
  4717. "username": "",
  4718. "password": "",
  4719. "host": "host:9000",
  4720. "hostname": "host",
  4721. "port": "9000",
  4722. "pathname": "/path",
  4723. "search": "?query",
  4724. "hash": "#frag"
  4725. },
  4726. "# Stringification of URL.searchParams",
  4727. {
  4728. "input": "?a=b&c=d",
  4729. "base": "http://example.org/foo/bar",
  4730. "href": "http://example.org/foo/bar?a=b&c=d",
  4731. "origin": "http://example.org",
  4732. "protocol": "http:",
  4733. "username": "",
  4734. "password": "",
  4735. "host": "example.org",
  4736. "hostname": "example.org",
  4737. "port": "",
  4738. "pathname": "/foo/bar",
  4739. "search": "?a=b&c=d",
  4740. "searchParams": "a=b&c=d",
  4741. "hash": ""
  4742. },
  4743. {
  4744. "input": "??a=b&c=d",
  4745. "base": "http://example.org/foo/bar",
  4746. "href": "http://example.org/foo/bar??a=b&c=d",
  4747. "origin": "http://example.org",
  4748. "protocol": "http:",
  4749. "username": "",
  4750. "password": "",
  4751. "host": "example.org",
  4752. "hostname": "example.org",
  4753. "port": "",
  4754. "pathname": "/foo/bar",
  4755. "search": "??a=b&c=d",
  4756. "searchParams": "%3Fa=b&c=d",
  4757. "hash": ""
  4758. },
  4759. "# Scheme only",
  4760. {
  4761. "input": "http:",
  4762. "base": "http://example.org/foo/bar",
  4763. "href": "http://example.org/foo/bar",
  4764. "origin": "http://example.org",
  4765. "protocol": "http:",
  4766. "username": "",
  4767. "password": "",
  4768. "host": "example.org",
  4769. "hostname": "example.org",
  4770. "port": "",
  4771. "pathname": "/foo/bar",
  4772. "search": "",
  4773. "searchParams": "",
  4774. "hash": ""
  4775. },
  4776. {
  4777. "input": "http:",
  4778. "base": "https://example.org/foo/bar",
  4779. "failure": true
  4780. },
  4781. {
  4782. "input": "sc:",
  4783. "base": "https://example.org/foo/bar",
  4784. "href": "sc:",
  4785. "origin": "null",
  4786. "protocol": "sc:",
  4787. "username": "",
  4788. "password": "",
  4789. "host": "",
  4790. "hostname": "",
  4791. "port": "",
  4792. "pathname": "",
  4793. "search": "",
  4794. "searchParams": "",
  4795. "hash": ""
  4796. },
  4797. "# Percent encoding of fragments",
  4798. {
  4799. "input": "http://foo.bar/baz?qux#foo\bbar",
  4800. "base": "about:blank",
  4801. "href": "http://foo.bar/baz?qux#foo%08bar",
  4802. "origin": "http://foo.bar",
  4803. "protocol": "http:",
  4804. "username": "",
  4805. "password": "",
  4806. "host": "foo.bar",
  4807. "hostname": "foo.bar",
  4808. "port": "",
  4809. "pathname": "/baz",
  4810. "search": "?qux",
  4811. "searchParams": "qux=",
  4812. "hash": "#foo%08bar"
  4813. },
  4814. "# IPv4 parsing (via https://github.com/nodejs/node/pull/10317)",
  4815. {
  4816. "input": "http://192.168.257",
  4817. "base": "http://other.com/",
  4818. "href": "http://192.168.1.1/",
  4819. "origin": "http://192.168.1.1",
  4820. "protocol": "http:",
  4821. "username": "",
  4822. "password": "",
  4823. "host": "192.168.1.1",
  4824. "hostname": "192.168.1.1",
  4825. "port": "",
  4826. "pathname": "/",
  4827. "search": "",
  4828. "hash": ""
  4829. },
  4830. {
  4831. "input": "http://192.168.257.com",
  4832. "base": "http://other.com/",
  4833. "href": "http://192.168.257.com/",
  4834. "origin": "http://192.168.257.com",
  4835. "protocol": "http:",
  4836. "username": "",
  4837. "password": "",
  4838. "host": "192.168.257.com",
  4839. "hostname": "192.168.257.com",
  4840. "port": "",
  4841. "pathname": "/",
  4842. "search": "",
  4843. "hash": ""
  4844. },
  4845. {
  4846. "input": "http://256",
  4847. "base": "http://other.com/",
  4848. "href": "http://0.0.1.0/",
  4849. "origin": "http://0.0.1.0",
  4850. "protocol": "http:",
  4851. "username": "",
  4852. "password": "",
  4853. "host": "0.0.1.0",
  4854. "hostname": "0.0.1.0",
  4855. "port": "",
  4856. "pathname": "/",
  4857. "search": "",
  4858. "hash": ""
  4859. },
  4860. {
  4861. "input": "http://256.com",
  4862. "base": "http://other.com/",
  4863. "href": "http://256.com/",
  4864. "origin": "http://256.com",
  4865. "protocol": "http:",
  4866. "username": "",
  4867. "password": "",
  4868. "host": "256.com",
  4869. "hostname": "256.com",
  4870. "port": "",
  4871. "pathname": "/",
  4872. "search": "",
  4873. "hash": ""
  4874. },
  4875. {
  4876. "input": "http://999999999",
  4877. "base": "http://other.com/",
  4878. "href": "http://59.154.201.255/",
  4879. "origin": "http://59.154.201.255",
  4880. "protocol": "http:",
  4881. "username": "",
  4882. "password": "",
  4883. "host": "59.154.201.255",
  4884. "hostname": "59.154.201.255",
  4885. "port": "",
  4886. "pathname": "/",
  4887. "search": "",
  4888. "hash": ""
  4889. },
  4890. {
  4891. "input": "http://999999999.com",
  4892. "base": "http://other.com/",
  4893. "href": "http://999999999.com/",
  4894. "origin": "http://999999999.com",
  4895. "protocol": "http:",
  4896. "username": "",
  4897. "password": "",
  4898. "host": "999999999.com",
  4899. "hostname": "999999999.com",
  4900. "port": "",
  4901. "pathname": "/",
  4902. "search": "",
  4903. "hash": ""
  4904. },
  4905. {
  4906. "input": "http://10000000000",
  4907. "base": "http://other.com/",
  4908. "failure": true
  4909. },
  4910. {
  4911. "input": "http://10000000000.com",
  4912. "base": "http://other.com/",
  4913. "href": "http://10000000000.com/",
  4914. "origin": "http://10000000000.com",
  4915. "protocol": "http:",
  4916. "username": "",
  4917. "password": "",
  4918. "host": "10000000000.com",
  4919. "hostname": "10000000000.com",
  4920. "port": "",
  4921. "pathname": "/",
  4922. "search": "",
  4923. "hash": ""
  4924. },
  4925. {
  4926. "input": "http://4294967295",
  4927. "base": "http://other.com/",
  4928. "href": "http://255.255.255.255/",
  4929. "origin": "http://255.255.255.255",
  4930. "protocol": "http:",
  4931. "username": "",
  4932. "password": "",
  4933. "host": "255.255.255.255",
  4934. "hostname": "255.255.255.255",
  4935. "port": "",
  4936. "pathname": "/",
  4937. "search": "",
  4938. "hash": ""
  4939. },
  4940. {
  4941. "input": "http://4294967296",
  4942. "base": "http://other.com/",
  4943. "failure": true
  4944. },
  4945. {
  4946. "input": "http://0xffffffff",
  4947. "base": "http://other.com/",
  4948. "href": "http://255.255.255.255/",
  4949. "origin": "http://255.255.255.255",
  4950. "protocol": "http:",
  4951. "username": "",
  4952. "password": "",
  4953. "host": "255.255.255.255",
  4954. "hostname": "255.255.255.255",
  4955. "port": "",
  4956. "pathname": "/",
  4957. "search": "",
  4958. "hash": ""
  4959. },
  4960. {
  4961. "input": "http://0xffffffff1",
  4962. "base": "http://other.com/",
  4963. "failure": true
  4964. },
  4965. {
  4966. "input": "http://256.256.256.256",
  4967. "base": "http://other.com/",
  4968. "failure": true
  4969. },
  4970. {
  4971. "input": "http://256.256.256.256.256",
  4972. "base": "http://other.com/",
  4973. "href": "http://256.256.256.256.256/",
  4974. "origin": "http://256.256.256.256.256",
  4975. "protocol": "http:",
  4976. "username": "",
  4977. "password": "",
  4978. "host": "256.256.256.256.256",
  4979. "hostname": "256.256.256.256.256",
  4980. "port": "",
  4981. "pathname": "/",
  4982. "search": "",
  4983. "hash": ""
  4984. },
  4985. "Origin computed by MozURL is wrong",
  4986. {
  4987. "input": "https://0x.0x.0",
  4988. "base": "about:blank",
  4989. "href": "https://0.0.0.0/",
  4990. "origin": "https://0x.0x.0",
  4991. "protocol": "https:",
  4992. "username": "",
  4993. "password": "",
  4994. "host": "0.0.0.0",
  4995. "hostname": "0.0.0.0",
  4996. "port": "",
  4997. "pathname": "/",
  4998. "search": "",
  4999. "hash": "",
  5000. "skip": true
  5001. },
  5002. "More IPv4 parsing (via https://github.com/jsdom/whatwg-url/issues/92)",
  5003. {
  5004. "input": "https://256.0.0.1/test",
  5005. "base": "about:blank",
  5006. "failure": true
  5007. },
  5008. "# file URLs containing percent-encoded Windows drive letters (shouldn't work)",
  5009. {
  5010. "input": "file:///C%3A/",
  5011. "base": "about:blank",
  5012. "href": "file:///C%3A/",
  5013. "protocol": "file:",
  5014. "username": "",
  5015. "password": "",
  5016. "host": "",
  5017. "hostname": "",
  5018. "port": "",
  5019. "pathname": "/C%3A/",
  5020. "search": "",
  5021. "hash": ""
  5022. },
  5023. {
  5024. "input": "file:///C%7C/",
  5025. "base": "about:blank",
  5026. "href": "file:///C%7C/",
  5027. "protocol": "file:",
  5028. "username": "",
  5029. "password": "",
  5030. "host": "",
  5031. "hostname": "",
  5032. "port": "",
  5033. "pathname": "/C%7C/",
  5034. "search": "",
  5035. "hash": ""
  5036. },
  5037. "# file URLs relative to other file URLs (via https://github.com/jsdom/whatwg-url/pull/60)",
  5038. {
  5039. "input": "pix/submit.gif",
  5040. "base": "file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/anchor.html",
  5041. "href": "file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif",
  5042. "protocol": "file:",
  5043. "username": "",
  5044. "password": "",
  5045. "host": "",
  5046. "hostname": "",
  5047. "port": "",
  5048. "pathname": "/C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif",
  5049. "search": "",
  5050. "hash": ""
  5051. },
  5052. {
  5053. "input": "..",
  5054. "base": "file:///C:/",
  5055. "href": "file:///C:/",
  5056. "protocol": "file:",
  5057. "username": "",
  5058. "password": "",
  5059. "host": "",
  5060. "hostname": "",
  5061. "port": "",
  5062. "pathname": "/C:/",
  5063. "search": "",
  5064. "hash": ""
  5065. },
  5066. {
  5067. "input": "..",
  5068. "base": "file:///",
  5069. "href": "file:///",
  5070. "protocol": "file:",
  5071. "username": "",
  5072. "password": "",
  5073. "host": "",
  5074. "hostname": "",
  5075. "port": "",
  5076. "pathname": "/",
  5077. "search": "",
  5078. "hash": ""
  5079. },
  5080. "# More file URL tests by zcorpan and annevk",
  5081. {
  5082. "input": "/",
  5083. "base": "file:///C:/a/b",
  5084. "href": "file:///C:/",
  5085. "protocol": "file:",
  5086. "username": "",
  5087. "password": "",
  5088. "host": "",
  5089. "hostname": "",
  5090. "port": "",
  5091. "pathname": "/C:/",
  5092. "search": "",
  5093. "hash": ""
  5094. },
  5095. {
  5096. "input": "//d:",
  5097. "base": "file:///C:/a/b",
  5098. "href": "file:///d:",
  5099. "protocol": "file:",
  5100. "username": "",
  5101. "password": "",
  5102. "host": "",
  5103. "hostname": "",
  5104. "port": "",
  5105. "pathname": "/d:",
  5106. "search": "",
  5107. "hash": ""
  5108. },
  5109. {
  5110. "input": "//d:/..",
  5111. "base": "file:///C:/a/b",
  5112. "href": "file:///d:/",
  5113. "protocol": "file:",
  5114. "username": "",
  5115. "password": "",
  5116. "host": "",
  5117. "hostname": "",
  5118. "port": "",
  5119. "pathname": "/d:/",
  5120. "search": "",
  5121. "hash": ""
  5122. },
  5123. {
  5124. "input": "..",
  5125. "base": "file:///ab:/",
  5126. "href": "file:///",
  5127. "protocol": "file:",
  5128. "username": "",
  5129. "password": "",
  5130. "host": "",
  5131. "hostname": "",
  5132. "port": "",
  5133. "pathname": "/",
  5134. "search": "",
  5135. "hash": ""
  5136. },
  5137. {
  5138. "input": "..",
  5139. "base": "file:///1:/",
  5140. "href": "file:///",
  5141. "protocol": "file:",
  5142. "username": "",
  5143. "password": "",
  5144. "host": "",
  5145. "hostname": "",
  5146. "port": "",
  5147. "pathname": "/",
  5148. "search": "",
  5149. "hash": ""
  5150. },
  5151. {
  5152. "input": "",
  5153. "base": "file:///test?test#test",
  5154. "href": "file:///test?test",
  5155. "protocol": "file:",
  5156. "username": "",
  5157. "password": "",
  5158. "host": "",
  5159. "hostname": "",
  5160. "port": "",
  5161. "pathname": "/test",
  5162. "search": "?test",
  5163. "hash": ""
  5164. },
  5165. {
  5166. "input": "file:",
  5167. "base": "file:///test?test#test",
  5168. "href": "file:///test?test",
  5169. "protocol": "file:",
  5170. "username": "",
  5171. "password": "",
  5172. "host": "",
  5173. "hostname": "",
  5174. "port": "",
  5175. "pathname": "/test",
  5176. "search": "?test",
  5177. "hash": ""
  5178. },
  5179. {
  5180. "input": "?x",
  5181. "base": "file:///test?test#test",
  5182. "href": "file:///test?x",
  5183. "protocol": "file:",
  5184. "username": "",
  5185. "password": "",
  5186. "host": "",
  5187. "hostname": "",
  5188. "port": "",
  5189. "pathname": "/test",
  5190. "search": "?x",
  5191. "hash": ""
  5192. },
  5193. {
  5194. "input": "file:?x",
  5195. "base": "file:///test?test#test",
  5196. "href": "file:///test?x",
  5197. "protocol": "file:",
  5198. "username": "",
  5199. "password": "",
  5200. "host": "",
  5201. "hostname": "",
  5202. "port": "",
  5203. "pathname": "/test",
  5204. "search": "?x",
  5205. "hash": ""
  5206. },
  5207. {
  5208. "input": "#x",
  5209. "base": "file:///test?test#test",
  5210. "href": "file:///test?test#x",
  5211. "protocol": "file:",
  5212. "username": "",
  5213. "password": "",
  5214. "host": "",
  5215. "hostname": "",
  5216. "port": "",
  5217. "pathname": "/test",
  5218. "search": "?test",
  5219. "hash": "#x"
  5220. },
  5221. {
  5222. "input": "file:#x",
  5223. "base": "file:///test?test#test",
  5224. "href": "file:///test?test#x",
  5225. "protocol": "file:",
  5226. "username": "",
  5227. "password": "",
  5228. "host": "",
  5229. "hostname": "",
  5230. "port": "",
  5231. "pathname": "/test",
  5232. "search": "?test",
  5233. "hash": "#x"
  5234. },
  5235. "# File URLs and many (back)slashes",
  5236. {
  5237. "input": "file:///localhost//cat",
  5238. "base": "about:blank",
  5239. "href": "file:///localhost//cat",
  5240. "protocol": "file:",
  5241. "username": "",
  5242. "password": "",
  5243. "host": "",
  5244. "hostname": "",
  5245. "port": "",
  5246. "pathname": "/localhost//cat",
  5247. "search": "",
  5248. "hash": ""
  5249. },
  5250. {
  5251. "input": "\\//pig",
  5252. "base": "file://lion/",
  5253. "href": "file:///pig",
  5254. "protocol": "file:",
  5255. "username": "",
  5256. "password": "",
  5257. "host": "",
  5258. "hostname": "",
  5259. "port": "",
  5260. "pathname": "/pig",
  5261. "search": "",
  5262. "hash": ""
  5263. },
  5264. {
  5265. "input": "file://",
  5266. "base": "file://ape/",
  5267. "href": "file:///",
  5268. "protocol": "file:",
  5269. "username": "",
  5270. "password": "",
  5271. "host": "",
  5272. "hostname": "",
  5273. "port": "",
  5274. "pathname": "/",
  5275. "search": "",
  5276. "hash": ""
  5277. },
  5278. "# Windows drive letter handling with the 'file:' base URL",
  5279. {
  5280. "input": "C|#",
  5281. "base": "file://host/dir/file",
  5282. "href": "file:///C:#",
  5283. "protocol": "file:",
  5284. "username": "",
  5285. "password": "",
  5286. "host": "",
  5287. "hostname": "",
  5288. "port": "",
  5289. "pathname": "/C:",
  5290. "search": "",
  5291. "hash": ""
  5292. },
  5293. {
  5294. "input": "C|?",
  5295. "base": "file://host/dir/file",
  5296. "href": "file:///C:?",
  5297. "protocol": "file:",
  5298. "username": "",
  5299. "password": "",
  5300. "host": "",
  5301. "hostname": "",
  5302. "port": "",
  5303. "pathname": "/C:",
  5304. "search": "",
  5305. "hash": ""
  5306. },
  5307. {
  5308. "input": "C|/",
  5309. "base": "file://host/dir/file",
  5310. "href": "file:///C:/",
  5311. "protocol": "file:",
  5312. "username": "",
  5313. "password": "",
  5314. "host": "",
  5315. "hostname": "",
  5316. "port": "",
  5317. "pathname": "/C:/",
  5318. "search": "",
  5319. "hash": ""
  5320. },
  5321. {
  5322. "input": "C|\n/",
  5323. "base": "file://host/dir/file",
  5324. "href": "file:///C:/",
  5325. "protocol": "file:",
  5326. "username": "",
  5327. "password": "",
  5328. "host": "",
  5329. "hostname": "",
  5330. "port": "",
  5331. "pathname": "/C:/",
  5332. "search": "",
  5333. "hash": ""
  5334. },
  5335. {
  5336. "input": "C|\\",
  5337. "base": "file://host/dir/file",
  5338. "href": "file:///C:/",
  5339. "protocol": "file:",
  5340. "username": "",
  5341. "password": "",
  5342. "host": "",
  5343. "hostname": "",
  5344. "port": "",
  5345. "pathname": "/C:/",
  5346. "search": "",
  5347. "hash": ""
  5348. },
  5349. {
  5350. "input": "C",
  5351. "base": "file://host/dir/file",
  5352. "href": "file://host/dir/C",
  5353. "protocol": "file:",
  5354. "username": "",
  5355. "password": "",
  5356. "host": "host",
  5357. "hostname": "host",
  5358. "port": "",
  5359. "pathname": "/dir/C",
  5360. "search": "",
  5361. "hash": ""
  5362. },
  5363. {
  5364. "input": "C|a",
  5365. "base": "file://host/dir/file",
  5366. "href": "file://host/dir/C|a",
  5367. "protocol": "file:",
  5368. "username": "",
  5369. "password": "",
  5370. "host": "host",
  5371. "hostname": "host",
  5372. "port": "",
  5373. "pathname": "/dir/C|a",
  5374. "search": "",
  5375. "hash": ""
  5376. },
  5377. "# Windows drive letter quirk in the file slash state",
  5378. {
  5379. "input": "/c:/foo/bar",
  5380. "base": "file://host/path",
  5381. "href": "file:///c:/foo/bar",
  5382. "protocol": "file:",
  5383. "username": "",
  5384. "password": "",
  5385. "host": "",
  5386. "hostname": "",
  5387. "port": "",
  5388. "pathname": "/c:/foo/bar",
  5389. "search": "",
  5390. "hash": ""
  5391. },
  5392. "# Windows drive letter quirk (no host)",
  5393. {
  5394. "input": "file:/C|/",
  5395. "base": "about:blank",
  5396. "href": "file:///C:/",
  5397. "protocol": "file:",
  5398. "username": "",
  5399. "password": "",
  5400. "host": "",
  5401. "hostname": "",
  5402. "port": "",
  5403. "pathname": "/C:/",
  5404. "search": "",
  5405. "hash": ""
  5406. },
  5407. {
  5408. "input": "file://C|/",
  5409. "base": "about:blank",
  5410. "href": "file:///C:/",
  5411. "protocol": "file:",
  5412. "username": "",
  5413. "password": "",
  5414. "host": "",
  5415. "hostname": "",
  5416. "port": "",
  5417. "pathname": "/C:/",
  5418. "search": "",
  5419. "hash": ""
  5420. },
  5421. "# Windows drive letter quirk with not empty host",
  5422. {
  5423. "input": "file://example.net/C:/",
  5424. "base": "about:blank",
  5425. "href": "file:///C:/",
  5426. "protocol": "file:",
  5427. "username": "",
  5428. "password": "",
  5429. "host": "",
  5430. "hostname": "",
  5431. "port": "",
  5432. "pathname": "/C:/",
  5433. "search": "",
  5434. "hash": ""
  5435. },
  5436. {
  5437. "input": "file://1.2.3.4/C:/",
  5438. "base": "about:blank",
  5439. "href": "file:///C:/",
  5440. "protocol": "file:",
  5441. "username": "",
  5442. "password": "",
  5443. "host": "",
  5444. "hostname": "",
  5445. "port": "",
  5446. "pathname": "/C:/",
  5447. "search": "",
  5448. "hash": ""
  5449. },
  5450. {
  5451. "input": "file://[1::8]/C:/",
  5452. "base": "about:blank",
  5453. "href": "file:///C:/",
  5454. "protocol": "file:",
  5455. "username": "",
  5456. "password": "",
  5457. "host": "",
  5458. "hostname": "",
  5459. "port": "",
  5460. "pathname": "/C:/",
  5461. "search": "",
  5462. "hash": ""
  5463. },
  5464. "# file URLs without base URL by Rimas Misevičius",
  5465. {
  5466. "input": "file:",
  5467. "base": "about:blank",
  5468. "href": "file:///",
  5469. "protocol": "file:",
  5470. "username": "",
  5471. "password": "",
  5472. "host": "",
  5473. "hostname": "",
  5474. "port": "",
  5475. "pathname": "/",
  5476. "search": "",
  5477. "hash": ""
  5478. },
  5479. {
  5480. "input": "file:?q=v",
  5481. "base": "about:blank",
  5482. "href": "file:///?q=v",
  5483. "protocol": "file:",
  5484. "username": "",
  5485. "password": "",
  5486. "host": "",
  5487. "hostname": "",
  5488. "port": "",
  5489. "pathname": "/",
  5490. "search": "?q=v",
  5491. "hash": ""
  5492. },
  5493. {
  5494. "input": "file:#frag",
  5495. "base": "about:blank",
  5496. "href": "file:///#frag",
  5497. "protocol": "file:",
  5498. "username": "",
  5499. "password": "",
  5500. "host": "",
  5501. "hostname": "",
  5502. "port": "",
  5503. "pathname": "/",
  5504. "search": "",
  5505. "hash": "#frag"
  5506. },
  5507. "# IPv6 tests",
  5508. {
  5509. "input": "http://[1:0::]",
  5510. "base": "http://example.net/",
  5511. "href": "http://[1::]/",
  5512. "origin": "http://[1::]",
  5513. "protocol": "http:",
  5514. "username": "",
  5515. "password": "",
  5516. "host": "[1::]",
  5517. "hostname": "[1::]",
  5518. "port": "",
  5519. "pathname": "/",
  5520. "search": "",
  5521. "hash": ""
  5522. },
  5523. {
  5524. "input": "http://[0:1:2:3:4:5:6:7:8]",
  5525. "base": "http://example.net/",
  5526. "failure": true
  5527. },
  5528. {
  5529. "input": "https://[0::0::0]",
  5530. "base": "about:blank",
  5531. "failure": true
  5532. },
  5533. {
  5534. "input": "https://[0:.0]",
  5535. "base": "about:blank",
  5536. "failure": true
  5537. },
  5538. {
  5539. "input": "https://[0:0:]",
  5540. "base": "about:blank",
  5541. "failure": true
  5542. },
  5543. {
  5544. "input": "https://[0:1:2:3:4:5:6:7.0.0.0.1]",
  5545. "base": "about:blank",
  5546. "failure": true
  5547. },
  5548. {
  5549. "input": "https://[0:1.00.0.0.0]",
  5550. "base": "about:blank",
  5551. "failure": true
  5552. },
  5553. {
  5554. "input": "https://[0:1.290.0.0.0]",
  5555. "base": "about:blank",
  5556. "failure": true
  5557. },
  5558. {
  5559. "input": "https://[0:1.23.23]",
  5560. "base": "about:blank",
  5561. "failure": true
  5562. },
  5563. "# Empty host",
  5564. {
  5565. "input": "http://?",
  5566. "base": "about:blank",
  5567. "failure": true
  5568. },
  5569. {
  5570. "input": "http://#",
  5571. "base": "about:blank",
  5572. "failure": true
  5573. },
  5574. "Port overflow (2^32 + 81)",
  5575. {
  5576. "input": "http://f:4294967377/c",
  5577. "base": "http://example.org/",
  5578. "failure": true
  5579. },
  5580. "Port overflow (2^64 + 81)",
  5581. {
  5582. "input": "http://f:18446744073709551697/c",
  5583. "base": "http://example.org/",
  5584. "failure": true
  5585. },
  5586. "Port overflow (2^128 + 81)",
  5587. {
  5588. "input": "http://f:340282366920938463463374607431768211537/c",
  5589. "base": "http://example.org/",
  5590. "failure": true
  5591. },
  5592. "# Non-special-URL path tests",
  5593. {
  5594. "input": "///",
  5595. "base": "sc://x/",
  5596. "href": "sc:///",
  5597. "protocol": "sc:",
  5598. "username": "",
  5599. "password": "",
  5600. "host": "",
  5601. "hostname": "",
  5602. "port": "",
  5603. "pathname": "/",
  5604. "search": "",
  5605. "hash": ""
  5606. },
  5607. {
  5608. "input": "tftp://foobar.com/someconfig;mode=netascii",
  5609. "base": "about:blank",
  5610. "href": "tftp://foobar.com/someconfig;mode=netascii",
  5611. "origin": "null",
  5612. "protocol": "tftp:",
  5613. "username": "",
  5614. "password": "",
  5615. "host": "foobar.com",
  5616. "hostname": "foobar.com",
  5617. "port": "",
  5618. "pathname": "/someconfig;mode=netascii",
  5619. "search": "",
  5620. "hash": ""
  5621. },
  5622. {
  5623. "input": "telnet://user:pass@foobar.com:23/",
  5624. "base": "about:blank",
  5625. "href": "telnet://user:pass@foobar.com:23/",
  5626. "origin": "null",
  5627. "protocol": "telnet:",
  5628. "username": "user",
  5629. "password": "pass",
  5630. "host": "foobar.com:23",
  5631. "hostname": "foobar.com",
  5632. "port": "23",
  5633. "pathname": "/",
  5634. "search": "",
  5635. "hash": ""
  5636. },
  5637. {
  5638. "input": "ut2004://10.10.10.10:7777/Index.ut2",
  5639. "base": "about:blank",
  5640. "href": "ut2004://10.10.10.10:7777/Index.ut2",
  5641. "origin": "null",
  5642. "protocol": "ut2004:",
  5643. "username": "",
  5644. "password": "",
  5645. "host": "10.10.10.10:7777",
  5646. "hostname": "10.10.10.10",
  5647. "port": "7777",
  5648. "pathname": "/Index.ut2",
  5649. "search": "",
  5650. "hash": ""
  5651. },
  5652. {
  5653. "input": "redis://foo:bar@somehost:6379/0?baz=bam&qux=baz",
  5654. "base": "about:blank",
  5655. "href": "redis://foo:bar@somehost:6379/0?baz=bam&qux=baz",
  5656. "origin": "null",
  5657. "protocol": "redis:",
  5658. "username": "foo",
  5659. "password": "bar",
  5660. "host": "somehost:6379",
  5661. "hostname": "somehost",
  5662. "port": "6379",
  5663. "pathname": "/0",
  5664. "search": "?baz=bam&qux=baz",
  5665. "hash": ""
  5666. },
  5667. {
  5668. "input": "rsync://foo@host:911/sup",
  5669. "base": "about:blank",
  5670. "href": "rsync://foo@host:911/sup",
  5671. "origin": "null",
  5672. "protocol": "rsync:",
  5673. "username": "foo",
  5674. "password": "",
  5675. "host": "host:911",
  5676. "hostname": "host",
  5677. "port": "911",
  5678. "pathname": "/sup",
  5679. "search": "",
  5680. "hash": ""
  5681. },
  5682. {
  5683. "input": "git://github.com/foo/bar.git",
  5684. "base": "about:blank",
  5685. "href": "git://github.com/foo/bar.git",
  5686. "origin": "null",
  5687. "protocol": "git:",
  5688. "username": "",
  5689. "password": "",
  5690. "host": "github.com",
  5691. "hostname": "github.com",
  5692. "port": "",
  5693. "pathname": "/foo/bar.git",
  5694. "search": "",
  5695. "hash": ""
  5696. },
  5697. {
  5698. "input": "irc://myserver.com:6999/channel?passwd",
  5699. "base": "about:blank",
  5700. "href": "irc://myserver.com:6999/channel?passwd",
  5701. "origin": "null",
  5702. "protocol": "irc:",
  5703. "username": "",
  5704. "password": "",
  5705. "host": "myserver.com:6999",
  5706. "hostname": "myserver.com",
  5707. "port": "6999",
  5708. "pathname": "/channel",
  5709. "search": "?passwd",
  5710. "hash": ""
  5711. },
  5712. {
  5713. "input": "dns://fw.example.org:9999/foo.bar.org?type=TXT",
  5714. "base": "about:blank",
  5715. "href": "dns://fw.example.org:9999/foo.bar.org?type=TXT",
  5716. "origin": "null",
  5717. "protocol": "dns:",
  5718. "username": "",
  5719. "password": "",
  5720. "host": "fw.example.org:9999",
  5721. "hostname": "fw.example.org",
  5722. "port": "9999",
  5723. "pathname": "/foo.bar.org",
  5724. "search": "?type=TXT",
  5725. "hash": ""
  5726. },
  5727. {
  5728. "input": "ldap://localhost:389/ou=People,o=JNDITutorial",
  5729. "base": "about:blank",
  5730. "href": "ldap://localhost:389/ou=People,o=JNDITutorial",
  5731. "origin": "null",
  5732. "protocol": "ldap:",
  5733. "username": "",
  5734. "password": "",
  5735. "host": "localhost:389",
  5736. "hostname": "localhost",
  5737. "port": "389",
  5738. "pathname": "/ou=People,o=JNDITutorial",
  5739. "search": "",
  5740. "hash": ""
  5741. },
  5742. {
  5743. "input": "git+https://github.com/foo/bar",
  5744. "base": "about:blank",
  5745. "href": "git+https://github.com/foo/bar",
  5746. "origin": "null",
  5747. "protocol": "git+https:",
  5748. "username": "",
  5749. "password": "",
  5750. "host": "github.com",
  5751. "hostname": "github.com",
  5752. "port": "",
  5753. "pathname": "/foo/bar",
  5754. "search": "",
  5755. "hash": ""
  5756. },
  5757. {
  5758. "input": "urn:ietf:rfc:2648",
  5759. "base": "about:blank",
  5760. "href": "urn:ietf:rfc:2648",
  5761. "origin": "null",
  5762. "protocol": "urn:",
  5763. "username": "",
  5764. "password": "",
  5765. "host": "",
  5766. "hostname": "",
  5767. "port": "",
  5768. "pathname": "ietf:rfc:2648",
  5769. "search": "",
  5770. "hash": ""
  5771. },
  5772. {
  5773. "input": "tag:joe@example.org,2001:foo/bar",
  5774. "base": "about:blank",
  5775. "href": "tag:joe@example.org,2001:foo/bar",
  5776. "origin": "null",
  5777. "protocol": "tag:",
  5778. "username": "",
  5779. "password": "",
  5780. "host": "",
  5781. "hostname": "",
  5782. "port": "",
  5783. "pathname": "joe@example.org,2001:foo/bar",
  5784. "search": "",
  5785. "hash": ""
  5786. },
  5787. "# percent encoded hosts in non-special-URLs",
  5788. {
  5789. "input": "non-special://%E2%80%A0/",
  5790. "base": "about:blank",
  5791. "href": "non-special://%E2%80%A0/",
  5792. "protocol": "non-special:",
  5793. "username": "",
  5794. "password": "",
  5795. "host": "%E2%80%A0",
  5796. "hostname": "%E2%80%A0",
  5797. "port": "",
  5798. "pathname": "/",
  5799. "search": "",
  5800. "hash": ""
  5801. },
  5802. {
  5803. "input": "non-special://H%4fSt/path",
  5804. "base": "about:blank",
  5805. "href": "non-special://H%4fSt/path",
  5806. "protocol": "non-special:",
  5807. "username": "",
  5808. "password": "",
  5809. "host": "H%4fSt",
  5810. "hostname": "H%4fSt",
  5811. "port": "",
  5812. "pathname": "/path",
  5813. "search": "",
  5814. "hash": ""
  5815. },
  5816. "# IPv6 in non-special-URLs",
  5817. {
  5818. "input": "non-special://[1:2:0:0:5:0:0:0]/",
  5819. "base": "about:blank",
  5820. "href": "non-special://[1:2:0:0:5::]/",
  5821. "protocol": "non-special:",
  5822. "username": "",
  5823. "password": "",
  5824. "host": "[1:2:0:0:5::]",
  5825. "hostname": "[1:2:0:0:5::]",
  5826. "port": "",
  5827. "pathname": "/",
  5828. "search": "",
  5829. "hash": ""
  5830. },
  5831. {
  5832. "input": "non-special://[1:2:0:0:0:0:0:3]/",
  5833. "base": "about:blank",
  5834. "href": "non-special://[1:2::3]/",
  5835. "protocol": "non-special:",
  5836. "username": "",
  5837. "password": "",
  5838. "host": "[1:2::3]",
  5839. "hostname": "[1:2::3]",
  5840. "port": "",
  5841. "pathname": "/",
  5842. "search": "",
  5843. "hash": ""
  5844. },
  5845. {
  5846. "input": "non-special://[1:2::3]:80/",
  5847. "base": "about:blank",
  5848. "href": "non-special://[1:2::3]:80/",
  5849. "protocol": "non-special:",
  5850. "username": "",
  5851. "password": "",
  5852. "host": "[1:2::3]:80",
  5853. "hostname": "[1:2::3]",
  5854. "port": "80",
  5855. "pathname": "/",
  5856. "search": "",
  5857. "hash": ""
  5858. },
  5859. {
  5860. "input": "non-special://[:80/",
  5861. "base": "about:blank",
  5862. "failure": true
  5863. },
  5864. {
  5865. "input": "blob:https://example.com:443/",
  5866. "base": "about:blank",
  5867. "href": "blob:https://example.com:443/",
  5868. "protocol": "blob:",
  5869. "username": "",
  5870. "password": "",
  5871. "host": "",
  5872. "hostname": "",
  5873. "port": "",
  5874. "pathname": "https://example.com:443/",
  5875. "search": "",
  5876. "hash": ""
  5877. },
  5878. {
  5879. "input": "blob:d3958f5c-0777-0845-9dcf-2cb28783acaf",
  5880. "base": "about:blank",
  5881. "href": "blob:d3958f5c-0777-0845-9dcf-2cb28783acaf",
  5882. "protocol": "blob:",
  5883. "username": "",
  5884. "password": "",
  5885. "host": "",
  5886. "hostname": "",
  5887. "port": "",
  5888. "pathname": "d3958f5c-0777-0845-9dcf-2cb28783acaf",
  5889. "search": "",
  5890. "hash": ""
  5891. },
  5892. "Invalid IPv4 radix digits",
  5893. {
  5894. "input": "http://0177.0.0.0189",
  5895. "base": "about:blank",
  5896. "href": "http://0177.0.0.0189/",
  5897. "protocol": "http:",
  5898. "username": "",
  5899. "password": "",
  5900. "host": "0177.0.0.0189",
  5901. "hostname": "0177.0.0.0189",
  5902. "port": "",
  5903. "pathname": "/",
  5904. "search": "",
  5905. "hash": ""
  5906. },
  5907. {
  5908. "input": "http://0x7f.0.0.0x7g",
  5909. "base": "about:blank",
  5910. "href": "http://0x7f.0.0.0x7g/",
  5911. "protocol": "http:",
  5912. "username": "",
  5913. "password": "",
  5914. "host": "0x7f.0.0.0x7g",
  5915. "hostname": "0x7f.0.0.0x7g",
  5916. "port": "",
  5917. "pathname": "/",
  5918. "search": "",
  5919. "hash": ""
  5920. },
  5921. {
  5922. "input": "http://0X7F.0.0.0X7G",
  5923. "base": "about:blank",
  5924. "href": "http://0x7f.0.0.0x7g/",
  5925. "protocol": "http:",
  5926. "username": "",
  5927. "password": "",
  5928. "host": "0x7f.0.0.0x7g",
  5929. "hostname": "0x7f.0.0.0x7g",
  5930. "port": "",
  5931. "pathname": "/",
  5932. "search": "",
  5933. "hash": ""
  5934. },
  5935. "Invalid IPv4 portion of IPv6 address",
  5936. {
  5937. "input": "http://[::127.0.0.0.1]",
  5938. "base": "about:blank",
  5939. "failure": true
  5940. },
  5941. "Uncompressed IPv6 addresses with 0",
  5942. {
  5943. "input": "http://[0:1:0:1:0:1:0:1]",
  5944. "base": "about:blank",
  5945. "href": "http://[0:1:0:1:0:1:0:1]/",
  5946. "protocol": "http:",
  5947. "username": "",
  5948. "password": "",
  5949. "host": "[0:1:0:1:0:1:0:1]",
  5950. "hostname": "[0:1:0:1:0:1:0:1]",
  5951. "port": "",
  5952. "pathname": "/",
  5953. "search": "",
  5954. "hash": ""
  5955. },
  5956. {
  5957. "input": "http://[1:0:1:0:1:0:1:0]",
  5958. "base": "about:blank",
  5959. "href": "http://[1:0:1:0:1:0:1:0]/",
  5960. "protocol": "http:",
  5961. "username": "",
  5962. "password": "",
  5963. "host": "[1:0:1:0:1:0:1:0]",
  5964. "hostname": "[1:0:1:0:1:0:1:0]",
  5965. "port": "",
  5966. "pathname": "/",
  5967. "search": "",
  5968. "hash": ""
  5969. },
  5970. "Percent-encoded query and fragment",
  5971. {
  5972. "input": "http://example.org/test?\u0022",
  5973. "base": "about:blank",
  5974. "href": "http://example.org/test?%22",
  5975. "protocol": "http:",
  5976. "username": "",
  5977. "password": "",
  5978. "host": "example.org",
  5979. "hostname": "example.org",
  5980. "port": "",
  5981. "pathname": "/test",
  5982. "search": "?%22",
  5983. "hash": ""
  5984. },
  5985. {
  5986. "input": "http://example.org/test?\u0023",
  5987. "base": "about:blank",
  5988. "href": "http://example.org/test?#",
  5989. "protocol": "http:",
  5990. "username": "",
  5991. "password": "",
  5992. "host": "example.org",
  5993. "hostname": "example.org",
  5994. "port": "",
  5995. "pathname": "/test",
  5996. "search": "",
  5997. "hash": ""
  5998. },
  5999. {
  6000. "input": "http://example.org/test?\u003C",
  6001. "base": "about:blank",
  6002. "href": "http://example.org/test?%3C",
  6003. "protocol": "http:",
  6004. "username": "",
  6005. "password": "",
  6006. "host": "example.org",
  6007. "hostname": "example.org",
  6008. "port": "",
  6009. "pathname": "/test",
  6010. "search": "?%3C",
  6011. "hash": ""
  6012. },
  6013. {
  6014. "input": "http://example.org/test?\u003E",
  6015. "base": "about:blank",
  6016. "href": "http://example.org/test?%3E",
  6017. "protocol": "http:",
  6018. "username": "",
  6019. "password": "",
  6020. "host": "example.org",
  6021. "hostname": "example.org",
  6022. "port": "",
  6023. "pathname": "/test",
  6024. "search": "?%3E",
  6025. "hash": ""
  6026. },
  6027. {
  6028. "input": "http://example.org/test?\u2323",
  6029. "base": "about:blank",
  6030. "href": "http://example.org/test?%E2%8C%A3",
  6031. "protocol": "http:",
  6032. "username": "",
  6033. "password": "",
  6034. "host": "example.org",
  6035. "hostname": "example.org",
  6036. "port": "",
  6037. "pathname": "/test",
  6038. "search": "?%E2%8C%A3",
  6039. "hash": ""
  6040. },
  6041. {
  6042. "input": "http://example.org/test?%23%23",
  6043. "base": "about:blank",
  6044. "href": "http://example.org/test?%23%23",
  6045. "protocol": "http:",
  6046. "username": "",
  6047. "password": "",
  6048. "host": "example.org",
  6049. "hostname": "example.org",
  6050. "port": "",
  6051. "pathname": "/test",
  6052. "search": "?%23%23",
  6053. "hash": ""
  6054. },
  6055. {
  6056. "input": "http://example.org/test?%GH",
  6057. "base": "about:blank",
  6058. "href": "http://example.org/test?%GH",
  6059. "protocol": "http:",
  6060. "username": "",
  6061. "password": "",
  6062. "host": "example.org",
  6063. "hostname": "example.org",
  6064. "port": "",
  6065. "pathname": "/test",
  6066. "search": "?%GH",
  6067. "hash": ""
  6068. },
  6069. {
  6070. "input": "http://example.org/test?a#%EF",
  6071. "base": "about:blank",
  6072. "href": "http://example.org/test?a#%EF",
  6073. "protocol": "http:",
  6074. "username": "",
  6075. "password": "",
  6076. "host": "example.org",
  6077. "hostname": "example.org",
  6078. "port": "",
  6079. "pathname": "/test",
  6080. "search": "?a",
  6081. "hash": "#%EF"
  6082. },
  6083. {
  6084. "input": "http://example.org/test?a#%GH",
  6085. "base": "about:blank",
  6086. "href": "http://example.org/test?a#%GH",
  6087. "protocol": "http:",
  6088. "username": "",
  6089. "password": "",
  6090. "host": "example.org",
  6091. "hostname": "example.org",
  6092. "port": "",
  6093. "pathname": "/test",
  6094. "search": "?a",
  6095. "hash": "#%GH"
  6096. },
  6097. "Bad bases",
  6098. {
  6099. "input": "test-a.html",
  6100. "base": "a",
  6101. "failure": true
  6102. },
  6103. {
  6104. "input": "test-a-slash.html",
  6105. "base": "a/",
  6106. "failure": true
  6107. },
  6108. {
  6109. "input": "test-a-slash-slash.html",
  6110. "base": "a//",
  6111. "failure": true
  6112. },
  6113. {
  6114. "input": "test-a-colon.html",
  6115. "base": "a:",
  6116. "failure": true
  6117. },
  6118. {
  6119. "input": "test-a-colon-slash.html",
  6120. "base": "a:/",
  6121. "href": "a:/test-a-colon-slash.html",
  6122. "protocol": "a:",
  6123. "username": "",
  6124. "password": "",
  6125. "host": "",
  6126. "hostname": "",
  6127. "port": "",
  6128. "pathname": "/test-a-colon-slash.html",
  6129. "search": "",
  6130. "hash": ""
  6131. },
  6132. {
  6133. "input": "test-a-colon-slash-slash.html",
  6134. "base": "a://",
  6135. "href": "a:///test-a-colon-slash-slash.html",
  6136. "protocol": "a:",
  6137. "username": "",
  6138. "password": "",
  6139. "host": "",
  6140. "hostname": "",
  6141. "port": "",
  6142. "pathname": "/test-a-colon-slash-slash.html",
  6143. "search": "",
  6144. "hash": ""
  6145. },
  6146. {
  6147. "input": "test-a-colon-b.html",
  6148. "base": "a:b",
  6149. "failure": true
  6150. },
  6151. {
  6152. "input": "test-a-colon-slash-b.html",
  6153. "base": "a:/b",
  6154. "href": "a:/test-a-colon-slash-b.html",
  6155. "protocol": "a:",
  6156. "username": "",
  6157. "password": "",
  6158. "host": "",
  6159. "hostname": "",
  6160. "port": "",
  6161. "pathname": "/test-a-colon-slash-b.html",
  6162. "search": "",
  6163. "hash": ""
  6164. },
  6165. {
  6166. "input": "test-a-colon-slash-slash-b.html",
  6167. "base": "a://b",
  6168. "href": "a://b/test-a-colon-slash-slash-b.html",
  6169. "protocol": "a:",
  6170. "username": "",
  6171. "password": "",
  6172. "host": "b",
  6173. "hostname": "b",
  6174. "port": "",
  6175. "pathname": "/test-a-colon-slash-slash-b.html",
  6176. "search": "",
  6177. "hash": ""
  6178. },
  6179. "Null code point in fragment",
  6180. {
  6181. "input": "http://example.org/test?a#b\u0000c",
  6182. "base": "about:blank",
  6183. "href": "http://example.org/test?a#bc",
  6184. "protocol": "http:",
  6185. "username": "",
  6186. "password": "",
  6187. "host": "example.org",
  6188. "hostname": "example.org",
  6189. "port": "",
  6190. "pathname": "/test",
  6191. "search": "?a",
  6192. "hash": "#bc"
  6193. },
  6194. "New tests",
  6195. {
  6196. "input": "file:///foo/bar.html",
  6197. "base": "about:blank",
  6198. "href": "file:///foo/bar.html",
  6199. "origin": "file:///foo/bar.html",
  6200. "protocol": "file:",
  6201. "username": "",
  6202. "password": "",
  6203. "host": "",
  6204. "hostname": "",
  6205. "port": "",
  6206. "pathname": "/",
  6207. "search": "",
  6208. "hash": ""
  6209. },
  6210. {
  6211. "input": "file:///foo/bar.html?x=y",
  6212. "base": "about:blank",
  6213. "href": "file:///foo/bar.html?x=y",
  6214. "origin": "file:///foo/bar.html",
  6215. "protocol": "file:",
  6216. "username": "",
  6217. "password": "",
  6218. "host": "",
  6219. "hostname": "",
  6220. "port": "",
  6221. "pathname": "/",
  6222. "search": "",
  6223. "hash": ""
  6224. },
  6225. {
  6226. "input": "file:///foo/bar.html#bla",
  6227. "base": "about:blank",
  6228. "href": "file:///foo/bar.html#bla",
  6229. "origin": "file:///foo/bar.html",
  6230. "protocol": "file:",
  6231. "username": "",
  6232. "password": "",
  6233. "host": "",
  6234. "hostname": "",
  6235. "port": "",
  6236. "pathname": "/",
  6237. "search": "",
  6238. "hash": ""
  6239. },
  6240. {
  6241. "input": "about:blank",
  6242. "base": "about:blank",
  6243. "href": "about:blank",
  6244. "origin": "null",
  6245. "protocol": "about:",
  6246. "username": "",
  6247. "password": "",
  6248. "host": "",
  6249. "hostname": "",
  6250. "port": "",
  6251. "pathname": "blank",
  6252. "search": "",
  6253. "hash": ""
  6254. },
  6255. {
  6256. "input": "about:home",
  6257. "base": "about:blank",
  6258. "href": "about:home",
  6259. "origin": "about:home",
  6260. "protocol": "about:",
  6261. "username": "",
  6262. "password": "",
  6263. "host": "",
  6264. "hostname": "",
  6265. "port": "",
  6266. "pathname": "blank",
  6267. "search": "",
  6268. "hash": ""
  6269. },
  6270. {
  6271. "input": "about:home#x",
  6272. "base": "about:blank",
  6273. "href": "about:home#x",
  6274. "origin": "about:home",
  6275. "protocol": "about:",
  6276. "username": "",
  6277. "password": "",
  6278. "host": "",
  6279. "hostname": "",
  6280. "port": "",
  6281. "pathname": "blank",
  6282. "search": "",
  6283. "hash": ""
  6284. },
  6285. {
  6286. "input": "about:home?x=y",
  6287. "base": "about:blank",
  6288. "href": "about:home?x=y",
  6289. "origin": "about:home",
  6290. "protocol": "about:",
  6291. "username": "",
  6292. "password": "",
  6293. "host": "",
  6294. "hostname": "",
  6295. "port": "",
  6296. "pathname": "blank",
  6297. "search": "",
  6298. "hash": ""
  6299. },
  6300. {
  6301. "input": "moz-safe-about:home",
  6302. "base": "about:blank",
  6303. "href": "moz-safe-about:home",
  6304. "origin": "moz-safe-about:home",
  6305. "protocol": "about:",
  6306. "username": "",
  6307. "password": "",
  6308. "host": "",
  6309. "hostname": "",
  6310. "port": "",
  6311. "pathname": "blank",
  6312. "search": "",
  6313. "hash": ""
  6314. },
  6315. {
  6316. "input": "moz-safe-about:home#x",
  6317. "base": "about:blank",
  6318. "href": "moz-safe-about:home#x",
  6319. "origin": "moz-safe-about:home",
  6320. "protocol": "about:",
  6321. "username": "",
  6322. "password": "",
  6323. "host": "",
  6324. "hostname": "",
  6325. "port": "",
  6326. "pathname": "blank",
  6327. "search": "",
  6328. "hash": ""
  6329. },
  6330. {
  6331. "input": "moz-safe-about:home?x=y",
  6332. "base": "about:blank",
  6333. "href": "moz-safe-about:home?x=y",
  6334. "origin": "moz-safe-about:home",
  6335. "protocol": "about:",
  6336. "username": "",
  6337. "password": "",
  6338. "host": "",
  6339. "hostname": "",
  6340. "port": "",
  6341. "pathname": "blank",
  6342. "search": "",
  6343. "hash": ""
  6344. },
  6345. {
  6346. "input": "indexeddb://fx-devtools",
  6347. "base": "about:blank",
  6348. "href": "indexeddb://fx-devtools/",
  6349. "origin": "indexeddb://fx-devtools",
  6350. "protocol": "about:",
  6351. "username": "",
  6352. "password": "",
  6353. "host": "",
  6354. "hostname": "",
  6355. "port": "",
  6356. "pathname": "blank",
  6357. "search": "",
  6358. "hash": ""
  6359. },
  6360. {
  6361. "input": "indexeddb://fx-devtools/",
  6362. "base": "about:blank",
  6363. "href": "indexeddb://fx-devtools/",
  6364. "origin": "indexeddb://fx-devtools",
  6365. "protocol": "about:",
  6366. "username": "",
  6367. "password": "",
  6368. "host": "",
  6369. "hostname": "",
  6370. "port": "",
  6371. "pathname": "blank",
  6372. "search": "",
  6373. "hash": ""
  6374. },
  6375. {
  6376. "input": "indexeddb://fx-devtools/foo",
  6377. "base": "about:blank",
  6378. "href": "indexeddb://fx-devtools/foo",
  6379. "origin": "indexeddb://fx-devtools",
  6380. "protocol": "about:",
  6381. "username": "",
  6382. "password": "",
  6383. "host": "",
  6384. "hostname": "",
  6385. "port": "",
  6386. "pathname": "blank",
  6387. "search": "",
  6388. "hash": ""
  6389. },
  6390. {
  6391. "input": "indexeddb://fx-devtools#x",
  6392. "base": "about:blank",
  6393. "href": "indexeddb://fx-devtools#x",
  6394. "origin": "indexeddb://fx-devtools",
  6395. "protocol": "about:",
  6396. "username": "",
  6397. "password": "",
  6398. "host": "",
  6399. "hostname": "",
  6400. "port": "",
  6401. "pathname": "blank",
  6402. "search": "",
  6403. "hash": ""
  6404. },
  6405. {
  6406. "input": "indexeddb://fx-devtools/#x",
  6407. "base": "about:blank",
  6408. "href": "indexeddb://fx-devtools/#x",
  6409. "origin": "indexeddb://fx-devtools",
  6410. "protocol": "about:",
  6411. "username": "",
  6412. "password": "",
  6413. "host": "",
  6414. "hostname": "",
  6415. "port": "",
  6416. "pathname": "blank",
  6417. "search": "",
  6418. "hash": ""
  6419. },
  6420. {
  6421. "input": "moz-extension://53711a8f-65ed-e742-9671-1f02e267c0bc/foo/bar.html",
  6422. "base": "about:blank",
  6423. "href": "moz-extension://53711a8f-65ed-e742-9671-1f02e267c0bc/foo/bar.html",
  6424. "origin": "moz-extension://53711a8f-65ed-e742-9671-1f02e267c0bc",
  6425. "protocol": "about:",
  6426. "username": "",
  6427. "password": "",
  6428. "host": "",
  6429. "hostname": "",
  6430. "port": "",
  6431. "pathname": "blank",
  6432. "search": "",
  6433. "hash": ""
  6434. },
  6435. {
  6436. "input": "moz-extension://53711a8f-65ed-e742-9671-1f02e267c0bc:123/foo/bar.html",
  6437. "base": "about:blank",
  6438. "href": "moz-extension://53711a8f-65ed-e742-9671-1f02e267c0bc:123/foo/bar.html",
  6439. "origin": "moz-extension://53711a8f-65ed-e742-9671-1f02e267c0bc:123",
  6440. "protocol": "about:",
  6441. "username": "",
  6442. "password": "",
  6443. "host": "",
  6444. "hostname": "",
  6445. "port": "",
  6446. "pathname": "blank",
  6447. "search": "",
  6448. "hash": ""
  6449. },
  6450. {
  6451. "input": "resource://foo/bar.html",
  6452. "base": "about:blank",
  6453. "href": "resource://foo/bar.html",
  6454. "origin": "resource://foo",
  6455. "protocol": "about:",
  6456. "username": "",
  6457. "password": "",
  6458. "host": "",
  6459. "hostname": "",
  6460. "port": "",
  6461. "pathname": "blank",
  6462. "search": "",
  6463. "hash": ""
  6464. },
  6465. {
  6466. "input": "resource://foo:123/bar.html",
  6467. "base": "about:blank",
  6468. "href": "resource://foo:123/bar.html",
  6469. "origin": "resource://foo:123",
  6470. "protocol": "about:",
  6471. "username": "",
  6472. "password": "",
  6473. "host": "",
  6474. "hostname": "",
  6475. "port": "",
  6476. "pathname": "blank",
  6477. "search": "",
  6478. "hash": ""
  6479. }
  6480. ]