summaryrefslogtreecommitdiff
path: root/test/parallel/test-whatwg-url-historical.js
blob: 7848b1c1873a705c3cef7e8f353a06e70bc1dab1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
'use strict';
const common = require('../common');
if (!common.hasIntl) {
  // A handful of the tests fail when ICU is not included.
  common.skip('missing Intl');
}

const URL = require('url').URL;
const { test, assert_equals, assert_throws } = require('../common/wpt');

/* eslint-disable */
/* WPT Refs:
   https://github.com/w3c/web-platform-tests/blob/8791bed/url/historical.html
   License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
*/
// var objects = [
//   [function() { return window.location }, "location object"],
//   [function() { return document.createElement("a") }, "a element"],
//   [function() { return document.createElement("area") }, "area element"],
// ];

// objects.forEach(function(o) {
//   test(function() {
//     var object = o[0]();
//     assert_false("searchParams" in object,
//                  o[1] + " should not have a searchParams attribute");
//   }, "searchParams on " + o[1]);
// });

test(function() {
  var url = new URL("./foo", "http://www.example.org");
  assert_equals(url.href, "http://www.example.org/foo");
  assert_throws(new TypeError(), function() {
    url.href = "./bar";
  });
}, "Setting URL's href attribute and base URLs");

test(function() {
  assert_equals(URL.domainToASCII, undefined);
}, "URL.domainToASCII should be undefined");

test(function() {
  assert_equals(URL.domainToUnicode, undefined);
}, "URL.domainToUnicode should be undefined");
/* eslint-enable */