Skip to content

Commit

Permalink
test: use URL fixtures under test/fixtures/wpt/url/resources
Browse files Browse the repository at this point in the history
Removes the following files:

- test/fixtures/url-tests.js
- test/fixtures/url-setter-tests.js
- test/fixtures/url-toascii.js

in favor of:

- test/fixtures/wpt/url/resources/urltestdata.json
- test/fixtures/wpt/url/resources/setters_tests.json
- test/fixtures/wpt/url/resources/toascii.json

Also removes dependency of `fixtures/url-tests.js` in http2 tests
and use `fixtures/person-large.jpg` instead since they are just
looking for a big enough file to transfer.

PR-URL: #24035
Refs: #23192
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
  • Loading branch information
joyeecheung committed Nov 9, 2018
1 parent 8caade8 commit 1357913
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 8,704 deletions.
1,874 changes: 0 additions & 1,874 deletions test/fixtures/url-setter-tests.js

This file was deleted.

6,662 changes: 0 additions & 6,662 deletions test/fixtures/url-tests.js

This file was deleted.

157 changes: 0 additions & 157 deletions test/fixtures/url-toascii.js

This file was deleted.

4 changes: 3 additions & 1 deletion test/known_issues/test-url-parse-conformance.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ require('../common');
const url = require('url');
const assert = require('assert');
const fixtures = require('../common/fixtures');
const tests = require(fixtures.path('url-tests'));
const tests = require(
fixtures.path('wpt', 'url', 'resources', 'urltestdata.json')
);

let failed = 0;
let attempted = 0;
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-http2-compat-serverrequest-pipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const path = require('path');

const tmpdir = require('../common/tmpdir');
tmpdir.refresh();
const loc = fixtures.path('url-tests.js');
const loc = fixtures.path('person-large.jpg');
const fn = path.join(tmpdir.path, 'http2-url-tests.js');

const server = http2.createServer();
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-http2-pipe-named-pipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const path = require('path');

const tmpdir = require('../common/tmpdir');
tmpdir.refresh();
const loc = fixtures.path('url-tests.js');
const loc = fixtures.path('person-large.jpg');
const fn = path.join(tmpdir.path, 'http2-url-tests.js');

const server = http2.createServer();
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-http2-pipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const path = require('path');

const tmpdir = require('../common/tmpdir');
tmpdir.refresh();
const loc = fixtures.path('url-tests.js');
const loc = fixtures.path('person-large.jpg');
const fn = path.join(tmpdir.path, 'http2-url-tests.js');

const server = http2.createServer();
Expand Down
5 changes: 4 additions & 1 deletion test/parallel/test-icu-punycode.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ const icu = internalBinding('icu');
const assert = require('assert');

const tests = require('../fixtures/url-idna.js');
const wptToASCIITests = require('../fixtures/url-toascii.js');
const fixtures = require('../common/fixtures');
const wptToASCIITests = require(
fixtures.path('wpt', 'url', 'resources', 'toascii.json')
);

{
for (const [i, { ascii, unicode }] of tests.entries()) {
Expand Down
4 changes: 3 additions & 1 deletion test/parallel/test-whatwg-url-constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ const { test, assert_equals, assert_true, assert_throws } =
require('../common/wpt');

const request = {
response: require(fixtures.path('url-tests'))
response: require(
fixtures.path('wpt', 'url', 'resources', 'urltestdata.json')
)
};

/* The following tests are copied from WPT. Modifications to them should be
Expand Down
5 changes: 4 additions & 1 deletion test/parallel/test-whatwg-url-custom-domainto.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ const assert = require('assert');
const { domainToASCII, domainToUnicode } = require('url');

const tests = require('../fixtures/url-idna');
const wptToASCIITests = require('../fixtures/url-toascii');
const fixtures = require('../common/fixtures');
const wptToASCIITests = require(
fixtures.path('wpt', 'url', 'resources', 'toascii.json')
);

{
const expectedError = common.expectsError(
Expand Down
4 changes: 3 additions & 1 deletion test/parallel/test-whatwg-url-custom-parsing.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ const URL = require('url').URL;
const assert = require('assert');
const fixtures = require('../common/fixtures');

const tests = require(fixtures.path('url-tests'));
const tests = require(
fixtures.path('wpt', 'url', 'resources', 'urltestdata.json')
);

const originalFailures = tests.filter((test) => test.failure);

Expand Down
4 changes: 3 additions & 1 deletion test/parallel/test-whatwg-url-origin.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ const URL = require('url').URL;
const { test, assert_equals } = require('../common/wpt');

const request = {
response: require(fixtures.path('url-tests'))
response: require(
fixtures.path('wpt', 'url', 'resources', 'urltestdata.json')
)
};

/* The following tests are copied from WPT. Modifications to them should be
Expand Down
4 changes: 3 additions & 1 deletion test/parallel/test-whatwg-url-setters.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ const { test, assert_equals } = require('../common/wpt');
const fixtures = require('../common/fixtures');

const request = {
response: require(fixtures.path('url-setter-tests'))
response: require(fixtures.path(
'wpt', 'url', 'resources', 'setters_tests.json'
))
};

/* The following tests are copied from WPT. Modifications to them should be
Expand Down
4 changes: 3 additions & 1 deletion test/parallel/test-whatwg-url-toascii.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ const { URL } = require('url');
const { test, assert_equals, assert_throws } = require('../common/wpt');

const request = {
response: require(fixtures.path('url-toascii'))
response: require(
fixtures.path('wpt', 'url', 'resources', 'toascii.json')
)
};

/* The following tests are copied from WPT. Modifications to them should be
Expand Down

0 comments on commit 1357913

Please sign in to comment.