Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
57
gaia/apps/sharedtest/test/unit/url_helper_test.js
Executable file
57
gaia/apps/sharedtest/test/unit/url_helper_test.js
Executable file
|
|
@ -0,0 +1,57 @@
|
|||
/* global UrlHelper */
|
||||
|
||||
require('/shared/js/url_helper.js');
|
||||
|
||||
suite('URL Helper', function() {
|
||||
'use strict';
|
||||
test('isNotURL => true', function() {
|
||||
[
|
||||
'data',
|
||||
'a ? b',
|
||||
'a . b ?',
|
||||
'what is mozilla',
|
||||
'what is mozilla?',
|
||||
'www.blah.com foo',
|
||||
'a?some b',
|
||||
'docshell site:mozilla.org',
|
||||
'?mozilla',
|
||||
'?site:mozilla.org docshell',
|
||||
'http:',
|
||||
'http://',
|
||||
'data:',
|
||||
'view-source:',
|
||||
'app:',
|
||||
'rtsp:'
|
||||
].forEach(function(input) {
|
||||
assert.ok(UrlHelper.isNotURL(input));
|
||||
});
|
||||
});
|
||||
|
||||
test('isNotURL => false', function() {
|
||||
[
|
||||
'http://foo',
|
||||
'blerg.co.uk',
|
||||
'blach.com',
|
||||
'www.blah.com',
|
||||
'a:80',
|
||||
'a?',
|
||||
'a?b',
|
||||
'http://foo.com',
|
||||
'data:about',
|
||||
'view-source:http://foo.com/',
|
||||
'rtsp://100.100.100.100/rtsp.mp4'
|
||||
].forEach(function(input) {
|
||||
assert.ok(!UrlHelper.isNotURL(input));
|
||||
});
|
||||
});
|
||||
|
||||
test('resolveUrl', function() {
|
||||
var result = UrlHelper.resolveUrl('/bar', 'http://foo.com/');
|
||||
assert.equal(result, 'http://foo.com/bar');
|
||||
});
|
||||
|
||||
test('getHostname', function() {
|
||||
var result = UrlHelper.getHostname('http://example.com');
|
||||
assert.equal(result, 'example.com');
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue