PageRenderTime 72ms CodeModel.GetById 34ms RepoModel.GetById 1ms 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

Large files files are truncated, but you can click here to view the full file

  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. "passwor…

Large files files are truncated, but you can click here to view the full file