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
40
gaia/apps/sharedtest/test/unit/settings_url_test.js
Executable file
40
gaia/apps/sharedtest/test/unit/settings_url_test.js
Executable file
|
|
@ -0,0 +1,40 @@
|
|||
/* global SettingsURL */
|
||||
|
||||
require('/shared/js/settings_url.js');
|
||||
|
||||
suite('SettingsURL', function() {
|
||||
'use strict';
|
||||
var subject;
|
||||
|
||||
suiteSetup(function() {
|
||||
subject = new SettingsURL();
|
||||
});
|
||||
|
||||
test('constructor', function() {
|
||||
assert.ok(!subject._url, 'url is empty on init');
|
||||
assert.ok(!subject._isBlob, 'isBlob is empty on init');
|
||||
});
|
||||
|
||||
test('not a blob', function() {
|
||||
var notBlob = 'http://gaiamobile.org';
|
||||
subject.set(notBlob);
|
||||
assert.ok(!subject._isBlob, 'object is not a blob');
|
||||
assert.equal(subject.get(), notBlob);
|
||||
});
|
||||
|
||||
test('is a blob', function(done) {
|
||||
|
||||
var domBlob = new Blob(['<span>blob</span>'], { type: 'text/xml' });
|
||||
|
||||
var realCreateObjectURL = window.URL.createObjectURL;
|
||||
window.URL.createObjectURL = function() {
|
||||
window.URL.createObjectURL = realCreateObjectURL;
|
||||
|
||||
assert.ok(subject._isBlob, 'object is a blob');
|
||||
assert.notEqual(subject.get(), domBlob);
|
||||
done();
|
||||
};
|
||||
|
||||
subject.set(domBlob);
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue