Skip to content

Commit b7867d0

Browse files
committed
Also add tests for video not found
1 parent 1bddf85 commit b7867d0

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/systems/material.test.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ var IMAGE2 = 'base/tests/assets/test2.png';
66
var IMAGE_FAIL = 'base/tests/assets/nonexistent.png';
77
var VIDEO1 = 'base/tests/assets/test.mp4';
88
var VIDEO2 = 'base/tests/assets/test2.mp4';
9+
var VIDEO_FAIL = 'base/tests/assets/nonexistent.mp4';
910

1011
suite('material system', function () {
1112
setup(function (done) {
@@ -143,6 +144,15 @@ suite('material system', function () {
143144
done();
144145
});
145146
});
147+
148+
test('returns null when video fails to load', function (done) {
149+
var system = this.system;
150+
151+
system.loadTexture(VIDEO_FAIL, {}, function (texture) {
152+
assert.equal(texture, null);
153+
done();
154+
});
155+
});
146156
});
147157

148158
suite('loadVideo', function () {
@@ -217,6 +227,15 @@ suite('material system', function () {
217227
done();
218228
});
219229
});
230+
231+
test('returns null when video fails to load', function (done) {
232+
var system = this.system;
233+
234+
system.loadTextureSource(VIDEO_FAIL, function (source) {
235+
assert.equal(source, null);
236+
done();
237+
});
238+
});
220239
});
221240
});
222241
});

0 commit comments

Comments
 (0)