diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:56:53 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:56:53 +0000 |
commit | a9c818418b81b93680170e1a84d4e221e578ad2f (patch) | |
tree | 5b883aa428f1edb12f5d40f9768438ee16a7ed6b /debian/missing-sources/mediaelement/test/Spec-CreateRemove.js | |
parent | Adding upstream version 6.4.3+dfsg1. (diff) | |
download | wordpress-a9c818418b81b93680170e1a84d4e221e578ad2f.tar.xz wordpress-a9c818418b81b93680170e1a84d4e221e578ad2f.zip |
Adding debian version 6.4.3+dfsg1-1.debian/6.4.3+dfsg1-1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/missing-sources/mediaelement/test/Spec-CreateRemove.js')
-rw-r--r-- | debian/missing-sources/mediaelement/test/Spec-CreateRemove.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/debian/missing-sources/mediaelement/test/Spec-CreateRemove.js b/debian/missing-sources/mediaelement/test/Spec-CreateRemove.js new file mode 100644 index 0000000..8735efa --- /dev/null +++ b/debian/missing-sources/mediaelement/test/Spec-CreateRemove.js @@ -0,0 +1,45 @@ +describe("HTMLMediaElement", function() { + var player; + var element; + var domElem; + var NETWORK_EMPTY = 0, NETWORK_IDLE = 1, NETWORK_LOADING = 2, NETWORK_NO_SOURCE = 3; + var HAVE_NOTHING = 0, HAVE_METADATA = 1, HAVE_CURRENT_DATA = 2, HAVE_FUTURE_DATA = 3, HAVE_ENOUGH_DATA = 4; + var METADATA_TIMEOUT = 500, ENOUGH_DATA_TIMEOUT = 1000; + + beforeEach(function() { + }); + + afterEach(function() { + }); + + it("should be able to create and remove a player and clean up everything", function() { + runs(function() { + $('body').prepend('<video width="640" height="360" id="player1" poster="../media/echo-hereweare.jpg">' + + '<source type="video/mp4" src="../media/echo-hereweare.mp4" ></source>' + + '<source type="video/webm" src="../media/echo-hereweare.webm" ></source>' + + '</video>'); + player = new MediaElementPlayer('#player1', { + enableAutosize: false, + success: function(mediaElement, domObject) { + element = mediaElement; + domElem = domObject; + } + }); + }); + waitsFor(function() { + return element !== null; + }, "MediaElement should have loaded", 5000); + runs(function() { + expect(element.pluginType).toEqual('native'); + player.remove(); + player = null; + element = null; + domElem.parentNode.removeChild(domElem); + domElem = null; + // Issue #670: https://github.com/johndyer/mediaelement/issues/670 + expect(mejs.players.length).toEqual(0); + + }); + }); + +}); |