Test for previous space encoding fix

This commit is contained in:
Rob Lourens 2015-12-20 20:28:41 -08:00
Родитель f46c566cc4
Коммит 85a46a03ce
1 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -208,10 +208,17 @@ suite('Utilities', () => {
assert.equal(getUtilities().webkitUrlToClientPath('', TEST_WEBKIT_LOCAL_URL), TEST_CLIENT_PATH);
});
test('uri encodings are fixed', () => {
test('uri encodings are fixed for file:/// paths', () => {
const clientPath = 'c:\\project\\path with spaces\\script.js';
assert.equal(getUtilities().webkitUrlToClientPath(TEST_WEB_ROOT, 'file:///' + encodeURI(clientPath)), clientPath);
});
test('uri encodings are fixed in URLs', () => {
const pathSegment = 'path with spaces\\script.js';
const url = 'http:\\' + encodeURIComponent(pathSegment);
assert.equal(getUtilities().webkitUrlToClientPath(TEST_WEB_ROOT, url), path.join(TEST_WEB_ROOT, pathSegment));
});
});
suite('canonicalizeUrl()', () => {