Skip to content

Commit

Permalink
tests for jaws.assets.load()
Browse files Browse the repository at this point in the history
  • Loading branch information
ippa committed Aug 19, 2014
1 parent 456c90e commit 535d1ee
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions test/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,29 @@ test("audio wildcard assets", function() {

});

/*
test("assets.load()", function() {
stop()
asyncTest("assets.load()", function(assert) {
expect(1);
var assets = new jaws.Assets()
assets.root = "assets/"
var load = function(event) {
assert.ok( assets.get("rect.png"), "load-callback loaded image");
QUnit.start();
}
// var error = function() { assert.ok(false, "error callback doesn't get called"); }
assets.load("rect.png", {onload: load});
});

asyncTest("assets.load() error", function(assert) {
expect(1);
var assets = new jaws.Assets()
assets.root = "assets/"
var load = function() { ok(jaws.assets.get("rect.png"), "load-callback loaded image"); start() }
var error = function() { ok(false, "error callback doesn't get called"); start() }
assets.load("rect.png", {onload: load, onerror: error});
var error = function(event) {
assert.ok(true, "error callback should be caled");
QUnit.start();
}
assets.load("rect_404.png", {onerror: error});
});
*/


test("image asset with 404s", function() {
stop()
Expand Down

0 comments on commit 535d1ee

Please sign in to comment.