blob: 4ce3039db3f6720eab72be8534cb7bec100e32d0 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src=../media-file.js></script>
<script src=../video-test.js></script>
<script>
function loaded()
{
consoleWrite("<br>*** Initialize with string.");
run("cue = new DataCue(2, 6, 'test')");
testExpected("cue.id", "");
testExpected("cue.startTime", 2);
testExpected("cue.endTime", 6);
testExpected("cue.pauseOnExit", false);
testExpected("typeof cue.value", "string");
testExpected("cue.value", 'test');
testExpected("cue.data", null);
testExpected("cue.type", '');
consoleWrite("<br>*** Initialize with an object.");
run("cue = new DataCue(9, 16, { data: [1, 2, 3] }, 'org.test')");
testExpected("cue.id", "");
testExpected("cue.startTime", 9);
testExpected("cue.endTime", 16);
testExpected("cue.pauseOnExit", false);
testExpected("typeof cue.value", "object");
testExpected("JSON.stringify(cue.value)", '{"data":[1,2,3]}');
testExpected("cue.data", null);
testExpected("cue.type", 'org.test');
consoleWrite("<br>*** Set .value to an array.");
run("cue.value = [1,2,3]");
testExpected("JSON.stringify(cue.value)", JSON.stringify([1,2,3]));
testArraysEqual("cue.value", [1,2,3]);
consoleWrite("<br>*** Set .data to an ArrayBuffer, .value should return null.");
run("cue.data = new Uint8Array([1, 2, 3, 4, 5, 6]).buffer");
testExpected("cue.value", null);
consoleWrite("");
endTest();
}
</script>
</head>
<body onload="loaded()">
<p>Tests DataCue.value</p>
</body>
</html>