mirror of
https://github.com/overte-org/overte.git
synced 2025-08-05 16:10:11 +02:00
Add a few more .resolvePath characterization tests
This commit is contained in:
parent
8582c7af7b
commit
c559838dbb
1 changed files with 17 additions and 1 deletions
|
@ -15,10 +15,20 @@ describe('Script', function () {
|
||||||
// characterization tests
|
// characterization tests
|
||||||
// initially these are just to capture how the app works currently
|
// initially these are just to capture how the app works currently
|
||||||
var testCases = {
|
var testCases = {
|
||||||
|
// special relative resolves
|
||||||
'': filename,
|
'': filename,
|
||||||
'.': dirname,
|
'.': dirname,
|
||||||
'..': parentdir,
|
'..': parentdir,
|
||||||
|
|
||||||
|
// local file "magic" tilde path expansion
|
||||||
|
'/~/defaultScripts.js': ScriptDiscoveryService.defaultScriptsPath + '/defaultScripts.js',
|
||||||
|
|
||||||
|
// these schemes appear to always get resolved to empty URLs
|
||||||
|
'qrc://test': '',
|
||||||
'about:Entities 1': '',
|
'about:Entities 1': '',
|
||||||
|
'ftp://host:port/path': '',
|
||||||
|
'data:text/html;text,foo': '',
|
||||||
|
|
||||||
'Entities 1': dirname + 'Entities 1',
|
'Entities 1': dirname + 'Entities 1',
|
||||||
'./file.js': dirname + 'file.js',
|
'./file.js': dirname + 'file.js',
|
||||||
'c:/temp/': 'file:///c:/temp/',
|
'c:/temp/': 'file:///c:/temp/',
|
||||||
|
@ -31,6 +41,12 @@ describe('Script', function () {
|
||||||
'/~/libraries/utils.js': 'file:///~/libraries/utils.js',
|
'/~/libraries/utils.js': 'file:///~/libraries/utils.js',
|
||||||
'/temp/file.js': 'file:///temp/file.js',
|
'/temp/file.js': 'file:///temp/file.js',
|
||||||
'/~/': 'file:///~/',
|
'/~/': 'file:///~/',
|
||||||
|
|
||||||
|
// these schemes appear to always get resolved to the same URL again
|
||||||
|
'http://highfidelity.com': 'http://highfidelity.com',
|
||||||
|
'atp:/highfidelity': 'atp:/highfidelity',
|
||||||
|
'atp:c2d7e3a48cadf9ba75e4f8d9f4d80e75276774880405a093fdee36543aa04f':
|
||||||
|
'atp:c2d7e3a48cadf9ba75e4f8d9f4d80e75276774880405a093fdee36543aa04f',
|
||||||
};
|
};
|
||||||
describe('resolvePath', function () {
|
describe('resolvePath', function () {
|
||||||
Object.keys(testCases).forEach(function(input) {
|
Object.keys(testCases).forEach(function(input) {
|
||||||
|
@ -42,7 +58,7 @@ describe('Script', function () {
|
||||||
|
|
||||||
describe('include', function () {
|
describe('include', function () {
|
||||||
var old_cache_buster;
|
var old_cache_buster;
|
||||||
var cache_buster = '#' + +new Date;
|
var cache_buster = '#' + new Date().getTime().toString(36);
|
||||||
beforeAll(function() {
|
beforeAll(function() {
|
||||||
old_cache_buster = Settings.getValue('cache_buster');
|
old_cache_buster = Settings.getValue('cache_buster');
|
||||||
Settings.setValue('cache_buster', cache_buster);
|
Settings.setValue('cache_buster', cache_buster);
|
||||||
|
|
Loading…
Reference in a new issue