summaryrefslogtreecommitdiffstats
path: root/dom/media/test/seek_support.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /dom/media/test/seek_support.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/media/test/seek_support.js')
-rw-r--r--dom/media/test/seek_support.js55
1 files changed, 55 insertions, 0 deletions
diff --git a/dom/media/test/seek_support.js b/dom/media/test/seek_support.js
new file mode 100644
index 000000000..b193fb60a
--- /dev/null
+++ b/dom/media/test/seek_support.js
@@ -0,0 +1,55 @@
+SimpleTest.requestLongerTimeout(3);
+var manager = new MediaTestManager;
+
+// https://bugzilla.mozilla.org/show_bug.cgi?id=634747
+if (navigator.platform.startsWith("Win")) {
+ SimpleTest.expectAssertions(0, 5);
+} else {
+ // This is "###!!! ASSERTION: Page read cursor should be inside range: 'mPageOffset <= endOffset'"
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=846769
+ SimpleTest.expectAssertions(0, 5);
+}
+
+function createTestArray() {
+ var tests = [];
+ var tmpVid = document.createElement("video");
+
+ for (var testNum=0; testNum<gSeekTests.length; testNum++) {
+ var test = gSeekTests[testNum];
+ if (!tmpVid.canPlayType(test.type)) {
+ continue;
+ }
+
+ var t = new Object;
+ t.name = test.name;
+ t.type = test.type;
+ t.duration = test.duration;
+ t.number = SEEK_TEST_NUMBER;
+ tests.push(t);
+ }
+ return tests;
+}
+
+function startTest(test, token) {
+ var v = document.createElement('video');
+ v.token = token += "-seek" + test.number + ".js";
+ manager.started(v.token);
+ v.src = test.name;
+ v.preload = "metadata";
+ document.body.appendChild(v);
+ var name = test.name + " seek test " + test.number;
+ var localIs = function(name) { return function(a, b, msg) {
+ is(a, b, name + ": " + msg);
+ }}(name);
+ var localOk = function(name) { return function(a, msg) {
+ ok(a, name + ": " + msg);
+ }}(name);
+ var localFinish = function(v, manager) { return function() {
+ v.onerror = null;
+ removeNodeAndSource(v);
+ dump("SEEK-TEST: Finished " + name + " token: " + v.token + "\n");
+ manager.finished(v.token);
+ }}(v, manager);
+ dump("SEEK-TEST: Started " + name + "\n");
+ window['test_seek' + test.number](v, test.duration/2, localIs, localOk, localFinish);
+}